Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/berk-karaal/loadenv.fish
Fish shell function for managing env vars from dotenv files
https://github.com/berk-karaal/loadenv.fish
dotenv fish-plugin fish-shell
Last synced: about 1 month ago
JSON representation
Fish shell function for managing env vars from dotenv files
- Host: GitHub
- URL: https://github.com/berk-karaal/loadenv.fish
- Owner: berk-karaal
- License: mit
- Created: 2024-11-30T13:25:35.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-12-01T16:52:45.000Z (about 1 month ago)
- Last Synced: 2024-12-01T17:41:02.583Z (about 1 month ago)
- Topics: dotenv, fish-plugin, fish-shell
- Language: Shell
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# loadenv.fish
[![Tests workflow](https://github.com/berk-karaal/loadenv.fish/actions/workflows/tests.yaml/badge.svg)](https://github.com/berk-karaal/loadenv.fish/actions/workflows/tests.yaml)
`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 fileArguments:
FILE Path to dotenv file (default: .env)
```Check [`tests/happy.env`](https://github.com/berk-karaal/loadenv.fish/blob/main/tests/happy.env) for a sample dotenv file.
## Installation
Using [Fisher](https://github.com/jorgebucaran/fisher) (Plugin manager for Fish):
```console
$ 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:
```console
$ loadenv
```Load custom file:
```console
$ loadenv path/to/dotenv.env
```Preview variables defined in the dotenv file:
```console
$ loadenv --print
$ # or
$ loadenv --printb
```Unexport all keys defined in the dotenv file:
```console
$ loadenv --unload
```