--format eval-export

Return export statements for loading .env values into the current shell

dotenvx get

$ dotenvx get --format eval-export

Usage


$ echo "HELLO=World" > .env
$ dotenvx get --format eval-export
export HELLO='World'

Evaluate the output to make the values available to subsequent commands in your current shell.


$ eval "$(dotenvx get --format=eval-export)"
$ echo "$HELLO"
World

Pass quoted glob patterns to export only matching variables.


$ eval "$(dotenvx get 'TF_VAR_*' --format=eval-export)"
$ terraform plan
$ terraform apply

The exported values remain in the current shell until you unset them or close the shell. Prefer dotenvx run -- when variables only need to be available to a single command.

markdown