loadenv
is a Fish shell function for managing environment variables from dotenv files.
Usage: loadenv [OPTIONS] [FILE]
Export keys and values from a dotenv file.
Options:
--help, -h Show this help message
--print Print env keys (export preview)
--printb Print keys with surrounding brackets
--unload, -U Unexport all keys defined in the dotenv file
Arguments:
FILE Path to dotenv file (default: .env)
Check tests/happy.env
for a sample dotenv file.
Using Fisher (Plugin manager for Fish):
$ fisher install berk-karaal/loadenv.fish
or manually copy the functions/loadenv.fish
file to your Fish functions directory (e.g. ~/.config/fish/functions/
).
Load .env
file:
$ loadenv
Load custom file:
$ loadenv path/to/dotenv.env
Preview variables defined in the dotenv file:
$ loadenv --print
$ # or
$ loadenv --printb
Unexport all keys defined in the dotenv file:
$ loadenv --unload