Overview
EnvDoctor is a developer-friendly CLI for finding broken, missing, unused, and unsafe environment variables across your projects. Environment variables are a common source of subtle bugs: values may point to unreachable hosts, API keys may be missing before a service starts, and stale variables may linger after configuration changes.
Features
- Broken variable detection (referenced but not resolvable)
- Missing required variable checks per service
- Unused variable discovery in project scope
- Unsafe value alerts (missing secrets, empty strings, exposed hostnames, default credentials)
- Project-aware scanning with per-project configuration
- JSON and CLI report output
- CI-friendly exit codes
Commands
# Scan the current project
envdoctor scan .
# Check a specific project directory
envdoctor scan /path/to/project
# Scan all tracked projects in a workspace
envdoctor scan --workspace .
# Generate a report
envdoctor scan . --output envdoctor-report.json
Install
python -m venv .venv
pip install -e ".[cli]"
Usage
Configure expected variables per project in an envdoctor.yaml file: project name, environment type, required variables, unsafe patterns. EnvDoctor scans source files and configuration for variable references, compares against the local shell environment and project env files, and reports discrepancies.