envtainer
v1.0.0
Published
Encrypt, sync, and inject .env files. Zero-config, zero-login, works offline.
Downloads
100
Maintainers
Readme
envtainer
Encrypt, sync, and inject .env files. Zero-config, zero-login, works offline.
Install
npm install -g envtainerQuick Start
# 1. Create your .env file
echo "DB_HOST=localhost\nDB_PASS=secret" > .env
# 2. Initialize — encrypts .env → .env.lock
envtainer init
# 3. Run any command with decrypted env vars injected
envtainer run node server.js
envtainer run npm start
envtainer run python app.pyCommands
envtainer init
Encrypts your current .env file into .env.lock using AES-256-GCM. The encryption key is stored locally at ~/.envtainer.json.
envtainer initenvtainer run <command>
Decrypts .env.lock and injects all values as environment variables, then runs the given command.
envtainer run node server.js
envtainer run "npm run dev"envtainer sync <env>
Saves the decrypted environment to .envs/<env>.env and copies it to .env. Use this to switch between environments.
envtainer sync staging
envtainer sync productionenvtainer list
Shows all saved environments.
envtainer listHow It Works
initgenerates a random encryption key (saved to~/.envtainer.json), reads.env, encrypts it with AES-256-GCM, and writes the ciphertext to.env.lock.rundecrypts.env.lock, injects all variables intoprocess.env, and spawns your command as a child process.syncdecrypts.env.lock, saves a named copy to.envs/<name>.env, and overwrites.envwith it.listscans the.envs/directory for saved environments.
Security
- AES-256-GCM encryption with scrypt key derivation
- Key stored locally at
~/.envtainer.json(never sent anywhere) - Zero network calls — fully offline
- Do NOT commit
.env,.env.lock, or~/.envtainer.jsonto version control
License
MIT
