cli icon indicating copy to clipboard operation
cli copied to clipboard

[BUG] `doppler secrets download --format=env .env` writes a base64 encoded file

Open remorses opened this issue 6 months ago • 2 comments

Describe the bug doppler secrets download --format=env .env

To Reproduce

  1. Run doppler secrets download --format=env .env

Expected behavior It should write a .env formatted file

Screenshots

CLI Version: v3.75.0

Additional context

remorses avatar Jun 14 '25 09:06 remorses

Hello,

When using doppler secrets download the file will always be encrypted by default, as we don't support downloading an unencrypted file to the filesystem. In our documentation we have an example for storing the file unencrypted, which is not recommended. You would want to use doppler secrets download --no-file --format env > .env for your case,

Generally speaking, the download command is used for generating files that can be used with the --fallback-only --fallback arguments, though that only works with json formatting at this time. While the --format argument is supported, using it with non-default formats must be paired with --no-file to print to stdout in the selected format.

If you're just trying to use the file as a .env in an application, we'd recommend mounting it if possible. Something like the following should work there: doppler run --mount .env --mount-format env -- <command>

ryanrhanson avatar Jun 16 '25 15:06 ryanrhanson

I think it should download a non encrypted file if you pass the env format option, that’s a much better user experience.

The mount command doesn’t work for my use case, when starting a development server with Vite the file gets deleted and recreated in a loop.

remorses avatar Jun 16 '25 16:06 remorses