@craftpipe/env-doctor
v1.0.0
Published
A CLI workflow tool that audits your project's environment configuration end-to-end: scans all .env files, detects missing variables referenced in code, flags secrets accidentally committed to git history, checks for mismatches between .env.example and ac
Downloads
24
Maintainers
Readme
env-doctor
A CLI tool that audits your project's environment configuration end-to-end.
What It Does
env-doctor scans your project and:
- Detects missing environment variables referenced in code
- Flags secrets accidentally committed to git history
- Checks for mismatches between
.env.exampleand.envfiles - Validates variable formats (URLs, ports, API key patterns)
- Generates a color-coded health report with actionable fixes
Works across Node.js, Python, and any project using environment files.
Installation
npm install -g env-doctorOr use directly:
npx env-doctorUsage
Run a full audit:
env-doctorScan specific directory:
env-doctor --path ./srcCheck git history for secrets:
env-doctor --check-gitGenerate report file:
env-doctor --output report.jsonFix common issues automatically:
env-doctor --fixOptions
| Flag | Description |
|------|-------------|
| --path <dir> | Scan specific directory (default: current) |
| --check-git | Scan git history for exposed secrets |
| --output <file> | Save report to JSON file |
| --fix | Auto-fix common issues |
| --strict | Fail on any warnings |
| --ignore <pattern> | Ignore files matching pattern |
Example Output
✓ 24 variables validated
⚠ 3 missing variables detected
- DATABASE_URL (referenced in config.js:12)
- API_SECRET (referenced in auth.py:45)
- REDIS_PORT (referenced in cache.js:8)
✗ 2 secrets found in git history
- AWS_KEY in commit a3f2d1e
Health Score: 65/100FAQ
Q: Does it modify my files?
A: Only with --fix flag. Always review changes.
Q: What formats does it validate?
A: URLs, ports, API keys, email addresses, and custom regex patterns.
Q: Can I exclude certain files?
A: Yes, use --ignore flag or add patterns to .env-doctorrc.
Q: Does it work with monorepos?
A: Yes, run from root or specify paths with --path.
Q: How do I ignore false positives?
A: Add variables to .env-doctorignore file.
Built with AI by Craftpipe
Support: [email protected]
