What is envfix?
envfix is a tiny environment configuration doctor for Node.js projects. It compares your local .env against .env.example, reports missing, empty, and extra variables, and can append the missing keys for you — all with zero dependencies.
Key capabilities
- Check — compare
.envwith.env.exampleand list missing, empty, and extra variables. - Fix — append missing keys to
.envwithout touching existing lines or values. - Doctor — full health check covering files, syntax, consistency, and Git safety (e.g. whether
.envis tracked or ignored). - Example — generate or sync
.env.examplefrom.env, always stripping values so secrets never leak. - Multi-environment — use
--env/--examplefor any pair, or--allto check every.env*.examplepair in a directory. - CI friendly — meaningful exit codes,
--strictmode,--jsonoutput, and automatic GitHub Actions annotations.
Why it helps
Configuration drift is a common cause of "works on my machine" failures. envfix catches it in seconds, both locally and in CI, and its diagnostics include line numbers for duplicates, invalid names, and unclosed quotes.
Getting started
No installation required:
npx envfix
npx envfix fix
npx envfix doctorIt is open source under the MIT license.

