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 (when no AI config is detected), the wizard helps you:
- Choose a default AI tool (CodeBuddy Code, Claude Code, OpenAI Codex, aider, Qwen Code)
- Configure that AI tool (custom LLM or CloudBase-provided LLM)
- Optionally configure MCP / Skills
After setup, you can start using AI tools for assisted development. Later, you can run tcb ai --setup to reconfigure the current tool and update the default tool, MCP / Skills, and config scope (--scope project|global|custom) as needed.
Use --setup for one-click MCP and Skill setup
tcb ai --setup automatically installs and configures MCP and Skills in the setup wizard.
# Interactive setup (recommended)
tcb ai --setup
# CodeBuddy + project scope
tcb ai --setup -a codebuddy --scope project -y
Common options (for tcb ai --setup when configuring AI tool, MCP, and Skills):
--setup: start the setup wizard (configure AI tool, MCP, and Skills)-a, --agent <agent>: specify the AI tool to configure; allowed values areclaude,qwen,codex,aider,codebuddy,cursor--scope <scope>: set the MCP/Skills config target scope; allowed values areproject,global,custom--dir <dir>: set the MCP/Skills config directory; required when--scope customis used-y, --yes: non-interactive mode with default choices
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