a fast, easy, simple and lightweight plugin manager for GNU bash https://git.ari.lt/ari/baz
Find a file
Ari Archer bafb283660
update license
Signed-off-by: Ari Archer <ari@ari.lt>
2024-02-27 23:59:12 +02:00
completions Fix completion 2022-06-19 01:35:59 +03:00
doc 7.6.0 : improve static and const usage, improve performance 2023-05-22 01:41:45 +03:00
examples/example_plugin 6.2.0 : rewrite the loader in C89 2023-02-19 15:37:59 +02:00
loader 7.6.0 : improve static and const usage, improve performance 2023-05-22 01:41:45 +03:00
scripts 7.1.0-post : improve baz_setup script 2023-02-28 23:13:31 +02:00
.clang-format 2.4.0: Bug fixes, more plugins, documentation 2022-10-16 17:41:29 +03:00
.editorconfig 2.4.0: Bug fixes, more plugins, documentation 2022-10-16 17:41:29 +03:00
.gitignore 7.5.0 : optimise c loader, remove insignificant mem.h support 2023-03-06 03:18:17 +02:00
.shellcheckrc Add runners support 2022-05-19 00:46:54 +03:00
baz 7.6.0 : improve static and const usage, improve performance 2023-05-22 01:41:45 +03:00
LICENSE update license 2024-02-27 23:59:12 +02:00
loader.sht 6.1.2 : fix function loading 2023-02-18 18:26:22 +02:00
logo.png readme : add logo 2023-02-18 22:36:23 +02:00
PLUGINS.md 6.0.0 : add yafetch plugin, make formatting of PLUGINS.md better 2023-02-13 00:51:28 +02:00
README.md readme : add package links 2023-04-15 15:37:11 +03:00

baz

a fast, easy, simple and lightweight plugin manager for GNU bash

source code

credits

packages

dependencies

  • coreutils
  • BASH
  • git cli
  • optionally any c compiler ( to use the c loader insread of the bash one )
  • rlwrap ( optional, but its nice for special keys )
  • bash-completion ( optional, but its nice for well ... completion )

but you probably have all of them, maybe not git, but a lot of people do

why baz

  • fast
  • easy
  • small
  • simple
  • minimal
  • cross platform
    • linux
      • gentoo
      • void
      • debian
      • ubuntu
      • arch
      • ...
    • BSD
      • FreeBSD
      • OpenBSD
      • ...
    • windows
      • git BASH
      • windows subsystem for Linux ( WSL )
      • wherever you can get BASH on
    • android
    • most likely ( needs testing, please contribute if you have the resources to do so :) )
      • macOS
      • iOS
  • GPLv3 licensing

automatic setup

this script hosted on my files site will set up baz automatically, but it might be unstable

$ cd /tmp

$ curl -fL 'https://ari-web.xyz/gh/baz/raw/main/scripts/baz_setup.sh' -o baz_setup.sh

$ bash baz_setup.sh

$ rm -f -- baz_setup.sh

or

cd /tmp && curl -fL 'https://ari-web.xyz/gh/baz/raw/main/scripts/baz_setup.sh' -o baz_setup.sh && bash baz_setup.sh && rm -f -- baz_setup.sh

script configuration :

  • __BASH_RUNAS: the sudo program ( sudo )
  • PREFIX: where to install baz to ( /usr/bin )
  • plus the normal vars like BAZ_LOGGING_ENABLED

plugin indexing

you can leave a link to it in the PLUGINS.md file :)

setup

  • clone the repo
$ git clone 'https://ari-web.xyz/gh/baz'
  • if you want logging enabled
export BAZ_LOGGING_ENABLED=1
  • if non-zero ( its normal dw ) exit codes bother you on the loader run this :
export BAZ_ENSURE_OK=1
  • if you never want to use the C loader
export BAZ_NO_CC=1
  • set the c compiler ( has to at least support -o <outfile> and -D MACRO="value" flags )
export CC='clang'
  • set the c flags
export CFLAGS='-O3 -s'
  • set the stripper ( if none is set the binary wont be stripped )
export STRIP='llvm-strip'
  • set the stripper flags
export STRIPFLAGS='--remove-section=.note --strip-all'
  • install the script anywhere, or even run it standalone
    • running standalone means just running it
    • installing could be done in for example /usr/local/bin:
$ su -c 'install -Dm755 baz /usr/local/bin'
  • setup
$ baz setup

Or

$ ./baz setup
  • add this to your ~/.bashrc :
export BAZ_LOADER_ENABLED=true
_baz_loader="$HOME/.local/share/baz/loader.sh"

[ ! -f "$_baz_loader" ] || source "$_baz_loader"

this is the main loader for plugins

installing completion

$ ./scripts/comp.sh

uninstallation

Uninstall the baz binaries and then just run:

$ sudo rm -rf ~/.local/share/baz*

help page

$ baz help

upgrading

Just upgrade your package or pull the repo and run :

$ ./baz upgrade

and if you also have completion, rerun the completion script :

$ ./scripts/comp.sh

other docs

examples

debugging

  • set BAZ_DEBUG to any value to any value to debug the baz cli with tracing
  • set BAZ_DEBUG_LOAD to any value to debug the loader
    • this only works if BAZ_LOGGING_ENABLED was set during setup time
  • add set -x before and set +x after the loader to enable tracing