CLI tool that diffs .env* files across a project to surface key drift
(present in one env, missing in another). Key-based comparison only — never
read or print values, this avoids handling secrets.
src/scanner.ts— finds.env*files on disksrc/parser.ts— parses a file into aSet<string>of keys (viadotenv)src/diff.ts— builds theDriftReport(presence matrix across files)src/report.ts— renders the report (terminal matrix viarenderMatrix, Markdown viarenderMarkdown)src/autofix.ts— appends missing keys (empty value) to files lacking themsrc/index.ts— CLI entry point (commander)
Package manager: pnpm (not npm/yarn). Build via tsup, dev via tsx.
Whenever you add, remove, or change CLI flags, options, output format, or
exit-code behavior, update README.md to match — specifically the options
table, the example output block, and the "How it works" section if the
pipeline steps change. Don't let the README drift from the CLI it documents
(that would be a bit on-the-nose for this project).
- Never compare or surface env values — only key presence. This keeps the tool safe to run against files containing real secrets.
process.exitCodestays0by default regardless of drift found — this is a reporting tool, not a CI gate, unless the user opts in via--fail-on-drift(per user feedback: default to non-failing, let CI users choose to gate on it explicitly).