You can easily use the Doppler CLI to create and update secret values.
doppler secrets set command allows you to set one or more secrets at a time:
doppler secrets set KEY1="123" doppler secrets set KEY1="123" KEY2="456"
You can also set the value of a secret to be a file:
doppler secrets set SSH_KEY="$(cat ./id_rsa)"
By default, the CLI will output the key and values on completion which is useful for confirming the value was set as expected.
However, if setting secrets using a script, you'll want prevent this output by using the
doppler secrets set KEY1="123" --silent
When starting out with Doppler, you've likely got an existing app config file (e.g.
config.json) and you can use the
doppler secrets upload command to populate the secrets for a new project without leaving the terminal.
# ENV and JSON formats supported doppler secrets upload sample.env doppler secrets upload secrets.json
Now you know how to set secrets using the Doppler CLI.
We recommend configuring your shell so
doppler secrets set commands aren't stored in your history.
export HISTIGNORE='doppler secrets set*'
HISTORY_IGNORE="(doppler secrets set*)"
Updated about 1 month ago