Direnv and Dotenv

Direnv and Dotenv

Load .env files from a direnv .envrc file:

# .envrc

# One of:
dotenv .env
dotenv_if_exists .env
# .env

SOME_VARIABLE="..."

This is useful to avoid repeated direnv allow if the .envrc is modified for setting environment variables.

It also allows the .envrc to be added to source control, and sensitive values can be kep in .env.