ZORL

zorath-env

Open Source

Package: 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-env

Features

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

1

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
  }
}
2

Create Your .env File

Add your environment variables as usual.

DATABASE_URL=postgresql://localhost:5432/mydb
PORT=8080
DEBUG=true
3

Validate

Run zenv to validate your .env against the schema.

$ zenv check

zenv: OK

Quick Reference

Commands

zenv check

Validate .env file against the schema

zenv init

Generate schema from .env.example

zenv docs

Generate documentation (markdown or json)

zenv version

Show version information

Supported Types

stringAny string value
intInteger numbers
floatFloating point numbers
booltrue, false, 1, 0, yes, no
urlValid URL format
enumOne of specified values

Ready to get started?

Install zorath-env and start validating your environment variables today.