Deploy
tc deploy
Packs a folder into a .tar.gz, uploads it, and follows the build until it is live (or fails). Creates the project if it doesn't exist yet. How folders are detected and built is covered in Building apps.
tc deploy [DIR] [--project NAME] [--preview] [--purpose "why"] [--quiet] [--json]
| Argument / flag | Description |
|---|---|
DIR | The folder to deploy. Default . |
--project NAME, -p | Project name. Default: tc.json "name", else the folder name. |
--preview | Build and serve a preview URL only; production stays as it is |
--purpose "…" | One line for approvers explaining why the app needs its integrations. Use it when the code calls an integration that needs approval. |
--quiet, -q | Don't print progress |
--json | Print the result as JSON (implies quiet) |
What happens
- The folder is packed and uploaded (
POST /api/projects/:name/deployments?create=true&promote=…). - The CLI streams the deployment's status (
queued→building→deploying→ready). - If the build fails, the last 40 build log lines are printed and
tcexits 1. - Access requests the deploy created (integrations the code uses that aren't granted yet) are listed. The app is live either way; those calls answer
ACCESS_PENDINGuntil someone approves.
Output
Deploying /work/expenses → expenses (48.2 KB)
deployment d8f3a2 queued
building
deploying
ready
Live: https://expenses.apps.contoso.com
Preview: https://expenses--d8f3a2.apps.contoso.com
Access request #14: salesforce Case:read → waiting for Leo Park (calls answer ACCESS_PENDING until approved)
JSON
{
"project": "expenses",
"deployment": { "id": "…", "status": "ready", "kind": "node", "type": "web", "previewUrl": "…", "production": true, "error": null, "createdAt": "…" },
"url": "https://expenses.apps.contoso.com",
"requests": [{ "id": 14, "status": "pending", "integrationName": "salesforce", "scopes": ["Case:read"] }]
}
Errors: No such folder; BUNDLE_TOO_LARGE (over 50 MB packed); Deployment <id> failed: <reason> (with the build log tail); NAME_TAKEN (someone else owns that name); NOT_A_BUILDER (creating projects is limited to builders); READ_ONLY if you can view but not manage the project; PROJECT_ARCHIVED / PROJECT_DISABLED; licence limits answer 402.
The CLI leaves out node_modules, .git, .venv, venv, __pycache__, .env and .DS_Store when it packs the folder. Keep build output and other secrets out yourself. Apps must listen on $PORT (8080).
Examples
tc deploy # current folder
tc deploy examples/budget-dashboard -p budget
tc deploy --preview # try it without touching production
tc deploy --purpose "Support leads see open escalations by account owner"
tc redeploy
Redeploys the current production build with the current environment variables. No rebuild. Use it after tc env set (or pass --redeploy there).
tc redeploy [--project NAME] [--quiet] [--json]
Output
Redeployed expenses (d8f3a2 → d9a1b7) with the current env.
Live: https://expenses.apps.contoso.com
JSON: { "project", "deployment", "url", "from" }.
Errors
| Code | When |
|---|---|
NO_PRODUCTION | No ready production deployment to redeploy |
STATIC_SITE | Static sites have no runtime, so env vars don't reach them |
PROJECT_NOT_ACTIVE | The project is archived or disabled; restore it first |