Skip to content

SamInNashville/sam-env-diff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sam-env-diff

Diff your .env files. Secrets stay masked. Written in Rust.

sam-env-diff .env .env.example

That's it.

Bot Mode (Primary Interface)

Designed for AI agents. Clean JSON, no ANSI, no chrome.

sam-env-diff .env .env.example --bot
{
  "left": ".env",
  "right": ".env.example",
  "missing": [{"key": "DATABASE_URL"}],
  "extra": [{"key": "DEBUG_MODE", "val": "****true"}],
  "changed": [{"key": "API_KEY", "left": "****7f3a", "right": "****0000"}],
  "match": 12,
  "ok": false
}

Machine-Readable Interface Spec

sam-env-diff --bot-help

One call, ~200 tokens. A bot knows the full interface without parsing docs.

All Flags

sam-env-diff .env .env.example          # 90% use case
sam-env-diff .env .env.example --all    # show matching keys too
sam-env-diff .env .env.example --bot    # JSON output
sam-env-diff .env .env.example -o out.json  # write JSON to file
sam-env-diff .env .env.example --reveal # unmask values (dangerous!)
sam-env-diff --bot-help                 # machine-readable spec

Exit Codes

Code Meaning
0 Files match
1 Differences found
2 Error (bad args, file not found)

Why This Exists

Every .env comparison tool either shows full secrets in the terminal or doesn't understand the format. This one masks by default (****7f3a), handles every edge case (quotes, export prefix, multiline, BOM, CRLF), and speaks JSON for bots.

Performance

Single binary, no runtime, instant startup. Written in Rust.

time sam-env-diff large.env large2.env --bot

Install

cargo install --path .

License

MIT — Sam M., 2026

About

Diff your .env files. Secrets stay masked. Fast. sam-env-diff .env .env.example

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages