beginner2 minutesevnx v0.2.0+

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:

Bash
curl -fsSL https://dotenv.space/install.sh | bash

The script:

  1. Detects your OS and architecture (x86_64 / arm64)
  2. Downloads the correct binary from GitHub Releases
  3. Installs to ~/.local/bin (added to PATH automatically)
  4. Verifies the checksum

Verify the installation:

Bash
evnx --version
# evnx 0.2.0

Homebrew (coming soon)

Bash
# brew install evnx  ← not yet available, coming in v0.3.0

Windows

Via winget

PowerShell
winget install evnx

Via Cargo (fallback)

PowerShell
cargo install evnx

Cargo (All Platforms)

Install the stable release from crates.io:

Bash
cargo install evnx

Install with all optional features (cloud sync, extra format targets):

Bash
cargo install evnx --features full

Compile times

Cargo builds from source, so the first install takes 60–90 seconds. Subsequent installs are faster because Cargo caches dependencies.


Verify Your Installation

Bash
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 backup

Run Your First Scan

Before setting anything up, try this in any project directory:

Bash
cd your-project
evnx doctor

The doctor command checks:

  • Whether .env is tracked by git
  • Whether .gitignore covers .env in all subdirectories
  • Whether .env.example exists 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:

YAML
repos:
  - repo: local
    hooks:
      - id: evnx-scan
        name: evnx secret scan
        entry: evnx scan --exit-code
        language: system
        files: '\.env'
        pass_filenames: false

Then install:

Bash
pre-commit install

Manual git hook

Bash
# 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-commit

Team 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

Bash
# 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-updates

What's Next

Now that evnx is installed, run through the Quick Start to see scan, validate, and convert in action on a real project.