CloudBase CLI Setup Guide
CloudBase CLI is a unified command-line tool that integrates multiple mainstream AI coding tools. It supports project-level configuration and includes CloudBase MCP and AI development rules out of the box.
Key benefits:
- Unified management: manage multiple AI coding CLIs with one command
- Built-in MCP and rules: works out of the box without manual MCP server or rule setup
- Project-level configuration: easier team collaboration via shared config
- Multi-model support: supports built-in and custom LLMs (e.g. Kimi K2, Zhipu GLM-4.5)
Examples:
- "Create a users collection" - AI creates database collections automatically
- "Deploy this function" - AI uploads and configures cloud functions
- "Deploy the frontend to CDN" - AI uploads files and configures hosting
No need to switch to the Cloud console — you can do everything from the CLI with natural language.
Prerequisites
Before you start, make sure you have:
Node.js and a CloudBase environment ready
Node.js: Install Node.js v18.15.0 or later:
node --version
If you don’t have it installed, download it from the Node.js website.
CloudBase environment: See Create a CloudBase environment. New users can start for free.
Install CloudBase CLI
Install globally with npm/yarn/pnpm:
npm i -g @cloudbase/cli
Or Yarn 1.x:
yarn global add @cloudbase/cli
Or pnpm:
pnpm add -g @cloudbase/cli
If you have trouble accessing the default npm registry, you can use Tencent’s mirror:
npm i -g @cloudbase/cli --registry=http://mirrors.cloud.tencent.com/npm/
Initialize AI config
Run CloudBase AI CLI:
# Start the setup wizard
tcb ai
On first run, the wizard helps you:
- Choose an AI tool (CodeBuddy Code, Claude Code, OpenAI Codex, aider, Qwen Code)
- Configure the AI tool (custom LLM or CloudBase-provided LLM)
Later, you can run tcb ai --setup to switch tools and models.
Configure your AI tool to connect with CloudBase capabilities. Supports local and hosted connection. See connection modes.
Step 1: Install / Configure CloudBase
安装 CloudBase CLI:
npm i -g @cloudbase/cli初始化配置:
tcb ai配置向导会引导你完成 AI 工具的配置。CloudBase CLI 内置了 MCP 和 AI 开发规则,无需手动配置。
开始使用:
tcb aiStep 2: Chat with AI
Enter the following in your AI chat in order:
Install CloudBase Skills: run npx skills add tencentcloudbase/cloudbase-skills -yUse CloudBase Skills: 在 Android 应用中集成 CloudBase HTTP APIStart using it
# Start the AI tool
tcb ai
# Or run with a preset prompt
tcb ai -- "Create an order management system"
# Or use non-interactive mode
tcb ai -- -p "Hello"
# Show help
tcb ai --help
Supported AI tools
| Tool | Arg |
|---|---|
| CodeBuddy Code | -a codebuddy |
| Claude Code | -a claude |
| OpenAI Codex | -a codex |
| aider | -a aider |
| Qwen Code | -a qwen |
Project-level config
CloudBase CLI supports project-level configuration and stores config files in your project root. This makes it easy to share settings within a team.
FAQ
Q: How do I switch the AI tool?
A: Run tcb ai --setup to open the setup wizard again and choose a different tool.
Q: How do I view current config?
A: Run tcb ai --config.
Q: How do I reset config?
A: Run tcb ai --reset.
More: FAQ