--help flag for detailed usage information.
Available Commands
sync
Synchronize environment variable keys across all .env* files
restore
Restore .env* files from backups with automatic recovery
clean-backups
Delete old backups while keeping recent ones
Running
env-twin without a command generates a .env.example file from your .env file (see Default Command section below).Command Summary
| Command | Description | Key Features |
|---|---|---|
| sync | Synchronizes environment variable keys across all .env* files | Interactive key resolution, automatic backups, source of truth detection |
| restore | Restores .env* files from backups | Auto-selects most recent backup, rollback capability, dry-run mode |
| clean-backups | Manages backup retention | Configurable retention count, confirmation prompts |
| default | Creates .env.example from .env | Simple key extraction with placeholder values |
Global Options
These options are available across multiple commands:Display command-specific help informationAliases:
-hDisplay the current version of env-twinAliases:
-vSkip confirmation prompts and auto-accept actionsAliases:
-yAvailable in: sync, restore, clean-backupsEnable verbose logging for detailed operation informationAliases:
-VAvailable in: restoreDefault Command
When you runenv-twin without a subcommand, it operates in legacy mode, creating a .env.example file from your .env file:
Default Command Options
Source .env file pathAliases:
--srcDestination .env.example file pathAliases:
--destination, --d, --out, --targetThe default command removes all values and replaces them with placeholder values based on the key names (e.g.,
DATABASE_URL="input_database_url").Quick Start Examples
Getting Help
For detailed information about any command, use the--help flag:
Next Steps
Sync Command
Learn about synchronizing environment files
Restore Command
Explore backup restoration features