Comprehensive health check for your project's environment configuration.
envcheck doctor [OPTIONS]
| Option | Description |
|---|---|
-d, --dir <DIR> | Project directory (default: current) |
-f, --format <FORMAT> | Output format: text, json, html |
--all | Include all checks (including slow ones) |
--no-k8s | Skip Kubernetes checks |
--no-terraform | Skip Terraform checks (Phase 2) |
--no-ansible | Skip Ansible checks (Phase 2) |
The doctor command runs a comprehensive suite of checks:
✓ Found .env.example
✓ Found .env.local
✓ Found .env.prod
✓ Linted 3 files (0 errors, 2 warnings)
Comparing .env.example ↔ .env.local
Missing in .env.local: API_KEY (W004)
Comparing .env.example ↔ .env.prod
Missing in .env.prod: DEBUG_MODE (W004)
Extra in .env.prod: PRODUCTION_SECRET (I001)
Checking k8s/**/*.yaml
W005: Key in K8s but missing in .env: DATABASE_URL
W006: Key in .env but unused in K8s: LOCAL_ONLY
Checking terraform/**/*.tf
W007: var.database_url not in .env
W008: TF_VAR_api_key not in .env
Checking ansible/**/*.yml
W009: lookup('env', 'APP_SECRET') not in .env
Checking argocd/**/*.yaml
W010: ArgoCD plugin env not in .env
envcheck doctor
envcheck doctor --dir /path/to/project
envcheck doctor --format=html > report.html
envcheck doctor --no-k8s
envcheck doctor --all
| Code | Meaning |
|---|---|
| 0 | All checks passed |
| 1 | Errors found |
| 2 | Warnings found |
| 3 | Some checks skipped |
=== envcheck doctor ===
[1/5] .env files
✓ .env.example exists
✓ .env.local exists
✓ .env.prod exists
[2/5] Linting
✓ 3 files linted (1 warning)
[3/5] Key consistency
⚠ .env.local missing: API_KEY
[4/5] Kubernetes sync
⚠ K8s uses: DATABASE_URL (not in .env)
[5/5] Terraform
⊘ Skipped (--no-terraform)
Summary: 1 warning found
{
"summary": {"errors": 0, "warnings": 2, "skipped": 1},
"checks": [...]
}
Generates a standalone HTML report with:
- name: Run envcheck doctor
run: envcheck doctor --format=github
- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: envcheck-report
path: report.html
if: always()
repos:
- repo: https://github.com/envcheck/envcheck
rev: v0.1.0
hooks:
- id: envcheck-doctor
args: ["--all"]
The doctor command automatically finds files:
| Pattern | Description |
|---|---|
.env* | All .env files in project root |
k8s/**/*.yaml | Kubernetes manifests |
k8s/**/*.yml | Kubernetes manifests (alt extension) |
terraform/**/*.tf | Terraform files |
ansible/**/*.yml | Ansible playbooks |
.github/workflows/*.yml | GitHub Actions |
argocd/**/*.yaml | ArgoCD manifests |