Skip to content

Fish shell function for managing env vars from dotenv files ๐ŸŸ

License

Notifications You must be signed in to change notification settings

berk-karaal/loadenv.fish

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

13 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

loadenv.fish

Tests workflow

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.

Installation

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/).

Usage

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

About

Fish shell function for managing env vars from dotenv files ๐ŸŸ

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published