CloudBase CLI Setup Guide
Not connected to CloudBase yet? Have your AI read https://docs.cloudbase.net/skill.md — it installs the plugin, MCP, and Skills by itself. This page is for people already using CloudBase CLI.
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:
- "Build a WeChat Mini Program ordering system with CloudBase" — AI scaffolds pages, creates the cloud database, writes cloud functions, and guides preview
- "Build a reservation management system that lets users place orders and admins update status" — AI models it with CloudBase PostgreSQL, configures permissions, and wires up frontend and backend
- "Add phone-number login to a Web app" — AI enables the auth method and integrates the CloudBase SDK
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 on the domestic site 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, Cursor, aider, Qwen Code)
- Configure the AI tool's model (custom LLM or CloudBase-provided LLM)
- Write the MCP and Skills configuration
After setup, you can start using AI tools for assisted development. You can run tcb ai --setup later to reconfigure the tool, MCP or Skills.
Common flags:
| Flag | Description |
|---|---|
-a, --agent | Pick the AI tool up front and skip the prompt |
--setup | Run the setup wizard (AI tool, MCP, Skills) |
--scope | Where the MCP / Skills config is written: project / global / custom. Use with --setup |
--dir | Custom config directory; required when --scope custom |
--template | Project template: miniprogram / react / vue / uniapp / rules |
--config | Show the current config |
--reset | Reset all config |
--json | Output as JSON |
Start 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
CloudBase CLI supports the following AI coding tools:
| Tool | Arg |
|---|---|
| CodeBuddy Code | -a codebuddy |
| Claude Code | -a claude |
| OpenAI Codex | -a codex |
| Cursor | -a cursor |
| 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: Connection keeps failing with ENOTEMPTY?
A: Leftover files in the local npx cache. Fully quit the AI tool, run the cleanup commands in the FAQ, then reconnect.
Q: How do I switch the AI tool?
A: Run tcb ai --setup to open the setup wizard again and choose a different tool. Add --scope to control whether the MCP / Skills config is written to the project or to your home directory.
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