envcs
v1.0.0
Published
CLI to encrypt and version .env files in a dedicated git env branch
Readme
envcs
A Node.js CLI that encrypts .env* files and stores encrypted snapshots in a dedicated git branch: env.
Key model
envcsuses one git branch for storage:envenvcshas its own branch names (default:main) that are independent from your normal git branch- config is a single file:
config.jsononenvbranch - encrypted content-addressed objects:
blobs/objects/<prefix>/<objectId>.json - manifests (tree snapshots):
blobs/manifests/<manifestId>.json - envcs branch refs (heads):
blobs/refs/<envcs-branch>.json - legacy compatibility state remains at:
blobs/<envcs-branch>/state.json
Commands
envcs init [--force]- Detect
.env*files and interactive select - Create/replace
config.json
- Detect
envcs branch- Show active envcs branch and list available envcs branches
envcs branch <name>- Create (if needed) and switch active envcs branch
envcs status [--envcs-branch name]- Show snapshot state, conflict risk, and tracked-file local changes
envcs save [message] [--message "..."] [--envcs-branch name] [--force]- Encrypt tracked files and save snapshot into local
envbranch - Alias:
envcs push
- Encrypt tracked files and save snapshot into local
envcs publish [--remote origin]- Push local
envbranch to remote
- Push local
envcs fetch [--remote origin]- Fetch remote
envbranch into localenv
- Fetch remote
envcs apply [--envcs-branch name] [--force]- Decrypt from local
envbranch snapshot to working files - Alias:
envcs pull
- Decrypt from local
Notes
- Storage writes happen in an isolated temporary clone, then env ref is updated.
- This prevents accidentally committing project folders like backend/frontend to
envbranch. --forceon push bypasses ancestry conflict guard.--forceon pull overwrites locally modified tracked files.- Passphrase caching:
envcs save/apply/statuswill reuse a previously provided passphrase saved in your user config directory (viaenv-paths). - Disable caching: use
--no-storeonsave/apply/status(also works with aliasespush/pull).
