Diff your .env files. Secrets stay masked. Written in Rust.
sam-env-diff .env .env.exampleThat's it.
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
}sam-env-diff --bot-helpOne call, ~200 tokens. A bot knows the full interface without parsing docs.
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| Code | Meaning |
|---|---|
| 0 | Files match |
| 1 | Differences found |
| 2 | Error (bad args, file not found) |
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.
Single binary, no runtime, instant startup. Written in Rust.
time sam-env-diff large.env large2.env --bot
cargo install --path .MIT — Sam M., 2026