@ingeni/igs-vault
v1.5.0
Published
A CLI tool to fetch secrets from HashiCorp Vault and write to .env files
Readme
developper:
npm run build
chmod +x dist/index.js
npm link
igs-vault --helphow to use
# setup
igs-vault setup
igs-vault setup-script url username password
# Example
# igs-vault setup-script http://127.0.0.1:8200 admin admin
# init: create igs-vault.json with vault path mappings
igs-vault init .env
# interactive: select root → select sub → saves to igs-vault.json
# example output:
# [{"path": "secret/data/develop/data/test01", "env": ".env"}]
# write env: copy key value from vault then write a file
igs-vault write development/data/your-env .env
# or without arguments (reads from igs-vault.json)
igs-vault write
# read
igs-vault read development/data/your-env
# set key value
igs-vault setkv development/data/your-env key value
# update from env file
igs-vault updatekv development/data/your-env .env.local
# or use path ending with '/' to select from list
igs-vault updatekv development/ .env.local
# or without arguments (reads from igs-vault.json)
igs-vault updatekv
# updatekv behavior:
# - key exists in vault path → update
# - key not in vault path but exists in /global/prod/windows with different value → warn and update
# - key not in vault path and not in global → prompt to add (Yes/No)
# append
# append/change values from vault to .env file
igs-vault append development/data/your-env .env
# or use path ending with '/' to select from list
igs-vault append development/ .env
# or without arguments (reads from igs-vault.json)
igs-vault appendigs-vault.json
When using init, write, or append, paths are saved to igs-vault.json in the current directory.
This allows running append, write, or updatekv without arguments — it will prompt you to select from saved paths.
[
{ "path": "secret/data/develop/data/test01", "env": ".env" },
{ "path": "secret/data/stag/data/test01", "env": ".env.staging" }
]