Documentation
Environments
Manage development, staging, and production contexts
Creating Environments
configsync env create dev --tier development --color "#22c55e"
configsync env create staging --tier staging --color "#f59e0b"
configsync env create prod --tier production --color "#ef4444" --protect
| --tier <tier> | One of: development, staging, production, custom |
| --color <hex> | Hex color used for terminal effects and prompt |
| --protect | Enable protection (requires typing the name to confirm destructive actions) |
Activating Environments
# Activate an environment
configsync env activate staging
# See current environment
configsync env current
# Deactivate
configsync env deactivate
# List all environments
configsync env list
Environment Shell
Spawn a sub-shell with a specific environment active. When you exit the shell, the environment reverts.
configsync env shell staging
Shell Prompt Integration
Add environment info to your shell prompt with the env hook command.
eval "$(configsync env hook zsh)"
eval "$(configsync env hook bash)"
Exporting Variables
Use env vars to output export statements for the active environment, useful for piping into scripts.
configsync env vars
# Use in a script
eval "$(configsync env vars)"
Resolution Priority
ConfigSync resolves the active environment in this order (first match wins):
--envflag passed to the commandCONFIGSYNC_ENVenvironment variable.configsync-envfile in current or parent directories~/.configsync/active-envglobal setting
Terminal Effects
Each tier applies visual cues to your terminal to reduce the risk of running commands in the wrong environment. Effects include background tint and status bar indicators, colored by the environment's configured color.
Protection Levels
Protection levels are determined by tier and the --protect flag:
| Tier | Behavior |
|---|---|
| development | No confirmation required |
| staging | Prompts for yes/no confirmation |
| production (protected) | Must type the environment name to confirm |
push or pull --force.Deleting Environments
configsync env delete staging