Secure your environment variables โ locally, encrypted, and stream-safe.
Project description
๐ EnvLockr CLI
Secure your environment variables โ locally, encrypted, and stream-safe.
EnvLockr CLI is a tool for developers, streamers, and indie hackers who want full control of their secrets without relying on cloud services.
โจ Features
- Local-first: All secrets stored encrypted on your machine โ no cloud, no account
- Keychain-backed key: The master key lives in your OS keychain (Windows Credential Manager / macOS Keychain / libsecret), not a plaintext file beside the vault โ real protection if your disk is compromised
runinjection:envlockr run -- npm run devinjects secrets straight into the process โ no.envever written to disk- Liveness
verify:envlockr verifychecks whether your stored keys are still live (Stripe, OpenAI, Anthropic, GitHub, Slack) โ catch revoked/rotated keys - Profiles:
--env prodfor isolated per-environment vaults - Offline Mode: Core commands need no internet
- Stream-Safe: No
.envon screen while coding or streaming - Cross-Project Friendly: Works with React, Node.js, Python, and more
- GitHub Action: Scan commits for exposed secrets (Learn more)
๐ Quick Start
1. Install
# Install from PyPI (recommended)
pip install envlockr
# Recommended: keychain-backed key + clipboard support
pip install "envlockr[keychain,clipboard]"
Using an npm-centric workflow? There's an npm wrapper
so envlockr works in package.json scripts and with npx (it proxies to the
Python CLI above):
npm install -g envlockr # wrapper โ still needs the pip package installed
๐ก Without the
keychainextra, the master key falls back to a0600file on disk and EnvLockr warns you. Install the extra for real disk-compromise protection, then runenvlockr secure-keyto migrate an existing key.
Alternative: Install from source
git clone https://github.com/RohanRatwani/envlockr-cli.git
cd envlockr-cli
pip install -e .
2. Commands
| Command | Example | What it Does |
|---|---|---|
| add | envlockr add STRIPE_KEY |
Add a new secret |
| get | envlockr get STRIPE_KEY |
Retrieve a secret |
| list | envlockr list |
List all stored secrets |
| copy | envlockr copy STRIPE_KEY |
Copy secret to clipboard |
| update | envlockr update STRIPE_KEY |
Update an existing secret |
| delete | envlockr delete STRIPE_KEY |
Delete a secret |
| export | envlockr export --output .env |
Export all secrets to .env file |
| import | envlockr import .env |
Import secrets from .env file |
| run | envlockr run -- npm run dev |
Run a command with secrets injected (no .env) |
| verify | envlockr verify |
Check whether stored keys are still live |
| secure-key | envlockr secure-key |
Move the master key into your OS keychain |
| encrypt-vault | envlockr encrypt-vault |
Password-protect your vault for backup |
| decrypt-vault | envlockr decrypt-vault |
Restore a password-protected vault |
| export-vault | envlockr export-vault |
Export vault for team sharing |
| import-vault | envlockr import-vault |
Import a shared vault file |
| --env | envlockr --env prod list |
Use an isolated named profile |
| --version | envlockr --version |
Show version number |
By default
addprompts securely (hidden input). For scripts and CI, pass the value non-interactively:envlockr add API_KEY --value "$API_KEY" --force # from a variable printf '%s' "$API_KEY" | envlockr add API_KEY --stdin # from stdin (no shell history)
โก How to Use in Your Projects
๐ฅ Node.js / React / Vite / Next.js
Option 1 (recommended): run โ inject secrets, no file on disk
envlockr run -- npm run dev
All your secrets are injected into the process environment. Nothing is written
to disk, so there is no .env to accidentally commit or leak on stream.
Option 2: Export to .env file
envlockr export --output .env
npm run dev
Option 3: Inline Injection of a single value
export STRIPE_KEY=$(envlockr get STRIPE_KEY)
npm run dev
Option 3: Import existing .env file
# Migrate your existing .env to encrypted storage
envlockr import .env
rm .env # Delete the unencrypted file
๐ Compatible with
- create-react-app
- Next.js
- Vite
- Remix
- Express
- NestJS
- and more!
๐ See framework-specific examples - React, Next.js, Python, Docker, and more!
๐ฆ Local Storage & Security Model
Your secret values are encrypted with Fernet (AES-128-CBC + HMAC) and stored in:
~/.envlockr/vault.json # encrypted secret values
The master key is stored in one of two places:
- OS keychain (when
envlockr[keychain]is installed) โ the key never touches the filesystem, so readingvault.jsonalone is useless to an attacker. ~/.envlockr/key.key(0600) as a fallback when no keychain is available. In this mode the key sits next to the vault, so disk access = full access โ EnvLockr warns you and you can upgrade withenvlockr secure-key.
For backups and team sharing, encrypt-vault bundles the vault + key behind a
password using PBKDF2-HMAC-SHA256 (600k iterations) with a random per-file salt.
- โ No external cloud or server dependency
- โ Honest about where the key lives โ no false "uncrackable" claims
๐ GitHub Action - Prevent Secret Leaks
EnvLockr includes a GitHub Action that automatically scans your repository for exposed secrets!
Quick Setup
Add this to .github/workflows/envlockr-scan.yml:
name: EnvLockr Secret Scan
on: [pull_request, push]
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Scan for secrets
run: |
curl -sSL https://raw.githubusercontent.com/RohanRatwani/envlockr-cli/main/.github/scripts/scan-secrets.sh | bash
What it does:
- โ Scans commits for API keys, tokens, and passwords
- โ Blocks PRs if secrets are detected
- โ Posts helpful comments with fix instructions
- โ Detects AWS, Stripe, GitHub, Google, OpenAI, and more
๐ Full GitHub Action Documentation
๐ How EnvLockr is different
There are great tools in this space โ EnvLockr fills the gaps they leave:
| EnvLockr | dotenvx | SOPS | gitleaks | |
|---|---|---|---|---|
| Key off-disk (OS keychain) | โ | โ (.env.keys on disk) |
โ ๏ธ external KMS/age setup | n/a |
Run cmd with no .env written |
โ
run -- |
โ ๏ธ decrypts to env, needs config | โ | n/a |
| Check if stored keys are still live | โ
verify |
โ | โ | โ |
| Zero-config, single command | โ | โ ๏ธ multi-step workflow | โ steep | โ (scan only) |
| Manages secrets and scans for leaks | โ | โ (manager only) | โ | โ (scanner only) |
- vs dotenvx โ dotenvx keeps the decryption key in a
.env.keysfile on disk; EnvLockr puts it in your OS keychain and can run your app with nothing written to disk. - vs gitleaks/trufflehog โ those are scanners, not managers. trufflehog can
verify secrets it finds by scanning; EnvLockr's
verifydoes that for the vault you actively manage โ plus it gives you a place to put the secrets (and wraps gitleaks for scanning when present). - vs SOPS/Vault โ no KMS, no server, no YAML โ one
pip installand you're running.
๐ฌ Why EnvLockr?
- ๐ Protect your keys without trusting the cloud
- ๐ฅ Stream coding sessions without leaking environment secrets
- โก Speed up local development with simple, fast secret management
๐ Documentation
- Quick Reference Guide - Common commands and workflows
- Framework Examples - React, Next.js, Python, Node.js, Docker
- GitHub Action Setup - Prevent secret leaks in CI/CD
- Contributing Guide - Help improve EnvLockr
- Changelog - Version history
๐ฅ What's Next?
We're exploring new features for EnvLockr, including:
- Advanced environment injection (
envlockr inject -- npm run dev) - Desktop UI app
- IDE integrations (VS Code, JetBrains)
๐ Join the Waitlist and share your thoughts!
๐ก We Want Your Feedback!
Which features would you love to see in EnvLockr?
- ๐ฌ GitHub Discussions
- ๐ Report Issues
- ๐ Star us on GitHub
๐ก๏ธ License
This project is licensed under the MIT License.
Made with โค๏ธ by Rohan Ratwani
Website ยท
GitHub ยท
Twitter
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file envlockr-2.0.0.post1.tar.gz.
File metadata
- Download URL: envlockr-2.0.0.post1.tar.gz
- Upload date:
- Size: 20.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee331c58e650ebac12b6c7a9742a88f60c4694bde6bc20fca2049c18477bd39c
|
|
| MD5 |
a5e843585bf87eeda1ef90f742874c36
|
|
| BLAKE2b-256 |
0a67ef6866952fae74042404ac3cb74e4af155407235c27d6fccc0668dcede9c
|
File details
Details for the file envlockr-2.0.0.post1-py3-none-any.whl.
File metadata
- Download URL: envlockr-2.0.0.post1-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2555afefa7f03ea54a3fa1a3132ea3d26a210231d9fe4ed2da2475362d9831b5
|
|
| MD5 |
7749aef3c2f9dcd6798b802fe118b8a7
|
|
| BLAKE2b-256 |
2d0c471d54ba476943d645dcec0a1e4532ef678ad87bb589351c590dd46109f8
|