Open Source — Local First

Type-check your
environment before
your users do.

EnvDoctor discovers which configuration variables your app expects, validates their types and formats, and catches missing or unsafe values before runtime.

# Generate a contract from your codebase
$ npx envdoctor init

# Validate your current environment
$ npx envdoctor check

# Launch the web dashboard
$ npx envdoctor serve
envdoctor check
───────────────────────────────────────────────────────────────────
EnvDoctor v0.1.0
project: checkout-api · environment: local

───────────────────────────────────────────────────────────────────

✖ 2 blockers · ⚠ 1 warning

BLOCKERS

ENV001 DATABASE_URL is required but missing
→ add DATABASE_URL to your .env file

ENV003 PORT: expected integer, got "not-a-num"
→ ensure PORT is a valid integer

WARNINGS

ENV006 .env.example is missing API_KEY
→ add API_KEY to .env.example
🔍

Code Discovery

Scans source code for process.env.X and import.meta.env.X. Finds what your app actually uses.

Type Validation

Checks integer, boolean, URL, JSON, enum, port. Catches type mismatches before runtime.

🔄

Drift Detection

Compares .env, .env.example, source code, and contract. Finds inconsistencies.

💡

Actionable Fixes

Every diagnostic includes file location, cause, and a suggested fix.

🛡

Secret Safety

Never prints values. Masks credentials in all output. Local-first by default.

💻

CI Ready

--ci flag for stable exit codes. JSON output for integrations. Works in GitHub Actions.

10 Built-in Rules

ENV001Required missing
ENV002Declared but unused
ENV003Invalid type
ENV004Out of range
ENV005Undeclared in contract
ENV006Example incomplete
ENV007Possible misspelling
ENV008Empty required value
ENV009Public has secret
CFG001Cross-file drift