Global Options
Global options apply to every tcb command, in any order.
Options
| Option | Description |
|---|---|
-h, --help | Show help for the current command |
-e, --env-id <envId> | Environment ID. Falls back to envId in the config file, then to an interactive picker |
-r, --region <region> | Region, see Region |
--json | Output JSON, see JSON Output |
-y, --yes | Skip all confirmation prompts and take the default answer |
--verbose | Print stack traces, API request parameters, and intermediate steps |
--cwd <path>/--workdir <path> | Project directory, see Project Directory |
--config-file <path> | Config file path, resolved relative to the current directory |
--mode <mode> | Environment mode for loading .env, such as development or production |
Region
-r / --region requires the full region identifier; abbreviations are not supported.
| Region | Identifier | Description |
|---|---|---|
| Shanghai | ap-shanghai | Default for the China site |
| Singapore | ap-singapore | Default for the international site |
| Guangzhou | ap-guangzhou | Available with allowlisting |
ap-beijing is not available yet.
The default region depends on the site, which the local isIntl setting decides. See International Site Login to switch. If you are unsure which region you are on, run tcb env list; the trailing output shows the current region.
You can also set the region field in cloudbaserc.json to avoid passing the flag every time:
{
"envId": "your-env-id",
"region": "ap-singapore"
}
JSON Output
| Stream | Content |
|---|---|
stdout | Parseable JSON only, ready for JSON.parse / jq |
stderr | Human-readable logs (info / success / warn / error / debug, including progress) |
Errors are also emitted as JSON on stdout:
{
"error": {
"code": "FUNCTION_NOT_FOUND",
"message": "Function app does not exist",
"exit_code": 4
}
}
Project Directory
--cwd / --workdir have been available since v3.8.8. They are equivalent; if both are given, --cwd wins.
| Item | Affected by the project directory |
|---|---|
| Config file lookup | Yes. Only the project directory is searched, with no traversal to parent directories. Candidates are listed in Config File Lookup |
| Relative paths in the config | Yes. functionRoot, functions[].dir, app.root, hosting, database.migrations, and @file references in integration configs |
.env and --mode | Yes. Resolved relative to the project directory |
| Credentials and config write-back | Yes. Credentials are read from, and cloudbaserc.json written to, the project directory |
| Paths passed on the command line | No. --config-file, fn deploy --dir, fn invoke @file, hosting deploy <localPath>, cloudrun --source / --targetPath, db --dir, and config pull --dir are always relative to the current directory |
A missing value, a non-existent path, or a path that is not a directory returns INVALID_PARAM (exit code 3). --help performs no validation.
Common Combinations
# Unattended run with structured output
tcb fn list --yes --json -e my-env-id
# Troubleshoot a failed deployment
tcb fn deploy app --verbose -e my-env-id
# Operate on a monorepo sub-project from the repo root
tcb fn deploy --cwd apps/shop -e my-env-id
Notes
--env-idis equivalent to the legacy--envId; write--env-idin new scripts- When the environment is outside the default region (Shanghai), the CLI prompts to switch regions and retries
- The command signatures in
--helpcome from the CLI itself, so having an AI read them first reduces hallucinated commands