.env File Validator
Lint .env files: syntax, duplicates, secrets, and clean exports.
API_URL already defined on line 2 — later definitions silently override earlier ones.
DB_PASSWORD looks like a credential. Commit it to the repo only via a .env.example placeholder.
"unquoted value with spaces" is not KEY=VALUE. Keys must start with a letter or underscore.
AWS_SECRET_ACCESS_KEY looks like a credential. Commit it to the repo only via a .env.example placeholder.
The file does not end with a newline.
Checks syntax (KEY=VALUE, quotes, inline comments), duplicate keys, and common secret patterns (AWS keys, GitHub tokens, OpenAI keys, PEM blocks, and *PASSWORD/*SECRET/*TOKEN key names). Secret detection is heuristic — verify before acting. All analysis runs locally.
Lint .env files for syntax errors, duplicate keys, unquoted values, and accidental secrets. Export a cleaned .env with duplicates resolved and sensitive values filtered out.
- -KEY=VALUE syntax checks with line numbers
- -Duplicate key detection
- -Quote and inline-comment warnings
- -Heuristic secret detection (AWS keys, tokens, PEM blocks)
- -Cleaned export for .env.example
- -Runs entirely locally
- >Auditing env files before committing to a repo
- >Generating a safe .env.example from a real .env
- >Catching duplicate keys that silently override
- >Teaching dotenv quoting rules