env-doctor
The eslint of environment variables.
Catch missing .env entries before they hit production.
Try it live
Paste any code — env-doctor detects all env vars in real time
Running entirely in your browser — no data leaves your machine
Everything you need to keep .env clean
7 languages
JS/TS, Python, Go, Ruby, Rust, PHP, Shell, Docker. Dot notation, bracket notation, destructuring, and function calls all detected.
Zero config — or your config
Works out of the box. Drop a .env-doctor.json to set envFile, exampleFile, ignore patterns, strict mode, and more. CLI flags always win.
GitHub Action↗
Drop in two lines of YAML. Comments on every PR with a full table of errors and warnings.
.env.example sync & diff
Run env-doctor init to auto-generate .env.example. Run env-doctor diff to see exactly what changed since the last commit — added, removed, modified.
Monorepo support
Pass --monorepo and each package is scanned independently. Auto-discovers .env.local, .env.production, .env.staging and merges them all.
Secret exposure & audit
Flags browser-exposed secrets (NEXT_PUBLIC_, VITE_) and runs env-doctor audit to detect real leaked credentials — Stripe, AWS, GitHub, npm, and more.
VS Code extension↗
Inline squiggles on every process.env.VAR that's missing from .env.example — as you type, no terminal needed. Install free from the VS Code Marketplace.
Up and running in 30 seconds
Install
One command. Works globally or as a project dev dependency.
npm install -g @neerav34/env-doctorRun
Point it at any project. It finds .env, .env.example, and scans all source files.
env-doctor checkFix
See exactly which vars are missing, unused, or drifted — with file and line references.
env-doctor init # auto-fix .env.exampleComments on every PR.
Automatically.
Add the action to your repo and env-doctor runs on every pull request — posting a comment with a full breakdown of errors, warnings, and passed checks. No setup beyond 8 lines of YAML.
name: env-doctoron:pull_request:jobs:check:runs-on: ubuntu-latestpermissions:pull-requests: writesteps:- uses: actions/checkout@v4- uses: neerav34/env-doctor-action@v1