A package manager for shell scripts and functions.
Basher allows you to quickly install shell packages directly from github. Instead of looking for specific install instructions for each package and messing with your path, basher will create a central location for all packages and manage their binaries for you.
Even though it is called basher, it also works with zsh and fish.
-
Checkout basher on
~/.basher
$ git clone https://github.com/basherpm/basher.git ~/.basher
-
Add
~/.basher/bin
to$PATH
for easy access to the basher command-line utility.$ echo 'export PATH="$HOME/.basher/bin:$PATH"' >> ~/.bash_profile
Ubuntu Desktop note: Modify your
~/.bashrc
instead of~/.bash_profile
.Zsh note: Modify your
~/.zshrc
file instead of~/.bash_profile
.For Fish: Add the following to you
~/.config/fish/config.fish
if test -d ~/.basher set basher ~/.basher/bin end set -gx PATH $basher $PATH
-
Add
basher init
to your shell to enable basher runtime functions$ echo 'eval "$(basher init -)"' >> ~/.bash_profile
Same as in previous step, use
~/.bashrc
on Ubuntu,~/.zshrc
for Zsh.For Fish, use the following line on your
~/.config/fish/config.fish
.status --is-interactive; and . (basher init -|psub)
Run basher update
to update basher.
$ basher install sstephenson/bats
This will install bats from https://github.com/sstephenson/bats and add bin/bats
to the PATH.
basher commands
- List commandsbasher help <command>
- Displays help for a commandbasher uninstall <package>
- Uninstall a packagebasher update
- Update basher to latest version from masterbasher list
- List installed packagesbasher outdated
- List packages which are not in the latest versionbasher upgrade <package>
- Upgrades a package to the latest version
Packages are simply github repos (username/repo).
Any files inside a bin directory are added to the path. If there is no bin directory, any executable files in the package root are added to the path.
Any files inside a man directory are added to the manpath.
Optionally, a repo might contain a package.sh
file which specifies binaries,
dependencies and completions in the following format:
BINS=folder/file1:folder/file2.sh
DEPS=user1/repo1:user2/repo2
BASH_COMPLETIONS=completions/package
ZSH_COMPLETIONS=completions/_package
BINS specified in this fashion have higher precedence then the inference rules above.
- bltavares/kickstart
- bripkens/dock
- juanibiapina/gg
- juanibiapina/pg
- juanibiapina/smart-grep
- juanibiapina/todo
- pote/gpm
- pote/gvp
- sstephenson/bats
- tj/git-extras
- treyhunner/tmuxstart
And many others. If a repo doesn't work, create an issue or a pull request.
To run the tests, install bats:
$ basher install sstephenson/bats
update submodules:
$ git submodule update --init
and then run:
$ make