v1.0.9 — now on npm

env-doctor

The eslint of environment variables.
Catch missing .env entries before they hit production.

$npx @neerav34/env-doctor check
7 languages63 testsMIT licenseVS Code ext
terminal
scroll

Try it live

Paste any code — env-doctor detects all env vars in real time

detected variables5 found
DATABASE_URL
line 4JS/TS
×1
PORT
line 7JS/TS
×1
STRIPE_SECRET_KEY
line 9JS/TS
×1
JWT_SECRET
line 8JS/TS
×1
VITE_API_URL
line 10JS/TS
×1

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

01

Install

One command. Works globally or as a project dev dependency.

$npm install -g @neerav34/env-doctor
02

Run

Point it at any project. It finds .env, .env.example, and scans all source files.

$env-doctor check
03

Fix

See exactly which vars are missing, unused, or drifted — with file and line references.

$env-doctor init # auto-fix .env.example
GitHub Action

Comments 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.

.github/workflows/env-doctor.yml
name: env-doctor
on:
pull_request:
jobs:
check:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: neerav34/env-doctor-action@v1