Pull Template
tcb pull downloads a built-in template or a Git repository to a local directory. It works without signing in.
Basic Usage
tcb pull -s <source> [-o <output>] [-f]
Parameters:
| Parameter | Description | Required |
|---|---|---|
-s, --source <source> | Template source: a built-in template name, a Git repository URL, or a zip URL | Yes |
-o, --output <output> | Output directory. Defaults to the current project directory. | No |
-f, --force | Overwrite files with the same names in the target directory | No |
Without --force, files that already exist in the target directory are skipped and only new files are copied.
Built-in Templates
| Template | Description |
|---|---|
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 configuration |
Examples:
# Pull the WeChat Mini Program template
tcb pull -s miniprogram
# Pull the React template to a specific directory
tcb pull -s react -o ./my-app
# Overwrite files with the same names in the target directory
tcb pull -s vue -o ./my-app --force
# List the available built-in templates
tcb pull list
tcb pull list lists the built-in templates and the supported repository formats:
📋 可用的内置模板:
miniprogram - 微信小程序 + CloudBase
react - Web 应用 - React + CloudBase
vue - Web 应用 - Vue + CloudBase
uniapp - 跨端应用 - UniApp + CloudBase
rules - AI 规则和配置
🌐 支持的 Git 仓库格式:
GitHub: https://github.com/user/repo
Gitee: https://gitee.com/user/repo
CNB: https://cnb.cool/user/repo
SSH: git@github.com:user/repo.git
📁 支持 Git 子目录:
https://github.com/user/repo/tree/main/src/templates
Git Repositories
--source accepts HTTPS and SSH addresses from GitHub, Gitee, and CNB. When the address ends with /tree/<branch>/<subdirectory>, only that subdirectory is pulled.
| Format | Example |
|---|---|
| GitHub | https://github.com/user/repo |
| Gitee | https://gitee.com/user/repo |
| CNB | https://cnb.cool/user/repo |
| SSH | git@github.com:user/repo.git |
| Subdirectory | https://github.com/user/repo/tree/main/src/templates |
Examples:
# Pull the entire repository
tcb pull -s https://github.com/TencentCloudBase/awesome-cloudbase-examples
# Pull only a subdirectory of the repository
tcb pull -s https://github.com/TencentCloudBase/awesome-cloudbase-examples/tree/master/web/overcooked-game
# Pull a CNB repository subdirectory to a specific directory
tcb pull -s https://cnb.cool/user/repo/tree/main/examples -o ./my-project
--source also accepts a zip URL, for example tcb pull -s https://static.cloudbase.net/xxx.zip.
CloudBase Template Hub
The "Open Source Projects" category of the CloudBase Template Hub lists project templates you can pull directly. Copy the Git address from the template details page, then run tcb pull:
tcb pull -s https://github.com/example/ai-ecommerce-miniprogram -o ./shop
Open the project in your AI IDE after the pull finishes. For the steps to connect it to CloudBase, see CloudBase AI Toolkit Quick Start.
Command Reference
| Command | Description |
|---|---|
tcb pull -s <source> | Pull a built-in template or a Git repository |
tcb pull -s <source> -o <dir> | Pull to a specific directory |
tcb pull -s <source> --force | Overwrite files with the same names in the target directory |
tcb pull list | List built-in templates and supported repository formats |
Notes
- MCP configuration files for AI IDEs that already exist in the template are rewritten to point to the CloudBase MCP service
--forceonly overwrites files with the same names, it does not delete other files in the target directory- Git subdirectory paths always use the
/separator - The repository must be public, private repositories fail to pull
- Pull templates into an empty directory to avoid conflicts with existing files