dotenvx
Load environment variables from .env files
TLDR
Run a command with environment variables from a .env file
Run a command with environment variables from a specific .env file
Set an environment variable with encryption
Set an environment variable without encryption
Return environment variables defined in a .env file
Return the value of an environment variable defined in a .env file
Return all environment variables from .env files and OS
SYNOPSIS
dotenvx [OPTIONS] <COMMAND> [ARGS]
Commands: run, print, vault, help, version
PARAMETERS
-e, --env-file <ENV_FILE>...
Set one or more environment files to load (default: .env)
-b, --blockenv
Block inheritance of process.env from parent process
--arch <ARCH>
Target architecture (e.g., amd64, arm64; default: x64)
--os <OS>
Target OS (linux, darwin, windows; default: current)
--dotenvx
Run dotenvx itself with loaded env vars
-h, --help
Print help information
-V, --version
Print version information
--
Separator to pass options to the target command
DESCRIPTION
dotenvx is a high-performance CLI tool for loading environment variables from .env files and running commands with them loaded. Written in Rust, it's up to 1000x faster than traditional Node.js-based dotenv tools. Key features include support for multiple .env files, encrypted secrets via .env.vault, blocking parent environment variables, cross-platform binaries (Linux, macOS, Windows), and no runtime dependencies like Node.js.
Primary use cases: development workflows, CI/CD pipelines, and scripting where secure, fast env loading is needed. It decrypts secrets locally using public keys, ensuring security without exposing them. Run commands directly or use subcommands like print to output vars and vault for secret management.
CAVEATS
Requires downloading platform-specific binary; secrets need DOTENV_PUBLIC_KEY for decryption. Not installed by default on Linux.
EXAMPLE USAGE
dotenvx run -- npm start
dotenvx print DATABASE_URL
dotenvx vault new
INSTALLATION (LINUX)
curl -Ls https://dotenvx.com/install.sh | sh
or wget binary from GitHub releases (github.com/dotenvx/dotenvx/releases)
HISTORY
Created by Guillermo Rauch (Vercel) in 2023 as a Rust rewrite of dotenv CLI tools for speed and security. First release v0.1.0; rapidly adopted for its performance gains over JS alternatives.


