Stop sharing .env files in Discord. I built a zero-setup, E2E encrypted CLI instead.

Published: (June 10, 2026 at 02:04 PM EDT)
2 min read
Source: Dev.to

Source: Dev.to

Sharing environment variables during a quick project hand-off shouldn’t require setting up a heavy enterprise vault like Doppler or Infisical. But it also shouldn’t mean copy-pasting plaintext API keys into Slack or Discord. I wanted a frictionless, terminal-native bridge. So I built share-env: an ephemeral, peer-to-peer CLI for securely sharing .env files. Here is exactly how it is architected under the hood: True Zero-Knowledge E2E Encryption crypto module (AES-256-GCM). The decryption key is passed via a hash fragment in the generated share code (e.g., blue-sky-rocket#a1b2c3d4). The relay server receives the ciphertext, but the hex key after the # never leaves your local machine. Smart Merging (No overwriting) share-env parses the incoming payload using dotenv. If there is a conflict (e.g., you have PORT=3000 locally and the incoming file has PORT=8080), it pauses and interactively asks which value to keep. Pre-Flight Git Guardrails fs module to check your .gitignore before pulling. If .env isn’t safely ignored, the CLI throws a fatal error and physically blocks execution. Burn-After-Reading TTL node-cache to hold encrypted blobs in memory with a strict 10-minute TTL. The millisecond a payload is pulled, it is permanently destroyed. Test it locally in 5 seconds (Zero Setup) .env file: Developer A (Sender): Bash npx share-env push

Developer B (Receiver): Bash npx share-env pull

Source Code & Registry: GitHub: https://github.com/arjunn881/env-share https://www.npmjs.com/package/share-env I spend a lot of my time building in the MERN stack, and juggling local environments across different setups has always been a pain point. I open-sourced the entire monorepo—I’d love for the community to audit the crypto architecture or drop feedback on the CLI UX! — Arjun

0 views
Back to Blog

Related posts

Read more »