Skip to main content

Pull template

CloudBase CLI provides a convenient template pulling feature, supporting built-in templates, Git repositories, and subdirectory downloads.

Built-in Templates

Supported Templates

  • miniprogram - WeChat Mini Program + CloudBase
  • react - Web application - React + CloudBase
  • vue - Web application - Vue + CloudBase
  • uniapp - Cross-platform application - UniApp + CloudBase
  • rules - AI rules and configurations

Basic Usage

# Download Templates
tcb pull -s miniprogram
tcb pull -s react
tcb pull -s vue

# Specify Output Directory
tcb pull -s miniprogram --output ./my-project

# Force Overwrite
tcb pull -s vue --output ./existing-project --force

# Check Available Templates
tcb pull list

CloudBase Template Hub

Open Source Project Templates

The CloudBase Template Hub offers a rich collection of open-source project templates covering various scenarios such as e-commerce, management systems, games, and tools. You can browse and select suitable open-source project templates at the CloudBase Template Hub.

Usage Process

  1. Browse Templates: Visit the CloudBase Template Hub and browse templates in the "Open Source Projects" category.
  2. Obtain Git Link: Click on the template of interest and obtain the Git repository link on its details page.
  3. Pull Template: Use the tcb pull command to pull the template locally.
  4. AI Development: Use tcb ai or other AIIDE to start AI-assisted development.

Example Operation

# 1. Pull Open Source Project Template
tcb pull -s https://github.com/example/ai-ecommerce-miniprogram

# 2. Enter the project directory
cd ai-ecommerce-miniprogram

# 3. Use AI CLI to start development
tcb ai

Other Supported AI IDE

For configuring other AI IDEs, please refer to the "Other IDE Configuration Methods" section in CloudBase AI ToolKit Getting Started, including:

  • Cursor - Standalone IDE
  • WindSurf - Standalone IDE, VSCode and JetBrains plugins
  • CodeBuddy - VS Code, JetBrains, WeChat Developer Tools, Standalone IDE
  • Tongyi Lingma - Standalone IDE, VS Code and JetBrains plugins
  • Baidu Comate - VS Code and JetBrains plugins
  • GitHub Copilot - VS Code plugin
  • Claude Code - Command-line tool
  • More tool configuration guides...

Git Repository

Supported Formats

  • GitHub: https://github.com/user/repo
  • Gitee: https://gitee.com/user/repo
  • SSH: git@github.com:user/repo.git

Basic Usage

# Pull the entire repository
tcb pull -s https://github.com/TencentCloudBase/awesome-cloudbase-examples

# Pull Subdirectory
tcb pull -s https://github.com/TencentCloudBase/awesome-cloudbase-examples/tree/master/web/overcooked-game

AI Command Integration

Directly specify the template during AI development:

# Use AI Command and Download Templates
tcb ai --template rules
tcb ai --template miniprogram
tcb ai --template react

Error Handling

  • The directory is not empty: the system will ask whether to overwrite, or use --force to force overwrite
  • Git repository does not exist: check if the address is correct and confirm it is a public repository
  • Network Error: check the network connection and retry
  • Invalid subdirectory path: confirm the path and branch name are correct

Notes

  • Windows systems use the \ separator, while cloud paths use the / separator
  • Git subdirectory paths must use the / separator
  • Pull the template in an empty directory