OI! A zsh function library based on bashio but for general use. While primarily intended for use with zsh, OI should be mostly compatible with Bash.
OI provides a Python install script to make installation easy. The install script requires Python ^3.10.
curl -sSL https://raw.githubusercontent.com/finleyfamily/oi/refs/heads/master/install.py | python3 -ℹ️ NOTE: On some systems,
pythonmay still refer to Python 2 instead of Python 3. It is suggested to use thepython3binary to avoid ambiguity.
To install a specific version of OI, the --version option can be passed to the script.
curl -sSL https://raw.githubusercontent.com/finleyfamily/oi/refs/heads/master/install.py | python3 - --version 1.0.0To install a pre-release version of OI, the --allow-prereleases flag can be provided.
curl -sSL https://raw.githubusercontent.com/finleyfamily/oi/refs/heads/master/install.py | python3 - --allow-prereleasesTo install globally for all users, the --global option can be passed to the script.
This will install OI to /usr/local/ rather than $HOME/.local.
curl -sSL https://raw.githubusercontent.com/finleyfamily/oi/refs/heads/master/install.py | sudo python3 - --global
curl -sSL https://raw.githubusercontent.com/finleyfamily/oi/refs/heads/master/install.py | sudo python3 - -gBy default the .tar.gz artifact of OI is installed.
If perferred, the .zip artifact can be used by passing --artifact-type zip to the script.
curl -sSL https://raw.githubusercontent.com/finleyfamily/oi/refs/heads/master/install.py | python3 - --artifact-type zipTo uninstall OI, pass the --uninstall flag to the script.
curl -sSL https://raw.githubusercontent.com/finleyfamily/oi/refs/heads/master/install.py | python3 - --uninstallThe install script creates an oi symlink in a well-known, platform-specific directory:
$HOME/.local/binon Linux/Unix/macOS
If this directory is not present in your PATH, it should be added.
Alternatively, the full path to the OI script can always be used:
~/.local/lib/oi/oion Linux/Unix/macOS
To update OI, simply follow the steps in Installation section again.
Configuring a zsh script to use the OI library is fairly easy. Simply replace the shebang of your script with from zsh to oi.
Before:
#! /usr/bin/env bash
echo "[INFO] Hello world!";After:
#! /usr/bin/env oi
oi::log.info "Hello world!";The best way to see all the available functions and their documentation is to look through the different modules in src/.
Each module has it's own file and each function has been documented inside the codebase.
Once installed, you can also use oi --help to view a list of all available functions.