Diff
Compare env files
diff
Compares two environment files to show differences between them.
Usage
env-mage diff [options]Options
| Option | Description | Default |
|---|---|---|
--from <path> | Source file | .env |
--to <path> | Target file | .env.example |
--values | Include values in comparison | false (keys only) |
--output <format> | Output format: text, json, or table | text |
Example
env-mage diff --from .env.development --to .env.production --valuesExample Output
✓ Reading source file: .env.development
✓ Reading target file: .env.production
⟡ Comparing files:
Added keys (in target):
+ PRODUCTION_MODE
+ CDN_URL
Removed keys (from source):
- DEBUG
- DEV_SERVER_PORT
Changed values:
~ API_URL: "http://localhost:3000" → "https://api.example.com"
~ LOG_LEVEL: "debug" → "error"
✓ Summary: 2 added, 2 removed, 2 changedThings to Know
- Use to verify configuration changes between environments
- Default mode only compares keys (use
--valuesto compare values too) - Color-coded output helps spot differences quickly
- Useful before deployments to ensure proper configuration