Execute commands with environment variables from .env files.
- Load environment variables from
.envfiles - Support profile-based environment files (
.env.{profile}) - Priority-based directory search (current directory >
$XDG_CONFIG_HOME/envdo) - Execute any command with loaded environment variables
- Display loaded environment variables in export format
$ envdo -- echo $MY_VAR$ envdo --profile production -- node app.js
$ envdo -p dev -- npm start$ envdo
export API_KEY=your_api_key
export DATABASE_URL=postgresql://localhost/mydbenvdo searches for .env files in the following directories in order of priority:
- Current directory
$XDG_CONFIG_HOME/envdo(typically~/.config/envdo)
# Comments are supported
API_KEY=your_api_key
DATABASE_URL=postgresql://localhost/mydb
# Quoted values are supported
SECRET="my secret value"
ANOTHER_SECRET='another secret'
When using the --profile option, envdo looks for .env.{profile} files:
$ envdo --profile production -- node app.js
# Loads .env.productionhomebrew tap:
$ brew install k1LoW/tap/envdomanually:
Download binary from releases page
go install:
$ go install github.com/k1LoW/envdo@latestdeb:
$ export ENVDO_VERSION=X.X.X
$ curl -o envdo.deb -L https://github.com/k1LoW/envdo/releases/download/v$ENVDO_VERSION/envdo_$ENVDO_VERSION-1_amd64.deb
$ dpkg -i envdo.debRPM:
$ export ENVDO_VERSION=X.X.X
$ yum install https://github.com/k1LoW/envdo/releases/download/v$ENVDO_VERSION/envdo_$ENVDO_VERSION-1_amd64.rpm