I have the following command...
doppler run -- printenv TEST_PASSWORD
I see the value for TEST_PASSWORD, however, when I run the following...
doppler run -- echo $TEST_PASSWORD
Nothing is returned. How do I echo out existing secrets to debug something?
I ran into this same issue and this is what I understood from mucking around with the environment. Doppler injects the secrets when the command is executed. That means that the containing shell process does not have access to the command.
printenvis a command that uses the argumentTEST_PASSWORDas a key within its own runtime. It doesn't depend on the underlying shell to resolveTEST_PASSWORDto the value you've mapped in doppler. However, when you useecho $TEST_PASSWORD, this won't have any value (or it will have the value that your encompassing shell may have already had, if it did), since doppler hasn't yet injected the value.Try the same thing but instead, put your echo command(s) into a shell script and execute it with
doppler run -- bash script.sh, it will work now because the encompassing shell then executes this command and doppler injects the values therein.