$npx -y skills add TencentCloudBase/cloudbase-skills --skill cloudbase-cliCloudBase CLI (tcb, 云开发CLI, Tencent CloudBase命令行) resource management skill. This skill should be used when users need to deploy cloud functions, manage CloudRun apps, upload files to storage, query NoSQL/MySQL databases, deploy static hosting, set access permissions, or configur
| 1 | # CloudBase CLI |
| 2 | |
| 3 | Manage CloudBase resources via `tcb` CLI — deterministic, scriptable, auditable. |
| 4 | The preferred interface for AI agents in CI/CD, batch operations, and resource management. |
| 5 | |
| 6 | ## Standalone Install Note |
| 7 | |
| 8 | If this environment only installed the current skill, start from the CloudBase main entry and use the published `cloudbase/references/...` paths for sibling skills. |
| 9 | |
| 10 | - CloudBase main entry: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/SKILL.md` |
| 11 | - Current skill raw source: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/cloudbase-cli/SKILL.md` |
| 12 | |
| 13 | Keep local `references/...` paths for files that ship with the current skill directory. When this file points to a sibling skill such as `cloud-functions` or `cloudrun-development`, use the standalone fallback URL shown next to that reference. |
| 14 | |
| 15 | **Cross-cutting protocols** (load for deployment and change operations): |
| 16 | - Change Safety Protocol: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/cloudbase-platform/references/protocols/change-safety-protocol.md` |
| 17 | - Deployment Gate: `https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/cloudbase-platform/references/protocols/deployment-gate.md` |
| 18 | |
| 19 | ## Core Principles |
| 20 | |
| 21 | 1. **`--help` first — never guess commands.** |
| 22 | tcb CLI changes between versions. Before using any command for the first time, |
| 23 | run `tcb <command> --help` to check parameters and discover official doc links. |
| 24 | |
| 25 | 2. **Deployment Gate.** |
| 26 | Before any deployment, publish, custom domain, or CloudRun operation, you must first complete the checks in `cloudbase-platform/references/protocols/deployment-gate.md`. |
| 27 | |
| 28 | 3. **Verify your work.** |
| 29 | After deploying or modifying any resource, run the corresponding list/detail |
| 30 | command to confirm the change took effect. |
| 31 | |
| 32 | 3. **Dry-run before destructive actions.** |
| 33 | Use `--dry-run` for delete/overwrite operations. Show the preview to the user |
| 34 | and wait for explicit confirmation before executing. |
| 35 | |
| 36 | 4. **Confirm environment first.** |
| 37 | Always verify envId with the user before operations. Run `tcb env use <envId>` |
| 38 | to avoid accidentally modifying production. |
| 39 | |
| 40 | 5. **Recover from errors, don't loop.** |
| 41 | If a command fails after 2-3 attempts, check the exit code (`$?`), read the |
| 42 | error message, consult `tcb docs search`, and try a different approach. |
| 43 | |
| 44 | ## When to use this skill |
| 45 | |
| 46 | Use when the user wants to manage CloudBase resources via command line: |
| 47 | - Deploy/debug cloud functions, web apps, CloudRun services |
| 48 | - Manage storage, hosting, databases (NoSQL/MySQL) |
| 49 | - Configure permissions, CORS, domains, routing |
| 50 | - CI/CD scripting, batch operations, terminal-based resource management |
| 51 | |
| 52 | ## Do NOT use for |
| 53 | |
| 54 | - SDK-based in-app integration (web/miniprogram/node) → use `cloud-functions`, |
| 55 | `no-sql-web-sdk`, `auth-web`, etc. |
| 56 | - MCP tool calls for IDE-integrated workflows → use CloudBase MCP directly |
| 57 | - Console UI operations |
| 58 | - CloudBase Agent SDK development → use `cloudbase-agent-ts` |
| 59 | |
| 60 | ## How to use this skill (for a coding agent) |
| 61 | |
| 62 | 1. **Always load `references/core.md` first** — it covers authentication, |
| 63 | environment switching, `tcb docs` queries, and error diagnosis. |
| 64 | 2. **Route to the correct domain reference** using the Routing table below. |
| 65 | 3. **Load only the one reference file** that matches the user's task. |
| 66 | Do not preload all references. |
| 67 | 4. **Stop loading more context** once you have the workflow and command |
| 68 | syntax for the current task. |
| 69 | 5. **If the task shifts to SDK/in-app code**, switch to the appropriate |
| 70 | SDK skill (e.g., `cloud-functions`, `no-sql-web-sdk`) instead. |
| 71 | |
| 72 | ## Routing |
| 73 | |
| 74 | | User Task | Read | |
| 75 | |-----------|------| |
| 76 | | Login, env switching, tcb docs, error diagnosis | `references/core.md` | |
| 77 | | Deploy/debug cloud functions | `references/functions.md` | |
| 78 | | Deploy web app (React/Vue/Next.js) | `references/app.md` | |
| 79 | | Deploy CloudRun service | `references/cloudrun.md` | |
| 80 | | Deploy static site | `references/hosting.md` | |
| 81 | | Upload/download files, ACL rules | `references/storage.md` | |
| 82 | | NoSQL (MongoDB) database operations | `references/nosql.md` | |
| 83 | | MySQL database operations | `references/mysql.md` | |
| 84 | | Roles, policies, access control | `references/permission.md` | |
| 85 | | CORS, custom domains, routing rules | `references/access.md` | |
| 86 | |
| 87 | ## Quick workflow |
| 88 | |
| 89 | 1. `tcb login` → confirm envId with user → `tcb env use <env |