Manage your shell environment so you can get on with coding.
Code lives in libsh’s github home and more documentation is updated on a change basis.
Super simple process to install LIBSH:
mkdir -p $LIBSH_PARENT_DIR
git clone https://github.com/aaronaddleman/libsh $LIBSH_PARENT_DIR/libsh
echo "source $LIBSH_PARENT_DIR/libsh/libsh.sh 'fn'" >> $HOME/.zshrc
echo "source $LIBSH_PARENT_DIR/libsh/libsh.sh 'env'" >> $HOME/.zshenv
cp $LIBSH_PARENT_DIR/libsh/.libsh_example $HOME/.libshrc
echo "Make a new shell to try it out!"
Over the years of working with Linux, I have found myself always trying to recall how to install something, or do an action, or setting just the correct environment variables in a certain file. Another reason is that most installation steps are not correct when it comes to loading lines in
.zshenv. After a while, I got tired and decided to start collecting small functions to this for me. ZSH also helped in allowing to use the TAB button for doing auto-complete of functions and variables.
Sorting of features
All commands are sorted by their common prefix. This allows for the project to have their own buckets of commands and keep some basic sort of grouping.
Each command also serves as a documenation on how to use the service. Take using the aws command. For any one of them you may type in the command
type -f aws_blah and you will be able to see what that function is doing or by using
the_command --help for most commands I have documented.
There is a feature for checking the last known git clone date. This allows for detecting the desired max amount of drift before asking the customer if they want to refresh the git repo.
I have been using the pattern of a
pre command where needed to validate the dependencies of the command. One example of this is with Vault where the function of
vault_pre will try to test the connection to the
Personal vs Professional
Libsh will load all files in
$HOME/.sh.d/*.env.sh which allows for customizing your own functions that you require for either personal or professional environments.