Simple Open Source tool to Track and load the environment variables specified to directory
- Install the binary
go install github.com/Harichandra-Prasath/SyncEnv
Initialise
This action adds the current directory to SycnEnv store.
SyncEnv init
Additionally if you want to migrate local variabales that you have already, use --with-file.
SyncEnv init --with-file <path-to-file>
Additon
You can add new variables
SyncEnv --add foo=bar --add baz=gaz
Updation
You can update existing variables
SyncEnv --update foo=gaz --update baz=bar
Loading
This is the action where SyncEnv loads the attached variables. As child process cannot write to it's Parent, you need to run this action with bash eval.
eval `SyncEnv load`
If you want to load from a local file, add --from-file flag.
eval `SyncEnv load --from-file <path-to-file>`
Additionally, --no-debug flag can be passed to prevent message outputs.
eval `SyncEnv load --no-debug`
Peek
You can see all the variables in the store
SyncEnv --peek
Port
You can Port your SyncEnv variables to a standalone file.
SyncEnv --port <path-to-file>
Help
To see the help menu
SyncEnv --help
For auto-loading of variables when entering the directory, you can create a hook in your shell profile.
Currently SyncEnv supports zsh and bash.
For Zsh, add the below in your .zshrc
eval "$(SyncEnv hook --shell zsh)"
For Bash, add the below in your .bashrc
eval "$(SyncEnv hook --shell bash)"
- Port to Windows
- Additional Shells like fish,etc..
- Reducing Write actions if possible
This is a small project open to everyone.Contributions and improvements are always welcome.