Skip to content

Load Variables into Your Shell

Use load when you want the resolved variables in the current interactive shell. dotenv-fusion emits shell code; the shell evaluates that output.

eval "$(dotenv-fusion load)"
eval (dotenv-fusion load -o fish)
dotenv-fusion load -o powershell | Invoke-Expression
dotenv-fusion load -o json

Select the input

Without --file, load uses the first existing file in this order:

  1. .env-fuse
  2. .env-fuse.local
  3. .env

Promote one input while retaining the remaining fallbacks:

eval "$(dotenv-fusion load --load-order=env)"

Use an explicit file when the choice belongs to the command:

eval "$(dotenv-fusion load -f .env.production)"

File values replace variables already present in the shell by default. Preserve the parent environment with --no-override or set DOTENV_FUSION_EXISTING_ENV=no-override.

Add a convenient alias

alias dof='eval "$(dotenv-fusion load)"'
alias dofn='eval "$(dotenv-fusion load --no-override)"'
alias dof='eval (dotenv-fusion load -o fish)'
alias dofn='eval (dotenv-fusion load -o fish --no-override)'
function dof { dotenv-fusion load -o powershell | Invoke-Expression }
function dofn { dotenv-fusion load -o powershell --no-override | Invoke-Expression }

Secret values

load emits resolved values, including secrets, because the shell needs the real values. Human-readable diagnostics still mask secret and secret-derived values. When the goal is to start one process, prefer Run an Application so the values are not emitted as shell code.

See load in the CLI reference for every option.