tcb env use
Sets the global default environment, so later commands can omit -e.
Usage
tcb env use <envId>
Flags
| Flag | Required | Description | Default |
|---|---|---|---|
<envId> | No | Environment ID. Prints the current default environment when omitted | — |
--unset | No | Clear the global default environment | — |
Example
# Set the default environment
tcb env use my-env-id
# Show the current default environment
tcb env use
# Clear it
tcb env use --unset
Versions
The tcb env use command has been available since v3.0.0.
Environment ID resolution
The environment ID is resolved in this order, from lowest to highest priority:
Global configuration (tcb env use) < project cloudbaserc.json < command line -e / --env-id
- The
-eflag always wins - Next comes the environment configured in the project
cloudbaserc.json - The global default environment is the fallback
Several projects on the same machine share the global default environment. When working across projects, pin the environment in cloudbaserc.json.
Related commands
- Environment list
- Configuration file: pin the environment per project