zorath-env v0.3.1: Shell Completions, GitHub Action, and Cross-Platform CI/CD
zorath-env v0.3.1 adds shell completions for bash/zsh/fish/PowerShell, an official GitHub Action, zenv example command, and Windows CI/CD support. Full changelog and upgrade guide.
zorath-env v0.3.1 is now available. This release adds shell completions for all major shells, an official GitHub Action for CI/CD pipelines, and the new zenv example command to generate .env.example files from your schema.
Release Highlights
- Shell completions for bash, zsh, fish, and PowerShell
- Official GitHub Action with prebuilt binaries for fast CI/CD
zenv examplecommand to generate.env.examplefrom schema- Windows support in GitHub Action
- Version check with
--check-updateflag - 168 unit tests covering all core functionality
Shell Completions
Tab completion makes command-line tools faster to use. zorath-env now generates completion scripts for all major shells.
Bash
# System-wide
zenv completions bash > /etc/bash_completion.d/zenv
# User-only
zenv completions bash > ~/.local/share/bash-completion/completions/zenv
# Or evaluate directly in current session
eval "$(zenv completions bash)"
Zsh
# Add to fpath
zenv completions zsh > ~/.zfunc/_zenv
# Then add to .zshrc:
# fpath=(~/.zfunc $fpath)
# autoload -Uz compinit && compinit
Fish
zenv completions fish > ~/.config/fish/completions/zenv.fish
PowerShell
# Save to profile directory
zenv completions powershell > $HOME\Documents\PowerShell\zenv.ps1
# Add to $PROFILE:
# . $HOME\Documents\PowerShell\zenv.ps1
Once installed, pressing Tab completes commands, options, and arguments:
$ zenv ch<TAB>
$ zenv check
$ zenv check --<TAB>
--env --schema --allow-missing-env --help
See the completions documentation for shell-specific installation details.
The zenv example Command
Generate .env.example files directly from your schema. This is the reverse of zenv init.
Basic Usage
# Output to stdout
zenv example
# Write to file
zenv example --output .env.example
Output Format
Given this schema:
{
"DATABASE_URL": {
"type": "url",
"required": true,
"description": "PostgreSQL connection string"
},
"PORT": {
"type": "int",
"default": 3000,
"description": "HTTP server port"
},
"NODE_ENV": {
"type": "enum",
"values": ["development", "staging", "production"],
"required": true
}
}
Running zenv example produces:
# DATABASE_URL (url, required)
# PostgreSQL connection string
DATABASE_URL=
# PORT (int, optional)
# HTTP server port
# Default: 3000
PORT=
# NODE_ENV (enum: development, staging, production, required)
NODE_ENV=
Include Default Values
Add --include-defaults to pre-fill default values:
zenv example --include-defaults --output .env.example
Output:
# DATABASE_URL (url, required)
DATABASE_URL=
# PORT (int, optional)
PORT=3000
# NODE_ENV (enum: development, staging, production, required)
NODE_ENV=development
This keeps your .env.example files synchronized with your schema automatically. No more manual updates when configuration changes.
Official GitHub Action
Integrate environment validation into your CI/CD pipeline with the official GitHub Action:
- name: Validate environment configuration
uses: zorl-engine/zorath-env/.github/actions/zenv-action@main
with:
schema: env.schema.json
env-file: .env.example
Action Inputs
| Input | Default | Description |
|---|---|---|
schema |
env.schema.json |
Path to schema file |
env-file |
.env |
Path to .env file |
allow-missing-env |
true |
Allow missing .env file |
version |
latest |
zenv version to use |
Action Outputs
| Output | Description |
|---|---|
valid |
true if validation passed |
errors |
JSON array of error messages |
Cross-Platform Support
The action supports all GitHub-hosted runners:
| Platform | Status |
|---|---|
| Linux (ubuntu-latest) | Supported |
| macOS Intel (macos-13) | Supported |
| macOS Apple Silicon (macos-latest) | Supported |
| Windows (windows-latest) | Supported |
Prebuilt binaries are downloaded at runtime for fast execution. No Rust compilation required.
Example Workflow
name: Validate Configuration
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate .env configuration
uses: zorl-engine/zorath-env/.github/actions/zenv-action@main
with:
schema: env.schema.json
env-file: .env.example
allow-missing-env: true
See the CI/CD integration guide for advanced configurations.
Version Check
Check if you are running the latest version:
$ zenv version
zenv v0.3.1
$ zenv version --check-update
zenv v0.3.1
You are on the latest version.
When an update is available:
$ zenv version --check-update
zenv v0.3.0
Latest: v0.3.1 (update available)
Run: cargo install zorath-env --force
The version check queries crates.io for the latest published version.
Test Coverage
v0.3.1 includes 168 unit tests covering all core functionality:
| Module | Tests | Coverage |
|---|---|---|
envfile.rs |
39 | Parser, multiline, escapes, interpolation |
schema.rs |
20 | Type parsing, inheritance, error handling |
commands/check.rs |
48 | Type validations, rules, required fields |
commands/init.rs |
22 | Type inference for all types |
commands/docs.rs |
14 | Markdown and JSON output |
commands/example.rs |
19 | .env.example generation |
commands/completions.rs |
4 | All shell completions |
commands/version.rs |
1 | Version output |
All tests pass with zero warnings on Linux, macOS, and Windows.
Full Changelog
v0.3.1 (2026-01-15)
Added:
- Windows support in GitHub Action
Changed:
- Updated crates.io metadata (homepage, documentation links)
- Improved code organization
Fixed:
- Code cleanup and dead code removal
v0.3.0 (2026-01-15)
Added:
zenv completionscommand for bash, zsh, fish, PowerShellzenv examplecommand to generate .env.example from schema- Official GitHub Action with prebuilt binaries
- Cross-platform CI/CD support (Linux, macOS, Windows)
Changed:
- Improved error messages for missing files
- Better validation output formatting
Installation
First-Time Install
Via cargo:
cargo install zorath-env
Download binary (no Rust required):
Visit GitHub Releases and download the binary for your platform:
- Linux:
zenv-linux - macOS Intel:
zenv-macos-intel - macOS Apple Silicon:
zenv-macos-arm - Windows:
zenv.exe
Upgrade
# Via cargo
cargo install zorath-env --force
# Or download latest binary from releases
Verify the installation:
$ zenv version
zenv v0.3.1
Resources
- Documentation: zorl.cloud/zenv
- Full Docs: zorl.cloud/docs/zenv
- GitHub: github.com/zorl-engine/zorath-env
- Wiki: GitHub Wiki
- Package: crates.io/crates/zorath-env
- Zorl Hub: git.zorl.cloud, our own code host
Ready to upgrade? Run cargo install zorath-env --force or download the latest binary from GitHub Releases.
5 Environment Variable Mistakes That Break Production
Complete Guide to Type-Safe Environment Variables
Related Articles
dotenv-linter vs envalid vs dotenvx vs zenv: Choosing the Right .env Tool (2026)
Your .env files control database connections, API keys, feature flags, and deployment behavior. But most teams have zero tooling around them. No validation. No type checking. No documentation. Just a...
Developer Onboarding: Environment Setup in Under an Hour
Your new developer starts Monday. They are excited, talented, and ready to contribute. Two weeks later, they still cannot run the project locally. This is not a rare scenario. Research shows that 63%...
zorath-env v0.3.7 & v0.3.8: Library APIs, CI Templates, and Polish
zorath-env v0.3.8 is now available. This release combines two updates focused on stability, developer experience, and CI/CD integration. What is zorath-env? zorath-env (command: zenv) is a fast,...
Never miss config bugs again
Use zorath-env to validate your environment variables before they cause production issues.