A Go library and CLI for environment config contracts — validate, generate, and enforce .env consistency from your config struct.
⚠️ This project is under active development. Not ready for production use yet.
EnvContract validates that your environment variables match the contract defined in your Go config struct — catching missing variables, type mismatches, and config drift before your application starts.
envcontract check— validate.envagainst your config structenvcontract init— generate.env.exampledirectly from your structenvcontract schema— export a machine-readable schema of expected variables- Build time enforcement via
go generate - Pluggable sources —
.envfiles, system env, and more
make test # run tests
make lint # run linter
make build # build the CLI| Week | Focus | Status |
|---|---|---|
| 1 | Struct parser and FieldContract type | ✅ Done |
| 2 | Source adapters and env loading | 🔄 In progress |
| 3 | Validation engine | ⏳ Pending |
| 4 | Public API and Result type | ⏳ Pending |
| 5 | CLI | ⏳ Pending |
| 6 | Generator and schema export | ⏳ Pending |
| 7 | Hardening and v0.1.0 | ⏳ Pending |
MIT