Skip to main content

Keep your environment files in perfect sync

env-twin automatically synchronizes environment variable keys across all your .env files, with automated backups, rollback protection, and zero configuration required.

Get started in seconds

Install env-twin and synchronize your environment files with a single command

1

Install env-twin

Add env-twin to your project as a development dependency:
npm install --save-dev env-twin
2

Run your first sync

Synchronize all your .env files to ensure they have matching keys:
npx env-twin sync
env-twin automatically detects all .env* files in your current directory and creates a backup before making any changes.
3

Restore from backup (if needed)

If you ever need to restore your environment files, env-twin makes it easy:
npx env-twin restore
This automatically restores the most recent backup. You can also specify a specific backup timestamp.

Key features

Everything you need to manage environment variables across your team

Automated synchronization

Keep all your .env* files in sync automatically. Missing keys are added across all environment files with smart defaults.

Backup & restore

Every change creates a timestamped backup. Restore to any previous state with a single command.

Rollback protection

Failed restore operations automatically roll back. Your environment files are always protected.

Zero dependencies

Built with only Node.js built-in modules. No external dependencies means faster installs and fewer security concerns.

Cross-platform

Works seamlessly on Windows, macOS, and Linux with file permission and timestamp preservation.

Interactive CLI

Smart defaults and interactive prompts guide you through every operation. Automation-friendly with —yes flag.

Ready to streamline your environment files?

Get started with env-twin today and never worry about environment variable mismatches again.

View quickstart guide