Skip to content

queiio/envdiff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

envdiff

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 .env drifts from the checked-in template

Install

npm install -g envdiff

Or run it once without installing:

npx envdiff

Usage

envdiff                              # compares .env against .env.example
envdiff .env.local .env.example      # explicit paths
envdiff --help

Exit codes:

  • 0 — all expected keys present
  • 1 — keys are missing
  • 2 — a file does not exist

Example

$ 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

Development

npm install
npm run dev          # run from source against the cwd
npm run build        # compile to dist/
npm run typecheck    # tsc --noEmit

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors