Get started with envcheck in minutes.
Lint a single .env file:
envcheck lint .env
Lint multiple files:
envcheck lint .env .env.local .env.prod
Automatically fix formatting issues:
envcheck fix .env
This will:
=Check if your production environment has all required keys:
envcheck compare .env.example .env.prod
Output:
W004: Missing key in .env.prod: DATABASE_URL
W004: Missing key in .env.prod: API_KEY
Ensure your Kubernetes manifests use the same environment variables:
envcheck k8s-sync k8s/base/*.yaml --env .env.example
This detects:
.env (W005).env but unused in K8s (W006)envcheck lint .env
envcheck lint .env --format=json | jq .
envcheck lint .env --format=github
- name: Install envcheck
run: cargo install envcheck
- name: Check .env files
run: envcheck lint .env.example .env.prod --format=github
- name: K8s sync check
run: envcheck k8s-sync k8s/**/*.yaml --env .env.example
Create .pre-commit-config.yaml:
repos:
- repo: https://github.com/envcheck/envcheck
rev: v0.1.0
hooks:
- id: envcheck
args: ["lint", ".env.example", ".env"]
- id: envcheck-k8s
args: ["k8s-sync", "k8s/**/*.yaml", "--env", ".env.example"]
envcheck doctor
envcheck lint .env --quiet
Exit codes: 0 = success, 1 = errors found, 2 = warnings only
envcheck lint .env --ignore=W001,W002