dotenv-cli
dotenv-cli copied to clipboard
Loading Vault files
Just coming in here to say that we would be able to load in the new .env.vault standard if the dotenv version was bumped up to 16.1.4.
Currently we are able to do this by overriding the version resolution in your package.json:
"resolutions": {
"dotenv": "^16.1.4"
},
If you are using .env.vault files you will also be required to set DOTENV_KEY prior to running dotenv-cli
like so:
DOTENV_KEY=\"YOUR_KEY\" dotenv -e .env -- $script
Given this will be a new standard I think we should have a flag for passing the key in directly going forward?
Feel free to make a PR to do so. I think --vault-key YOUR_KEY
would work (I'd not add a short-hand version as I don't think this is to be typed often)
Btw, if you make the PR, ideally we just pass the vault key to dotenv
without exposing it as an env variable (DOTENV_KEY in your example) to the process ($script
in your example)
The dotenv bump is here: https://github.com/entropitor/dotenv-cli/pull/94
Concerning the cli argument:
- I agree, no short hand needed.
- How about
--dotenv-key
rather than--vault-key
?
That would more closely match the pattern set here: https://github.com/motdotla/dotenv/tree/master#dotenv_key
Okay, I think then it makes sense 👍
I'm gonna close as not planned for now, but feel free to still create a PR if you still have this use case.