Skip to main content

CloudBase CLI V3 is here: a command-line tool redesigned for AI agents

CloudBase TeamCloudBase Team
7 min read

We're pleased to announce the official release of CloudBase CLI V3, a CloudBase command-line tool redesigned for AI agents.

This version adds 15 top-level command modules, covering environment management, database, user permissions, routing, domains, logs, AI agents and more. Now every operation of a cloud project, from creation to launch, can be done in the terminal — no console needed.

What V3 changed

  • Filled in the large number of missing commands, so nearly every CloudBase operation can be done in the terminal;
  • Every command has -h / --help self-explanation, letting AI agents discover and understand command functions on their own;
  • Added the tcb docs command, solving the problem that CloudBase docs were hard for agents to read;
  • Full --json output mode, making all command returns machine-readable structured data.

Why CLI V3

We've observed more and more developers using AI tools like Claude Code, Cursor and CodeBuddy to operate CloudBase — creating environments, deploying functions, configuring routes, handing the whole flow to an agent.

But the traditional GUI console isn't agent-friendly: agents can't click buttons, can't read visual feedback on a page, can't handle popup confirmations. Every time they hit an operation the CLI doesn't cover, the agent has to stop and wait for a human.

A CLI is a design better suited to agents. Command-line input and output are structured text that agents can parse and process directly, no visual understanding needed; commands can be composed and scripted, a natural fit for multi-step automation workflows.

CloudBase CLI V3 solves exactly this: fully redesigned for AI agents, so the agent can run the whole way.

15 new commands: full coverage from environment creation to launch

New moduleWhat it does
tcb envFull environment lifecycle — create, plan change, renew, destroy, resource usage query
tcb corsSecure domain management (Web SDK whitelist)
tcb domainsCustom domain binding and SSL certificate management
tcb routesHTTP route configuration (replaces tcb service)
tcb userUser management (create, query, modify, ban, delete)
tcb roleRole and permission policy management (system presets + custom policies)
tcb permissionResource-level access permissions (database collections, storage, cloud functions)
tcb agentAI agent management (create, deploy, update, delete)
tcb aiUnified AI CLI entry, integrating Claude Code / CodeBuddy / Codex / aider and more
tcb logsUnified log search (cloud functions, Cloud Run, database, LLM, CLS syntax)
tcb apiGeneric passthrough to Tencent Cloud APIs — any public API of any Tencent Cloud product
tcb docsIn-CLI documentation search
tcb appOne-click app deploy (auto-detect framework, install deps, build, upload, bind routes)
tcb cloudrunCloud Run management (replaces tcb fun), with canary releases and traffic management
tcb secretsTemporary secret management
tcb dbNoSQL native commands, MySQL SQL execution, backup/rollback, slow-query monitoring

Existing commands were also systematically reorganized: command style migrated from colon-separated (tcb functions:deploy) to space-separated (tcb fn deploy), more in line with CLI conventions. This means operations that in the V2 era required switching between "CLI + console" can now all be done in the terminal.

--help: self-explaining commands

Every command and subcommand in CLI V3 has -h / --help built in, outputting the full usage, parameter list and examples.

Facing an unfamiliar command, an agent doesn't need to check external docs — tcb <command> --help gives structured usage directly:

tcb fn deploy --help

For an agent, this is a zero-cost command discovery mechanism: tcb --help to see the top-level commands, then tcb <command> --help for specifics, exploring layer by layer with no external knowledge needed.

tcb docs: a docs system for agents

When developing against CloudBase, agents often struggle to find the right docs, and search-engine results are frequently outdated or imprecise.

tcb docs lets agents query official CloudBase docs directly in the terminal, no search engine needed:

# list all doc modules
tcb docs list

# read a doc by path
tcb docs read 云函数
tcb docs read https://docs.cloudbase.net/cloud-function/faq

# full-text keyword search
tcb docs search 微信支付

For an agent, this forms an autonomous troubleshooting loop: hit unknown knowledge → tcb docs search → confirm the content → execute the next step. No human intervention, no external search.

tcb docs works without login.

--json output mode: machine-readable output

All V3 subcommands support the global --json parameter. With it, output has no progress bars, no color codes, no human-readable decoration — the agent gets pure structured data.

On success:

{"currentEnvId":"luke-personal-test-new-8d0d90f5f"}

On failure:

{"error":{"code":"FUNCTION_NOT_FOUND","message":"函数 ai-reply 不存在","exit_code":4}}

Combined with V3's six structured exit codes, an agent can route responses by exit code:

Exit codeMeaningAgent response strategy
0SuccessContinue to the next step
1Generic errorCheck command logic, switch approach
2Auth failureTrigger tcb login again
3Parameter errorCall --help to verify parameter format
4Resource not foundVerify the resource name
5Cloud API errorWait and retry
6Local config errorCheck cloudbaserc.json

Failure is no longer a vague error text but a deterministic signal. Agents don't need semantic understanding to guess the next step.

In practice: Claude Code + CLI V3 building an intelligent support ticket system

We built an intelligent support ticket system with Claude Code + CloudBase CLI V3 to verify V3's real capability boundary. The project covers a database, four cloud functions, HTTP routes, user and permission management, a custom domain and an SSL certificate — the full deployment. The whole flow ran through tcb commands, zero console operations.

Step 1: create and activate the environment

tcb env create --alias "ticket-system-prod" --package baas_personal --yes --json
tcb env use luke-personal-test-new-8d0d90f5f --json

Returns { "currentEnvId": "luke-personal-test-new-8d0d90f5f" }. After setting the global default environment, subsequent commands don't need --env-id. V3's environment priority: global config < cloudbaserc.json < -e CLI parameter.

Step 2: initialize the database: the ticket system needs three collections — tickets, ticket_history, user_roles — with indexes created via tcb db nosql execute.

Step 3: deploy cloud functions: four cloud functions (three event functions, one HTTP function):

tcb fn deploy submit-ticket --json
tcb fn deploy assign-ticket --json
tcb fn deploy reply-ticket --json
tcb fn deploy ai-reply --dir . --yes --json

Step 4: configure security rules and user permissions: database security rules, create an ops account, assign the admin role — the agent closes the loop with five commands.

Step 5: configure HTTP routes: tcb routes add configures the /api/ai-reply route, tcb routes list --json outputs the structured route table.

Step 6: bind the custom domain: look up the certificate, bind the domain, create the CNAME record — three steps in one workflow context. tcb api brings the whole Tencent Cloud ecosystem into one entry point.

Step 7: deploy the front end: cd frontend && tcb app deploy --yes, then open the link to see the published web app.

Summary: all CLI, zero console

In the past, AI-assisted development stopped at code generation. AI wrote the code, but deployment and ops still needed a human to open the console manually.

V3's design goal is to make tcb an interface agents can fully control. --json machine-readable output, structured exit codes, the tcb api unified entry, tcb docs self-service documentation — the agent can take over the full chain from environment creation to project launch.

Next time you have an AI agent build a cloud project, try not opening the console at all and see how far it gets.

How to use the V3 CLI

V3's CLI is already on npm:

npm install -g @cloudbase/cli
tcb login

Related docs:

Build your next app on CloudBase

An all-in-one backend covering database, cloud functions, static hosting, and AI capabilities.