Encrypt and decrypt .vault into a .env file
npm install --save-dev dotvault
yarn add --dev dotvault
And then you should be able to run the CLI with
npx dotvault --help
dotvault CLI [Node: 16.15.0, CLI: 0.0.6]
Usage: dotvault <command>
Commands:
dotvault init Initializes project
dotvault generate-key Generate a new key vault
dotvault encrypt Encrypt vault section from env file to .vault
dotvault decrypt Decrypt .vault to vault section into env file
Options:
--version Show version number [boolean]
-h Show help [boolean]
Please specify a command
dotvault init
.vault created
.env updated
Set your secrets into .env between
// BEGIN VAULT
SECRETS HERE
// END VAULT
generate a key with dotvault generate-key
put it in DOTVAULT_KEY
or -k option
share the key with your team in a secure way
encrypt .env secrets with dotvault encrypt
You MUST commit the .vault for sharing secrets with your team
dotvault decrypt
for updating your .env with .vault