Application Deployment
The tcb app command has been available since v3.0.0.
The tcb app command is used to deploy and manage CloudBase cloud applications. Each deployment overwrites the previous one while retaining historical deployment records (viewable via tcb app versions).
Applicable to the following scenarios:
- Frontend projects with dependency installation + build steps (React / Vue / Next.js / Vite / Angular / Nuxt etc.)
- Pure static projects
- Automated deployment in CI/CD pipelines
The CLI automatically performs: Install dependencies → Build → Upload artifacts → Bind routes without manual file handling. Each deployment overwrites the previous one. View historical deployment records via tcb app versions list.
tcb app deploy
Deploy the application. The CLI will automatically perform: Install dependencies → Build → Upload build artifacts → Bind routes.
The following three invocation methods are completely equivalent:
tcb app deploy [serviceName] [options] # Full command
tcb deploy [serviceName] [options] # Top-level alias
tcb [options] # Standalone command (automatically routes to app deploy when no subcommand is provided)
Parameters
| Parameter | Description | Default Value |
|---|---|---|
[serviceName] | Application name (optional; if omitted, automatically read from package.json or entered interactively) | — |
-e, --env-id <envId> | Target Environment ID | — |
--framework <type> | Framework type: react / vue / vite / next / nuxt / angular / static | — |
--install-command <cmd> | Installation command (skip installation if left blank) | npm install |
--build-command <cmd> | Build command (skip build if left blank, suitable for pure static projects) | — |
--output-dir <dir> | Output directory (default ./dist; use ./ when no build is required) | Auto-detected |
--deploy-path <path> | Static Hosting mount path | /<service-name> |
--cwd <path> | Project directory (relative path) | Current directory |
-f, --force | Skip confirmation and overwrite directly if the application name already exists | — |
Example
# Deploy a Vite project (run in the project root directory)
tcb app deploy --framework vite -e my-env-id
# Using top-level aliases produces identical results
tcb deploy --framework vite -e my-env-id
# Bare command: deploy with interactive guidance without any options
tcb
# Specify project subdirectory (monorepo scenario)
tcb app deploy --cwd ./frontend -e my-env-id
# Deploy a Next.js project and specify the build artifacts directory
tcb app deploy --framework next --output-dir .next -e my-env-id
# Pure static projects (skip the build step)
tcb app deploy --framework static --build-command "" --output-dir ./public -e my-env-id
# CI scenario: Skip confirmation and overwrite the existing application
tcb app deploy --framework react --force -e my-env-id
tcb app list
List applications in the current environment.
tcb app list [options]
Parameters
| Parameter | Description | Default Value |
|---|---|---|
-e, --env-id <envId> | Environment ID | — |
-l, --limit <n> | Number of returned items | 20 |
-o, --offset <n> | Offset | 0 |
--json | Output JSON | — |
Example
tcb app list -e my-env-id
tcb app info
View details of the specified application (status, version, access domain, etc.).
tcb app info <serviceName> [options]
Example
tcb app info my-app -e my-env-id
# JSON Output (Suitable for Scripts to Read Access Domains)
tcb app info my-app --json -e my-env-id
tcb app versions list
View application version history list.
tcb app versions list <serviceName> [options]
Parameters
| Parameter | Description | Default Value |
|---|---|---|
<serviceName> | Application name (required) | — |
-l, --limit <n> | Number of returned items | 20 |
-o, --offset <n> | Offset | 0 |
-e, --env-id <envId> | Environment ID | — |
Example
tcb app versions list my-app -e my-env-id
tcb app versions detail
View details of the specified application version, with the latest version displayed by default.
tcb app versions detail <serviceName> [options]
Parameters
| Parameter | Description | Default Value |
|---|---|---|
<serviceName> | Application name (required) | — |
--version-name <name> | Version name (query the latest version if not specified) | — |
-e, --env-id <envId> | Environment ID | — |
Example
# View details of the latest version
tcb app versions detail my-app -e my-env-id
# View details of the specified version
tcb app versions detail my-app --version-name my-app-001 --env-id env-xxx
tcb app delete
Deleting application records does not delete the underlying application resource files.
tcb app delete <serviceName> [options]
Parameters
| Parameter | Description | Default Value |
|---|---|---|
<serviceName> | Application name (required) | — |
-e, --env-id <envId> | Environment ID | — |
--dry-run | Preview the deletion operation without actual execution | — |
Example
tcb app delete my-app -e my-env-id
# Preview deletion (without actual execution)
tcb app delete my-app -e my-env-id --dry-run
This operation will delete all versions and resources of the application, and it is irreversible. Project resource files need to be manually cleared separately in the Static Hosting bucket.