Skip to main content

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:

ParameterDescriptionRequired
-s, --source <source>Template source: a built-in template name, a Git repository URL, or a zip URLYes
-o, --output <output>Output directory. Defaults to the current project directory.No
-f, --forceOverwrite files with the same names in the target directoryNo

Without --force, files that already exist in the target directory are skipped and only new files are copied.

Built-in Templates​

TemplateDescription
miniprogramWeChat Mini Program + CloudBase
reactWeb application, React + CloudBase
vueWeb application, Vue + CloudBase
uniappCross-platform application, UniApp + CloudBase
rulesAI 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.

FormatExample
GitHubhttps://github.com/user/repo
Giteehttps://gitee.com/user/repo
CNBhttps://cnb.cool/user/repo
SSHgit@github.com:user/repo.git
Subdirectoryhttps://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​

CommandDescription
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> --forceOverwrite files with the same names in the target directory
tcb pull listList 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
  • --force only 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