Deploying
Deploy functions to Cluster — preview and production deployments, promote, and undeploy.
Deploying
ccp deploy bundles your code, uploads it, and activates a deployment on Cluster's serverless runtime.
Deploy to Production
ccp deploy --prod
# ◼ Building Function...
# ◼ Creating Deployment...
# ◼ Uploading code...
# ◼ Deploying...
# ◼ my-app deployed!
# › https://my-app.clusterbase.devThe --prod flag (alias: --production) makes this the active production deployment, served at https://{function-name}.clusterbase.dev.
Preview Deployments
Without --prod, you get a preview deployment with its own URL:
ccp deploy
# ◼ my-app deployed!
# › https://abc123.clusterbase.devPreview deployments are useful for testing changes before promoting to production.
Promote a Preview
Promote any preview deployment to production:
ccp promote <deployment-id>This swaps the production deployment to the given deployment ID without redeploying.
Undeploy
Remove a specific deployment:
ccp undeploy <deployment-id>List Deployments
ccp list # or: ccp lsInside a linked project, shows all deployments for that function with their IDs, status, and timestamps.
Run outside a project (or in one that hasn't been deployed yet) and ccp ls instead lists every function in the organization — resolve the org with --org-id, the project config, or the interactive picker. See Functions → Managing Functions.
Deploy Options
| Flag | Description |
|---|---|
--prod / --production | Deploy as the production deployment |
--public-dir <path> | Include a public directory for static assets |
--client <path> | Include a client-side script |
--org-id <id> | Organization ID — skips the org selection prompt |
--function-id <id> | Function ID — skips the function selection / creation prompt |
-y / --yes | Skip confirmation prompts (errors if a required input is still missing) |
<path> | Path to a file or directory (defaults to current directory) |
How It Works
- Bundle — your TypeScript/JavaScript is compiled into a single ESM bundle
- Upload — the bundle (and any assets) are uploaded to Cluster's storage
- Activate — Cluster publishes the new deployment to the runtime
- Route — routes are created for
{function-name}.clusterbase.devand{deployment-id}.clusterbase.dev - Serve — the serverless runtime creates a V8 isolate and starts handling requests
First Deploy
On your first deploy, if .cluster/config.json doesn't have a function_id, CCP resolves one for you:
- Interactive: you're prompted to select an organization, then link an existing function or create a new one.
- Headless (no TTY or
--yes): CCP auto-creates and links a new function named after your project (itspackage.jsonname, else the directory), with no prompts. A single-org account needs no flags; with multiple orgs pass--org-id(otherwise it errors listing them).
Either way the function ID is saved to .cluster/config.json for future deploys.
Build Without Deploying
To test the build step without deploying:
ccp buildThis runs the bundler and reports any errors, but doesn't upload or activate anything.
Headless / CI Deploys
For CI pipelines and AI agents, set CCP_HEADLESS=1 and deploy never blocks on a prompt. On a single-org account, the first deploy needs no flags at all — it auto-creates the function:
export CCP_HEADLESS=1
ccp deploy --prodWith multiple organizations, name the target so CCP doesn't have to guess:
ccp deploy --prod --org-id "$ORG_ID"To deploy to a pre-existing function (skip creation entirely), pass both ids:
ccp deploy --prod --org-id "$ORG_ID" --function-id "$FUNCTION_ID"After the first deploy the IDs are written to .cluster/config.json; commit it to your repo and subsequent deploys reuse it with no flags. ccp link --org-id <id> --function-id <id> seeds that config without uploading code, when you want to link separately from the first deploy.
See Headless Mode for the full reference.