config Commands
Commands for viewing and managing teactl configuration.
Configuration File
teactl stores configuration in ~/.teabar/config.yaml:
current-context: default
contexts:
default:
organization: my-org
api-url: https://api.teabar.dev
token: <redacted>
staging:
organization: my-org
api-url: https://staging-api.teabar.dev
token: <redacted>
defaults:
provider: hetzner
region: eu-central
output: table teactl config view
Display the current configuration.
teactl config view [flags] Flags
| Flag | Short | Description |
|---|---|---|
--raw | Show raw values (including tokens) | |
--minify | Show minimal output |
Examples
# View config (tokens redacted)
teactl config view
# Show raw values
teactl config view --raw Sample output:
current-context: default
contexts:
default:
organization: my-org
api-url: https://api.teabar.dev
token: <redacted>
defaults:
provider: hetzner
region: eu-central
output: table teactl config set
Set a configuration value.
teactl config set <key> <value> [flags] Examples
# Set default provider
teactl config set defaults.provider aws
# Set default region
teactl config set defaults.region us-east-1
# Set default output format
teactl config set defaults.output json teactl config get
Get a specific configuration value.
teactl config get <key> [flags] Examples
teactl config get defaults.provider
# Output: hetzner
teactl config get current-context
# Output: default teactl config use-context
Switch to a different context.
teactl config use-context <name> Examples
# Switch to staging context
teactl config use-context staging
# Verify
teactl config get current-context
# Output: staging teactl config set-context
Create or modify a context.
teactl config set-context <name> [flags] Flags
| Flag | Description |
|---|---|
--organization | Organization name |
--api-url | API endpoint URL |
Examples
# Create a new context
teactl config set-context staging
--organization my-org
--api-url https://staging-api.teabar.dev
# Authenticate in new context
teactl auth login --context staging teactl config delete-context
Delete a context.
teactl config delete-context <name> Examples
teactl config delete-context old-staging Warning
You cannot delete the current context. Switch to another context first.
teactl config current-context
Show the current context name.
teactl config current-context Examples
teactl config current-context
# Output: default teactl config get-contexts
List all available contexts.
teactl config get-contexts [flags] Examples
teactl config get-contexts Sample output:
CURRENT NAME ORGANIZATION API URL
* default my-org https://api.teabar.dev
staging my-org https://staging-api.teabar.dev
prod prod-org https://api.teabar.dev Environment Variables
Override configuration with environment variables:
| Variable | Description |
|---|---|
TEABAR_CONFIG | Path to config file |
TEABAR_CONTEXT | Context to use |
TEABAR_TOKEN | API token |
TEABAR_API_URL | API endpoint |
TEABAR_ORGANIZATION | Organization |
Examples
# Use a different config file
TEABAR_CONFIG=/path/to/config.yaml teactl env list
# Use specific context
TEABAR_CONTEXT=staging teactl env list
# For CI/CD (token-based auth)
export TEABAR_TOKEN="your-api-token"
export TEABAR_ORGANIZATION="my-org"
teactl env create -f blueprint.yaml --name ci-test Tip
For CI/CD pipelines, use
TEABAR_TOKEN instead of interactive login. Generate tokens at Settings → API Tokens.