Getting Started
Get up and running with xenvsync in under a minute.
Prerequisites
- Homebrew, npm, Go 1.25+, or a prebuilt binary
1. Install
Also available via Scoop, Nix, AUR, and binary downloads.
2. Initialize Your Project
Run this in your project root. It generates a 256-bit encryption key and adds it to .gitignore.
.xenvsync.key file is your decryption key. Never commit it. For team sharing, use V2 team mode so each member uses their own X25519 keypair instead.3. Create Your .env File
4. Encrypt (Push)
Encrypt your .env into .env.vault— this file is safe to commit.
5. Decrypt (Pull)
On another machine, after cloning and copying the key:
6. Run with Injected Secrets
Instead of writing a .env file, inject secrets directly into a process. Plaintext only exists in the child process memory.
7. Multiple Environments
Use --env to manage staging, production, and other environments separately.
Merge precedence: .env.shared < .env.staging < .env.local. Use --no-fallback to disable merging.
8. Team Sharing (V2 Vault)
Instead of sharing a symmetric key, each team member generates their own X25519 keypair. The vault is encrypted individually for each member.
xenvsync rotate --revoke <name>Typical Workflow
Developer A Git Repository Developer B ─────────── ────────────── ─────────── .env (plaintext) │ ├── xenvsync push ──► .env.vault (encrypted) │ │ │ git push │ │ │ git pull ◄─────────────┐ │ │ │ │ .env.vault ──► xenvsync pull │ │ │ .env (plaintext) │ │ └── xenvsync run xenvsync run