Installing evnx
Get evnx running on macOS, Linux, or Windows in under two minutes. Includes pre-commit hook setup.
evnx is a single static binary with no runtime dependencies. Pick your platform and you'll be running in under two minutes.
Prerequisites
- ›macOS / Linux: curl, bash
- ›Windows: winget (Windows Package Manager) or Rust toolchain
- ›Cargo (all platforms): Rust toolchain via rustup.rs
macOS & Linux
The fastest way is the install script:
curl -fsSL https://dotenv.space/install.sh | bashThe script:
- ›Detects your OS and architecture (x86_64 / arm64)
- ›Downloads the correct binary from GitHub Releases
- ›Installs to
~/.local/bin(added to PATH automatically) - ›Verifies the checksum
Verify the installation:
evnx --version
# evnx 0.2.0Homebrew (coming soon)
# brew install evnx ← not yet available, coming in v0.3.0Windows
Via winget
winget install evnxVia Cargo (fallback)
cargo install evnxCargo (All Platforms)
Install the stable release from crates.io:
cargo install evnxInstall with all optional features (cloud sync, extra format targets):
cargo install evnx --features fullCompile times
Cargo builds from source, so the first install takes 60–90 seconds. Subsequent installs are faster because Cargo caches dependencies.
Verify Your Installation
evnx --version
# evnx 0.2.0
evnx --help
# Usage: evnx [COMMAND]
# Commands:
# init Initialize a new .env file from a template
# validate Validate your .env against rules
# scan Scan for secrets and sensitive data
# diff Show differences between .env files
# convert Convert .env to another format
# sync Sync .env and .env.example
# add Add or update a variable
# migrate Push secrets to a cloud secret manager
# doctor Run environment health diagnostics
# template Generate config from a template file
# backup Create an encrypted backup of .env
# restore Restore from an encrypted backupRun Your First Scan
Before setting anything up, try this in any project directory:
cd your-project
evnx doctorThe doctor command checks:
- ›Whether
.envis tracked by git - ›Whether
.gitignorecovers.envin all subdirectories - ›Whether
.env.exampleexists and is in sync - ›File permissions on
.env
This alone catches most common configuration issues.
Install the Pre-commit Hook (Recommended)
This is the most important step. The pre-commit hook runs evnx scan automatically before every git commit, blocking commits that contain secrets.
Using pre-commit
Add to your .pre-commit-config.yaml:
repos:
- repo: local
hooks:
- id: evnx-scan
name: evnx secret scan
entry: evnx scan --exit-code
language: system
files: '\.env'
pass_filenames: falseThen install:
pre-commit installManual git hook
# Create the hook file
cat > .git/hooks/pre-commit << 'EOF'
#!/bin/bash
evnx scan --exit-code
if [ $? -ne 0 ]; then
echo "evnx: secrets detected. Commit blocked."
exit 1
fi
EOF
chmod +x .git/hooks/pre-commitTeam setup
The .pre-commit-config.yaml approach is better for teams — it's committed to the repo, so every developer gets the hook automatically when they run pre-commit install.
Updating evnx
# If installed via install script
curl -fsSL https://dotenv.space/install.sh | bash
# If installed via cargo
cargo install evnx --force
# Check for updates
evnx doctor --check-updatesWhat's Next
Before you start
Now that evnx is installed, run through the Quick Start to see scan, validate, and convert in action on a real project.