env-config-validator
/install env-config-validator
Env Config Validator
Validate .env files, compare environments, detect common mistakes, and enforce schemas.
Quick Start
# Validate with auto-detected common checks
python3 scripts/validate_env.py .env
# Validate against a schema
python3 scripts/validate_env.py .env --schema env-schema.json
# Compare dev vs prod
python3 scripts/validate_env.py --diff .env.development .env.production
# Generate schema from existing .env
python3 scripts/validate_env.py --generate-schema .env -o env-schema.json
# JSON output for CI
python3 scripts/validate_env.py .env --output json --severity error
Common Checks (Auto-Detected)
The validator automatically detects these issues without a schema:
| Check | Severity | What it catches |
|---|---|---|
| Trailing whitespace | warning | Invisible chars causing bugs |
| Unquoted spaces | warning | Values with spaces not wrapped in quotes |
| Placeholders | error | change_me, TODO, xxx, your_* values |
| Empty values | info | Defined but blank variables |
| Double-nested quotes | warning | ""value"" quoting errors |
| URL missing protocol | warning | URL vars without http(s):// |
| Port out of range | error | Port > 65535 or \x3C 1 |
| Short secrets | warning | SECRET/PASSWORD/KEY \x3C 8 chars |
| Inconsistent booleans | info | yes/1 instead of true/false |
| Mixed case keys | info | some_Var instead of SOME_VAR |
| Inline comments | warning | value # comment (not all parsers support) |
| Duplicate keys | warning | Same variable defined twice |
Options
| Flag | Default | Description |
|---|---|---|
--schema |
— | JSON schema file for type/required validation |
--diff FILE FILE |
— | Compare two env files |
--generate-schema |
— | Auto-generate schema from .env file |
--output |
text | Output format: text, json, markdown |
-o |
stdout | Output file path |
--ignore |
— | Skip specific check IDs (repeatable) |
--severity |
info | Minimum severity: error, warning, info |
Exit Codes
0— No issues (or only info)1— Warnings found (or diff has differences)2— Errors found
Workflow
Pre-deploy Validation
- Generate schema from working .env:
--generate-schema .env -o schema.json - Add schema to repo, validate in CI:
validate_env.py .env --schema schema.json --severity error - Diff staging vs prod:
--diff .env.staging .env.production
Audit Existing Project
- Run
validate_env.py .envto find common mistakes - Fix errors and warnings
- Generate schema for future validation
References
- schema-format.md — Full JSON schema specification, supported types, field reference
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install env-config-validator - After installation, invoke the skill by name or use
/env-config-validator - Provide required inputs per the skill's parameter spec and get structured output
What is env-config-validator?
Validate .env files against schemas, compare environments (dev vs prod), detect common mistakes (trailing spaces, placeholders, invalid ports, missing protoc... It is an AI Agent Skill for Claude Code / OpenClaw, with 108 downloads so far.
How do I install env-config-validator?
Run "/install env-config-validator" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is env-config-validator free?
Yes, env-config-validator is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does env-config-validator support?
env-config-validator is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created env-config-validator?
It is built and maintained by charlie-morrison (@charlie-morrison); the current version is v1.0.0.