Load environment variables from a file in the terminal (zsh)

· 60 words · 1 minute read

Load environment variables from a file* 🔗

To load shell environment variables from a simple KV configuration file like:

click to zoom in

Add this alias to your .zshrc file

alias loadEnv='function _loadEnv()
{
set -o allexport; source $1; set +o allexport
};_loadEnv'

click to zoom in

And you’ll be able to load environment variables really easy:

click to zoom in