A secure secrets-injection CLI that was apparently so hard to build it took:
- one idea pasted into Gemini,
- one PRD,
- one pass through Codex,
- and less time than a mediocre coffee break.
Total effort: ~20 minutes.
Enterprise security theater effort saved: incalculable.
- Encrypts secrets at rest (
~/.envkey/vault.db) using Argon2id + AES-256-GCM. - Stores secrets by profile (
dev,prod, etc). - Injects secrets into child processes without polluting parent shell env.
- Prints shell exports when you want to
evalinto current shell. - Lets you list and remove profiles/keys when cleanup is needed.
cargo build --release
# binary: target/release/envkey
# optional shorthand: ek (symlink envkey -> ek)envkey add --profile dev OPENAI_API_KEY sk-...
# or
ek add --profile dev OPENAI_API_KEY sk-...envkey run --profile dev -- node app.js
# or
ek run --profile dev -- node app.jseval "$(ek env --profile dev)"Produces lines like:
export OPENAI_API_KEY='sk-...'
export ANTHROPIC_API_KEY='sk-ant-...'
export REPLICATE_API_TOKEN='r8_...'ek profilesek profile-rm --profile dev
# non-interactive
ek profile-rm --profile dev -yek key-rm --profile dev OPENAI_API_KEY
# non-interactive
ek key-rm --profile dev OPENAI_API_KEY -y- Secrets are encrypted at rest.
- Master password is required to decrypt vault data.
runinjects vars into child process only.envintentionally prints plaintext exports for shell consumption. Use it only when you accept that tradeoff.- Destructive commands (
profile-rm,key-rm) require confirmation unless-yis provided.
cargo test
cargo clippy -- -D warnings
cargo fmtBecause setting up “proper secret management” for local dev is usually treated like a six-month transformation program.
It is not.