Configure CLI Behavior
The Doppler CLI can be configured via runtime flags, configuration flags, and the environment. The latter two options allow for controlling the CLI's behavior without needing to specify runtime flags on every command.
To disable reading configuration from the environment, specify the --no-read-env
flag.
Configuration hierarchy
CLI configuration is processed in the following manner, with lower numbers given higher priority:
- Runtime flag
- Environment variable
- Configuration file (if supported)
Example
Given the following commands, where each command specifies a different Doppler config to use, the Doppler config used on line 3 would be bar
.
$ export DOPPLER_CONFIG=foo
$ doppler setup --project backend --config dev
$ doppler run --config=bar -- printenv
bar
is used because line 3 specifies this config with the --config
flag. Had that flag not been passed, the config used on line 3 would have been foo
due to DOPPLER_CONFIG
being specified in the environment. If DOPPLER_CONFIG
had not been specified in the environment AND the --config
flag had not been passed on line 3, then config dev
would have been used due to its existence in the CLI's configuration (from line 2).
Debugging
To see what values the CLI is currently using, run the doppler configure debug
command. This will print each configuration value, as well as the source of each value ("Flag", "Environment", "Config file", etc).
Supported configuration flags
These flags can be enabled/disabled with doppler configure flags enable
and doppler configure flags disable
, respectively.
analytics
: Whether anonymous analytics are enabled.env-warning
: Whether to print a warning when CLI behavior is modified via an environment variable.update-check
: Whether to check for CLI updates.
You can also control these flags by specifying them in your doppler.yaml
and running doppler setup
. An example doppler.yaml
is included below.
flags:
analytics: true
env-warning: true
update-check: true
Supported environment variables
DOPPLER_API_HOST
: The host address of the Doppler API. This is used by Doppler developers when testing against dev and staging environments.DOPPLER_CONFIG
: The Doppler config to use.DOPPLER_CONFIG_DIR
: The location of the directory containing the CLI's configuration file and other metadata files.DOPPLER_ENABLE_DNS_RESOLVER
: Whether to bypass the OS's default DNS resolver and use the DNS resolver built-in to the CLI. When enabled, defaults to Cloudflare's DNS servers.DOPPLER_ENABLE_VERSION_CHECK
: Whether to disable checking for new versions of the Doppler CLI.DOPPLER_PASSPHRASE
: The passphrase to use for encrypting and decrypting the fallback file.DOPPLER_PROJECT
: The Doppler project to use.DOPPLER_TOKEN
: The token to use when communicating with the Doppler API.
Updated 9 months ago