Skip to content

josezuma/env-diff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

env-diff

Compare two .env files. Shows missing keys, extra keys, and value differences. Essential for staging vs production env validation.

License

Author: Jose Zuma


Quick Start

git clone https://github.com/josezuma/env-diff.git
cd env-diff
python3 scripts/diff.py .env.staging .env.prod

Demo

$ python3 scripts/diff.py .env.staging .env.prod

📋 .env Comparison: .env.staging vs .env.prod

🔴 Only in .env.staging:
   DEBUG=true

🟢 Only in .env.prod:
   SECRET_KEY=supersecret

🟡 Different values (2):
   API_KEY
     .env.staging: abc123
     .env.prod: xyz789
   DB_HOST
     .env.staging: localhost
     .env.prod: prod.example.com

📊 Summary:
   Total keys:    .env.staging:   4  |  .env.prod:   4
   In common:    3
   Different:    2
   Missing:      1 in .env.prod  |  1 in .env.staging

Features

Feature Description
Missing keys Keys in file1 but not in file2 (marked 🔴)
Extra keys Keys in file2 but not in file1 (marked 🟢)
Value diff Same key, different values (marked 🟡)
Summary Total counts, common, different, missing
JSON output Machine-readable with --json
No deps Python stdlib only

Why This Tool

.env drift between environments causes bugs. This catches missing config before they reach production.

License

MIT © 2026 Jose Zuma

About

Compare two .env files and report missing/extra keys. Useful for staging vs production env validation.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages