Securely store and sync .env files across machines using Cloudflare R2. Files are encrypted locally before upload — your secrets never leave your machine unencrypted.
- On first run,
envy initgenerates a local encryption key stored at~/.envy/config.json envy pushencrypts your.envfile and uploads it to R2envy syncdownloads and decrypts it into any directory on any machine
The encryption key never leaves your machine. Without it, the files in R2 are unreadable.
Requires Go 1.21+.
go install github.com/pradeepbgs/envy@latestMake sure ~/go/bin is in your PATH:
# add to ~/.zshrc or ~/.bashrc
export PATH="$PATH:$HOME/go/bin"You'll need a Cloudflare R2 bucket and an API token with read/write permissions.
envy initYou'll be prompted for:
- R2 Endpoint —
https://<account_id>.r2.cloudflarestorage.com - Access Key ID
- Secret Access Key
- Bucket name
Config is saved to ~/.envy/config.json. Keep this file safe — losing it means losing access to your encrypted envs.
envy push <name> <path-to-env-file>envy push myapp /path/to/project/.envenvy sync <name> <target-directory>envy sync myapp /path/to/projectThis writes the decrypted .env to <target-directory>/.env. Use --force to overwrite an existing file:
envy sync myapp /path/to/project --forceenvy listenvy delete <name># machine 1 — push your env
envy push api-service /home/user/projects/api/.env
# machine 2 — pull it down
envy sync api-service /home/user/projects/api- Smarter sync path — currently
syncrequires the full directory path. Next version will let you pass just a folder or file name relative to your current terminal directory, soenvy sync myapp .will just work.
MIT