Skip to main content

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:

  • "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, aider, Qwen Code)
  • Configure the AI tool (custom LLM or CloudBase-provided LLM)

After setup, you can start using AI tools for assisted development. You can run tcb ai --setup later to switch tools and models.


Client

This client ships CloudBase built in. Setup follows its own marketplace or connectors, and the site follows your login state — nothing to pick here.

Configure your AI tool to connect with CloudBase capabilities. Supports local and remote connection. See connection modes.

Step 1: Install / Configure CloudBase

Install CloudBase CLI:

bash
npm i -g @cloudbase/cli

Initialize:

bash
tcb ai

The wizard walks you through configuring your AI tools. CloudBase CLI ships MCP and the AI development rules built in, so there is nothing to configure by hand.

Start using it:

bash
tcb ai

Step 2: Chat with AI

Enter the following in your AI chat in order:

prompt
Read https://docs.cloudbase.net/skill.md and tell me what it can do
Use CloudBase Skills: 创建一个使用 CloudBase AI 模型的小程序应用,支持流式响应

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:

ToolArg
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

相关资源