env-grep
A command-line tool for Python projects that scans source files for environment variable usage and cross-references them against .env.example to surface missing or undocumented variables before they cause issues in production.
Why env-grep?
Environment variable mismatches are a common source of production failures. A variable used in code but absent from .env.example means the next developer to clone the repo will have no way of knowing it needs to be set — until something breaks.
env-grep catches both classes of problem locally, before deployment:
- Missing — variables used in code but not documented in
.env.example - Unused — variables in
.env.examplethat are never referenced in code
Quick Start
# Install
uv tool install env-grep
# Run from your project root
env-grep scan
# Or use the short alias
evg scan
What Gets Detected
env-grep scans for the following patterns across all .py files in your project:
Standard os module usage
python-dotenv usage via dotenv_values()