CloudBase declarative deployment from a cloudbaserc config (声明式部署, 配置式部署, cloudbaserc 部署) through the deployBuild / deployPlan / deployApply MCP tools. Use when deploying database, functions, app, hosting, or gateway resources described in cloudbaserc.json/yaml as a single desired-state config, when a user wants to build static hosting artifacts locally first (deployBuild), or wants a dry-run plan before applying (deployPlan), or when handling multi-environment deploys via mode / envOverrides. Covers build-plan-apply flow (deployBuild local build → deployPlan dry-run → deployApply confirm=true), hosting build-output neutralization, envId resolution priority, only/skip filtering, concurrency, and continueOnError. Prefer deployBuild (when hosting declares a buildCommand) and deployPlan before deployApply; do not confuse with per-resource tcb CLI deploy or single-function deploy.
94%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
The canonical home for this skill is cloudbase-declarative-deploy in TencentCloudBase/CloudBase-AI-Toolkit
Deploy a whole CloudBase project from one cloudbaserc config as desired state,
using the deployBuild (local hosting build), deployPlan (dry-run) and deployApply
(apply) MCP tools. The orchestrator applies resources in a fixed dependency order:
database → functions → app → hosting → gatewaySibling CloudBase skills ship beside this skill. Use local relative paths such as
../cloudbase-cli/SKILL.md.
Cloud-hosted MCP mode does not guarantee access to a local workspace filesystem or stable relative paths. If a referenced sibling file is not available in cloud mode, use this skill's embedded guidance as source of truth and ask the user for any missing constraints (or to install the missing skill). Do not HTTP-fetch remote skill or protocol markdown into the agent context.
Cross-cutting protocols (required before applying any deploy):
../cloudbase-platform/references/protocols/change-safety-protocol.md../cloudbase-platform/references/protocols/deployment-gate.mdcloudbaserc.json / .yaml / .yml / .js describing multiple
resources, and the user wants to deploy them together as one config.deployBuild).mode + envOverrides.tcb CLI → ../cloudbase-cli/SKILL.md.deployBuild / deployPlan / deployApply in this skill are the local-form declarative
executor. In cloud-hosted MCP mode they are intentionally not registered, because that
runtime has no local cwd and no filesystem-bound execution path.
This is an execution-channel switch, not a capability gap. Everything still deploys, but the artifact is uploaded first and the build runs in the cloud. If those three tools are missing from the tool list, that is expected — pick the channel that matches the resource.
queryFunctions(action=getFunctionUploadUrl, functionName?) returns uploadUrl,
uploadHeaders, cosBucketName, cosBucketRegion, cosObjectName, expiresInSecondsPUT the function zip to uploadUrl with uploadHeadersmanageFunctions(action=createFunction|updateFunctionCode, code={cosBucketName, cosObjectName, cosBucketRegion?}) — phase B deploys from the environment's own COS bucket
(deployMode=cos); pass the triple through unchanged, the schema is strictcontentPath (a local directory) is rejected in cloud mode. For layer contents use
base64Content; for code use the two-phase path above.
queryApps(action=getUploadUrl, serviceName=...) returns uploadUrl, uploadHeaders,
unixTimestampuploadUrl with the returned headers
(Content-Type: application/zip)
package.json plus lockfile is enoughnode_modules explicitlymanageApps(action=deployApp, cosTimestamp=<unixTimestamp>, installCmd?, buildCmd?, deployCmd?)
installCmd / buildCmd / deployCmd are pipeline declarations executed in the cloud
container; you pass data and declarations, you do not run local shell commandsmanageHosting(action=upload) is blocked in cloud mode because it needs a local path.
Deploy a static site through the CloudApp two-step upload above (upload the prebuilt
artifact, exclude node_modules). Uploading or downloading an already-hosted file has no
remote substitute and needs local mode. The other hosting actions (delete,
setWebsiteDocument, enableService, bindDomain, unbindDomain, updateDomain) remain
available.
deployPlan against a local cloudbaserc. Do not claim a plan
was generated or reviewed in cloud mode; state what is about to be deployed and what the
upload contains. Roadmap: upload cloudbaserc as a data artifact, then run server-side
plan/apply orchestration.mode / envOverrides resolution from a project file does
not apply; pass the target environment explicitly.For parameter details, see references/plan-and-apply.md (Cloud-hosted upload pipeline path).
Plan before apply — always.
Run deployPlan first (dry-run, zero side effects). Read the per-resource action
classification and show it to the user before calling deployApply.
Apply requires explicit confirm.
deployApply will refuse unless confirm=true is passed. This is the destructive-write guard.
Deployment Gate.
Before any apply, complete cloudbase-platform/references/protocols/deployment-gate.md
and present the mandatory declaration.
Conservative on existing resources by default.
yes defaults to false → existing resources are skipped, not overwritten. Only pass
yes=true when the user explicitly wants to overwrite/update existing resources.
database failure always aborts.
Even with continueOnError=true, a database-stage failure stops the whole deploy,
because later resources depend on it.
Resolve envId explicitly. Never rely on implicit defaults silently — know which environment is targeted (see the priority table below) and confirm it with the user before applying.
deployPlan returns a list of resource entries. Each status means:
| status | meaning |
|---|---|
create | new resource, will be created |
update | exists, will be overwritten/updated |
skip | no change needed |
conflict | conflict detected — deploy will abort, must resolve first |
deploy | direct overwrite upload |
If any entry is conflict, stop and resolve it before applying.
explicit envId param > cloudbaserc `envId` > logged-in / bound environmentIf none can be resolved, the tool errors out. Prefer confirming the resolved envId with the user before applying to production.
When hosting declares a buildCommand, declarative deploy is a three-step flow —
deployApply no longer runs the local build implicitly:
cloudbaserc config exists under the project root (cwd).hosting has a buildCommand): call
deployBuild({ cwd, mode? }) to produce the local artifacts (builds every hosting
item; pure-static items without a build command are skipped automatically).
deployApply fails with
BUILD_OUTPUT_NOT_FOUND and directs you back to this step — call deployBuild
first, then retry.deployBuild needs no envId and no confirm (local build only, never touches
cloud resources); if dependencies are not installed it fails with
DEPENDENCY_NOT_INSTALLED and tells you to run install first.deployPlan (optionally with mode, envId, only, skip). Read the plan.deployApply with confirm=true (plus yes / concurrency / continueOnError
as needed). Reuse the same mode / envId / only / skip as the plan.
A hosting item with existing build output is uploaded directly (the tool clears
the build command and reports hostingNeutralized: true); rebuild with deployBuild
after source changes so the upload is not stale.For cloud-hosted MCP mode, do not ask for local cwd/filesystem reads; use the
Cloud mode upload-channel flow above.
Use this mental model: build → plan → apply. The build executor depends on resource type.
| resource | typical build executor | deployment path |
|---|---|---|
hosting | deployBuild (local shell build, run before apply) | deployApply uploads the built output directly; missing output → BUILD_OUTPUT_NOT_FOUND |
app (framework=static) | local prebuilt artifact | package upload + deploy record |
app (non-static frameworks) | cloud pipeline | source zip upload + cloud build + deploy |
functions | local zip / cloud build / image pipeline | depends on buildStrategy (zip/cloud/local/image) |
deployBuild builds every hosting item that has a buildCommand (framework mapping or
package.json auto-detection); it skips pure-static items. Build failures surface as
BUILD_FAILED, missing local dependencies as DEPENDENCY_NOT_INSTALLED (run install
first — deployBuild never installs dependencies for you).
Build command resolution follows declaration priority:
explicit config > framework mapping defaults > package.json auto-detection
buildCommand / installCommand / deployCmd are declarative intent in config.
Execution ownership depends on path:
So the answer to "can cloud mode run local CLI commands" is: execution authority is moved from local shell to cloud pipeline; agent transmits declarations and artifacts.
| User task | Read |
|---|---|
| cloudbaserc resource fields & desired-state config shape | references/config-schema.md |
| deployPlan → deployApply two-step flow, parameters, safety | references/plan-and-apply.md |
| Multi-env (mode / envOverrides), envId priority, env vars | references/multi-env.md |
deployBuild) when hosting declares a buildCommand?deployPlan and read the action classification before deployApply?envId?confirm=true only after user confirmation?yes=false unless overwrite of existing resources was explicitly requested?conflict entries before applying?All packaged reference files (required for skill lint reachability):
TencentCloudBase/CloudBase-AI-Toolkit
4f68e90
Canonical home
since Sep 24, 2026
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.