Configuration
Config precedence
Section titled “Config precedence”The CLI resolves settings in this order (highest priority first):
- CLI flags —
--api-key - Environment variables —
ANCLA_API_KEY - Local config —
.ancla/config.yamlin the current directory or any parent - Global config —
~/.ancla/config.yaml
Config file format
Section titled “Config file format”api_key: ancla_your_key_herePer-project config
Section titled “Per-project config”Create a .ancla/config.yaml in your project root to override global settings for that project. The CLI walks up from the current working directory looking for a .ancla/ directory.
mkdir .anclaecho 'api_key: ancla_project_specific_key' > .ancla/config.yamlThis is useful for using different API keys per project or workspace.
Config var scopes
Section titled “Config var scopes”Config variables can be set at different scopes in the resource hierarchy. Use the --scope flag to target a specific level:
| Scope | Flag | Description |
|---|---|---|
| Workspace | --scope workspace | Inherited by all projects, environments, and services in the workspace |
| Project | --scope project | Inherited by all environments and services in the project |
| Environment | --scope env | Inherited by all services in the environment |
| Service | --scope service (default) | Applies only to the specific service |
Examples
Section titled “Examples”# Set a config var at the workspace level (inherited by everything)ancla config set my-ws KEY=val --scope workspace
# Set at the environment levelancla config set my-ws/my-project/production KEY=val --scope env
# Set at the service level (default)ancla config set my-ws/my-project/production/my-service KEY=val
# List config vars at the project scopeancla config list my-ws/my-project --scope projectLower scopes override higher scopes. A service-level config var with the same name as a workspace-level one takes precedence for that service.
Managing settings
Section titled “Managing settings”View current settings
Section titled “View current settings”ancla settings showAPI keys are masked in output.
Set a value
Section titled “Set a value”ancla settings set api_key ancla_your_key_hereOpen in editor
Section titled “Open in editor”ancla settings editOpens the config file in $EDITOR (defaults to vi).
Show config file paths
Section titled “Show config file paths”ancla settings pathShows both the global and local (if found) config file locations.