zorath-env
Open SourcePackage: zorath-env | Binary: zenv
Schema-based .env validation for CI/CD
Catch configuration errors before they reach production. Language-agnostic, privacy-focused, zero runtime dependencies.
cargo install zorath-envFeatures
Language Agnostic
Works with any tech stack - Node.js, Python, Go, Ruby, Rust, Java, PHP, and more. Your schema is the source of truth.
Type Validation
Support for string, int, float, bool, url, and enum types. Catch type mismatches before they cause runtime errors.
CI/CD Ready
Clear exit codes (0 for success, 1 for failure). Integrate into any CI/CD pipeline or pre-commit hook.
Privacy Focused
Runs entirely locally. No external requests, no data uploads, no telemetry. Your secrets stay on your machine.
Zero Dependencies
Single binary, no runtime requirements. Install once and run anywhere without dependency conflicts.
Auto Documentation
Generate markdown or JSON documentation from your schema. Keep your env docs always in sync.
Variable Interpolation
Reference other variables with ${VAR} syntax. Build complex configurations from simple building blocks.
Schema Inheritance
Extend base schemas for environment-specific configurations. DRY principle for your env schemas.
Smart Initialization
Initialize schemas from existing .env.example files with intelligent type inference.
Comments Support
Full-line and inline comments supported. Document your .env files without breaking validation.
Shell Compatible
Export prefix syntax (export VAR=value) supported for shell script compatibility.
Env Fallback Chain
Automatically checks .env.local, .env.development when .env is missing. Works with Next.js and similar frameworks.
How It Works
Define Your Schema
Create an env.schema.json file that describes your environment variables.
{
"DATABASE_URL": {
"type": "url",
"required": true,
"description": "PostgreSQL connection string"
},
"PORT": {
"type": "int",
"required": false,
"default": 3000,
"description": "Server port"
},
"DEBUG": {
"type": "bool",
"required": false,
"default": false
}
}Create Your .env File
Add your environment variables as usual.
DATABASE_URL=postgresql://localhost:5432/mydb
PORT=8080
DEBUG=trueValidate
Run zenv to validate your .env against the schema.
$ zenv check
zenv: OKQuick Reference
Commands
zenv checkValidate .env file against the schema
zenv initGenerate schema from .env.example
zenv docsGenerate documentation (markdown or json)
zenv versionShow version information
Supported Types
stringAny string valueintInteger numbersfloatFloating point numbersbooltrue, false, 1, 0, yes, nourlValid URL formatenumOne of specified valuesReady to get started?
Install zorath-env and start validating your environment variables today.