A tiny CLI that compares your .env against an .env.example template and tells you exactly which keys are missing, which are empty, and which are extra.
Useful when:
- onboarding to a new project and you have no idea what variables it actually needs
- pulling a branch that introduced new config and silently broke your local app
- writing a CI check that fails if the deployed
.envdrifts from the checked-in template
npm install -g envdiffOr run it once without installing:
npx envdiffenvdiff # compares .env against .env.example
envdiff .env.local .env.example # explicit paths
envdiff --helpExit codes:
0— all expected keys present1— keys are missing2— a file does not exist
$ envdiff
actual: /Users/me/app/.env
expected: /Users/me/app/.env.example
missing (2):
- DATABASE_URL
- REDIS_URL
empty (1):
- SECRET_KEY
extra (1):
+ OLD_LEGACY_FLAG
npm install
npm run dev # run from source against the cwd
npm run build # compile to dist/
npm run typecheck # tsc --noEmitMIT