dotenv-cli icon indicating copy to clipboard operation
dotenv-cli copied to clipboard

Loading Vault files

Open TheRealFlyingCoder opened this issue 1 year ago • 3 comments

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?

TheRealFlyingCoder avatar Jun 08 '23 00:06 TheRealFlyingCoder

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)

entropitor avatar Jun 11 '23 13:06 entropitor

The dotenv bump is here: https://github.com/entropitor/dotenv-cli/pull/94

Concerning the cli argument:

  1. I agree, no short hand needed.
  2. 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

motdotla avatar Aug 08 '23 00:08 motdotla

Okay, I think then it makes sense 👍

entropitor avatar Aug 17 '23 07:08 entropitor

I'm gonna close as not planned for now, but feel free to still create a PR if you still have this use case.

entropitor avatar Mar 07 '24 16:03 entropitor