Configuration Precedence
Configuration options are applied in the following order (later sources override earlier ones):This precedence order means command-line flags will always override environment variables, which will override settings in configuration files.
Configuration Files
zCLI supports YAML configuration files in two locations:Global Configuration
Stored in your home directory:~/.config/zerops/zcli.yaml(preferred)~/zerops/zcli.yaml(alternative)
Project-specific Configuration
Stored in your project root:./.zcli.yaml
How Configuration Files Are Merged
- zCLI first loads the global config file
- Then merges in the project-specific config if it exists
- Settings unique to the global config are preserved
- Settings in the project-specific config override duplicate keys from global config
Configuration File Examples
Supported Configuration Keys
Default project ID for commands
Default service ID for commands
Default workspace state for push/deploy:
clean, staged, or allCustom path to zerops.yml file
Default working directory
Enable verbose logging
MTU value for VPN connections
Auto-disconnect from VPN when connecting to a new project
Environment Variables
Standard Environment Variables
Any command-line flag can be set via environment variables by:- Using the
ZEROPS_prefix - Converting the flag name to UPPERCASE
- Using the full flag name (not shorthand)
Special Environment Variables
zCLI recognizes special environment variables that control its behavior:ZEROPS_CLI_TERMINAL_MODE
Controls the interactive mode of zCLI:Terminal mode:
auto- Automatically detect if interactive mode can be used (default)enabled- Force interactive modedisabled- Disable interactive mode (useful in CI/CD)
- Set to
disabledin CI/CD pipelines - Set to
enabledfor rich terminal UI - Leave as
autofor normal usage
ZEROPS_CLI_LOG_FILE_PATH
Sets a custom location for the debug log file:zCLI must have write permissions for the specified log file location.
Logging Configuration
zCLI maintains debug logs for theservice push and service deploy commands to help with troubleshooting.
Log File Locations
Default Locations
zCLI tries these locations in order:/var/log/zcli.log(if zCLI has write permissions)~/.config/zerops/zerops.log(fallback)
Custom Location
Set a custom log location using the environment variable:Verbose Logging
Enable additional debug information using the--verbose flag (or -v):
Viewing Logs
To troubleshoot deployment issues, check the log files:Configuration Examples
Here are some common configuration scenarios:Development Team Setup
CI/CD Pipeline
Multiple Projects
~/.config/zerops/zcli.yaml
.zcli.yaml files in each project directory:
project-a/.zcli.yaml
project-b/.zcli.yaml
Best Practices
Use project-specific configs for team projects
Use project-specific configs for team projects
Store
.zcli.yaml in your project repository so all team members use the same defaults. Add it to version control..zcli.yaml
Use global config for personal preferences
Use global config for personal preferences
Store personal preferences like verbose logging in your global config file.
~/.config/zerops/zcli.yaml
Use environment variables in CI/CD
Use environment variables in CI/CD
Environment variables are perfect for CI/CD pipelines where you need to inject configuration dynamically.
Keep secrets out of config files
Keep secrets out of config files
Never store access tokens in configuration files. Always pass them securely via environment variables or CI/CD secrets.
Enable verbose logging for troubleshooting
Enable verbose logging for troubleshooting
When debugging deployment issues, enable verbose logging to get detailed information in the log files.
Troubleshooting Configuration
Check Current Configuration
View environment variables and their values:Configuration Not Working
Check file location
Ensure your config file is in the correct location:
- Global:
~/.config/zerops/zcli.yamlor~/zerops/zcli.yaml - Project:
./.zcli.yamlin project root
Check precedence
Remember: command-line flags > environment variables > config filesA command-line flag will always override config file settings.
Next Steps
Commands Reference
Explore all available zCLI commands
CLI Overview
Back to CLI overview and quick start