Non-Volatile export https://pypi.org/project/nvexpo/
Go to file
kirbylife 48f219be57 Fix small typo 2023-11-06 19:51:31 -06:00
nvexpo Improve a little bit the code 2023-11-06 19:43:29 -06:00
tests Initial commit 2023-11-02 02:14:32 -06:00
.gitignore Add gitignore 2023-11-03 01:39:27 -06:00
LICENSE update LICENSE 2023-11-03 02:29:32 -06:00
README.md Fix small typo 2023-11-06 19:51:31 -06:00
poetry.lock Initial commit 2023-11-02 02:14:32 -06:00
pyproject.toml Improve a little bit the code 2023-11-06 19:43:29 -06:00

README.md

NVEXPO - Non-Volatile EXPOrt

nxexpo it's a simple tool to define environment variables on-the-fly and persisting them between shell sessions.

Dependencies

  • Python 3.8

Dependencies to build

Dependencies to develop

Installation

Installation trough PyPI

To install the latest stable version follow the commands:

$ pip install nvexpo --user

You can also use pipx to install it:

$ pipx install nvexpo

From the source

To install from the source follow the commands:

$ poetry build
$ pip install dist/nvexpo*.whl

Preparation

Add the following line to your .bashrc file:

eval "$(nvexpo init bash)"

Basic usage

The usage it's too simple. If you want to create a new env var into the current bash session use the command:

$ nx weird_variable=101

Then, you can close the current terminal or terminate the bash session, and when you start a new one, your env vars will still be there .

$ echo $weird_variable
101

Unset variables

To unset variables you need to use flag --unset:

$ nx var1="hello world"
$ echo $var1
hello world
$ nx --unset var1
$ echo $var1

$ works!!

Why?

The main motivation for creating this tool was that in my work I like to have the Git branch I'm working on in $branch, but it's annoying to have to create it every time I restart or close the terminal I was working on. I could add it to .bashrc directly, but I would have to do it every time I have to work on a new branch and it wasn't comfortable. So now instead of having to type:

branch="super_useful_change"

I have to write:

nx branch="super_useful_change"

and that's it, no matter how many times I restart, my variable will be there.