All Projects → basherpm → Basher

basherpm / Basher

Licence: mit
A package manager for shell scripts.

Programming Languages

shell
77523 projects
bash
514 projects

Projects that are alternatives of or similar to Basher

basalt
The rock-solid Bash package manager
Stars: ✭ 16 (-97.92%)
Mutual labels:  zsh, package-manager
Antigen
The plugin manager for zsh.
Stars: ✭ 6,843 (+791.02%)
Mutual labels:  zsh, package-manager
Zebra
🦓 A Useful Package Manager for iOS
Stars: ✭ 667 (-13.15%)
Mutual labels:  package-manager
Dip
CLI gives the "native" interaction with applications configured with Docker Compose.
Stars: ✭ 737 (-4.04%)
Mutual labels:  zsh
Dotfiles
Dotfiles for all :D
Stars: ✭ 700 (-8.85%)
Mutual labels:  zsh
Modern Cpp Template
A template for modern C++ projects using CMake, Clang-Format, CI, unit testing and more, with support for downstream inclusion.
Stars: ✭ 690 (-10.16%)
Mutual labels:  package-manager
Pacapt
An ArchLinux's pacman-like wrapper for many package managers
Stars: ✭ 709 (-7.68%)
Mutual labels:  package-manager
Awesome Dotfiles
A curated list of dotfiles resources.
Stars: ✭ 6,295 (+719.66%)
Mutual labels:  zsh
Fzf Tab
Replace zsh's default completion selection menu with fzf!
Stars: ✭ 761 (-0.91%)
Mutual labels:  zsh
Goto
Alias and navigate to directories with tab completion in Linux
Stars: ✭ 698 (-9.11%)
Mutual labels:  zsh
Pure
Pretty, minimal, and fast prompt for Fish from Zsh.
Stars: ✭ 740 (-3.65%)
Mutual labels:  zsh
Trizen
Lightweight AUR Package Manager
Stars: ✭ 696 (-9.37%)
Mutual labels:  package-manager
Orogene
A next-generation platform and package manager for Node.js-compatible and frontend JavaScript projects!
Stars: ✭ 695 (-9.51%)
Mutual labels:  package-manager
Rome
Carthage cache for S3, Minio, Ceph, Google Storage, Artifactory and many others
Stars: ✭ 724 (-5.73%)
Mutual labels:  package-manager
Niv
Easy dependency management for Nix projects
Stars: ✭ 669 (-12.89%)
Mutual labels:  package-manager
Materialshell
A material design theme for your terminal. ✨
Stars: ✭ 750 (-2.34%)
Mutual labels:  zsh
Zsh You Should Use
📎 ZSH plugin that reminds you to use existing aliases for commands you just typed
Stars: ✭ 659 (-14.19%)
Mutual labels:  zsh
Brew
🍺 The missing package manager for macOS (or Linux)
Stars: ✭ 30,318 (+3847.66%)
Mutual labels:  package-manager
Dotfiles
A repository that gathered files starting with dot
Stars: ✭ 701 (-8.72%)
Mutual labels:  zsh
Zshguide
Zsh 开发指南
Stars: ✭ 766 (-0.26%)
Mutual labels:  zsh

basher

A package manager for shell scripts and functions.

Basher allows you to quickly install shell packages directly from github (or other sites). 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.

Build Status

Installation

Basher requires bash >= 4, and the realpath utility from coreutils. On osx you can install both with brew:

$ brew install bash coreutils
  1. Checkout basher on ~/.basher

    $ git clone --depth=1 https://github.com/basherpm/basher.git ~/.basher
    
  2. Initialize basher in your shell initialization

    export PATH="$HOME/.basher/bin:$PATH"
    eval "$(basher init - bash)" # replace `bash` with `zsh` if you use zsh
    

    Fish: Use the following commands instead:

    if test -d ~/.basher
      set basher ~/.basher/bin
    end
    set -gx PATH $basher $PATH
    status --is-interactive; and . (basher init - fish|psub)
    

or in 1 line, automatically (this will install basher and add it to your .bashrc/.zshrc file - in a way that can automatically be uninstalled later)):

curl -s https://raw.githubusercontent.com/basherpm/basher/master/install.sh | bash

Updating

Go to the directory where you cloned basher and pull the latest changes:

$ cd ~/.basher
$ git pull

Usage

Installing packages from Github

$ basher install sstephenson/bats

This will install bats from https://github.com/sstephenson/bats and add bin/bats to the PATH.

Installing packages from other sites

$ basher install bitbucket.org/user/repo_name

This will install repo_name from https://bitbucket.org/user/repo_name

Using ssh instead of https

If you want to do local development on installed packages and you have ssh access to the site, use --ssh to override the protocol:

$ basher install --ssh juanibiapina/gg

Installing a local package

If you develop a package locally and want to try it through basher, use the link command:

$ basher link directory my_namespace/my_package

The link command will install the dependencies of the local package. You can prevent that with the --no-deps option:

$ basher link --no-deps directory my_namespace/my_package

Sourcing files from a package into current shell

Basher provides an include function that allows sourcing files into the current shell. After installing a package, you can run:

include username/repo lib/file.sh

This will source a file lib/file.sh under the package username/repo.

Command summary

  • basher commands - List commands
  • basher help <command> - Display help for a command
  • basher uninstall <package> - Uninstall a package
  • basher list - List installed packages
  • basher outdated - List packages which are not in the latest version
  • basher upgrade <package> - Upgrade a package to the latest version

Configuration options

To change the behavior of basher, you can set the following variables either globally or before each command:

  • BASHER_FULL_CLONE=true - Clones the full repo history instead of only the last commit (useful for package development)
  • BASHER_PREFIX - set the installation and package checkout prefix (default is $BASHER_ROOT/cellar). Setting this to /usr/local, for example, will install binaries to /usr/local/bin, manpages to /usr/local/man, completions to /usr/local/completions, and clone packages to /usr/local/packages. This allows you to manage "global packages", distinct from individual user packages.

Packages

Packages are simply repos (username/repo). You may also specify a site (site/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 manpages (files ended in \.[0-9]) 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.

Package Directory

A list of working packages can be found on https://basher.gitparade.com/. There you can also find a badge if you want to include it in your readme:

basher install

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].