Compare .env files and environment snapshots. Shows added, removed, and changed keys — built for CLI and CI use.
go install github.com/MrBeldum/envdiff@latestOr build from source:
go build -o envdiff .# Compare two dotenv files
envdiff file .env .env.production
# Compare a dotenv file against the current process environment
# (only keys present in the file, unless --all)
envdiff env .env
envdiff env .env --all
# JSON output for scripts
envdiff file a.env b.env --format json
# Only show changed keys
envdiff file a.env b.env --only changed| Code | Meaning |
|---|---|
| 0 | No differences (after --only filters) |
| 1 | Differences found |
| 2 | Usage or parse error |
MIT