Skip to content

basherpm/basher

Ever wished you could install bash scripts as easily as you install npm packages? That's exactly what basher does — it's a package manager for shell scripts! This tiny installer (just 62 lines) clones basher to your home directory and wires it into your shell's startup script, so you can start basher install-ing community scripts right away.

Script info

Homepage github.com/basherpm/basher
Invocation curl -s https://raw.githubusercontent.com/basherpm/basher/master/install.sh | bash
Total lines 62
Comments 9 lines
Blank 7 lines
Boilerplate 6 lines (error handling, status messages)
Installation 40 lines (actual work)

What does it change?

Files and folders

The script creates a single new folder in your home directory:

  • ~/.basher/ — the entire basher installation lives here, cloned straight from GitHub

It also modifies one of your shell startup files (depending on which shell you use):

  • bash: appends two lines to ~/.bashrc
  • zsh: appends two lines to ~/.zshrc
  • sh: appends two lines to ~/.profile
  • fish: appends five lines to ~/.config/fish/config.fish

The clever bit? Every line it adds is tagged with ##basher5ea843 — a marker that makes cleanup a breeze later.

Downloads

  • Clones https://github.com/basherpm/basher.git to ~/.basher

This is a git clone, so you'll get the full repository including git history. On the plus side: easy updates with git pull!

Environment changes

The installer adds basher to your PATH and initializes it on every new shell session:

export PATH="$HOME/.basher/bin:$PATH"
eval "$(basher init - bash)"  # or zsh, sh, fish

This means basher will be available in every new terminal window you open after installation.

Prerequisites

Before you dive in, make sure you have:

  • git installed (the script checks for this and bails if it's missing)
  • One of the supported shells: bash, zsh, sh, or fish

The script is also polite enough to refuse installation if basher is already present in ~/.basher or the XDG data directory.

Changed your mind?

No hard feelings! Here's how to cleanly remove basher:

  1. Delete the basher directory:

    rm -rf ~/.basher
    

  2. Clean up your shell startup file — open your .bashrc, .zshrc, .profile, or fish config and remove any lines containing ##basher5ea843. There should be 2-5 lines depending on your shell.

For bash/zsh/sh, you can do this automatically:

# For bash
sed -i.bak '/basher5ea843/d' ~/.bashrc

# For zsh
sed -i.bak '/basher5ea843/d' ~/.zshrc

# For fish
sed -i.bak '/basher5ea843/d' ~/.config/fish/config.fish

  1. Start a fresh terminal — or source your startup file to clear basher from your current session's PATH.

That's it! Your system is back to its pre-basher state.

Full source

The full script source is saved as scripts/raw_githubusercontent_com_basherpm_basher_master_install_sh.txt.