Skip to content

OI! A zsh function library based on bashio but for general use.

License

Notifications You must be signed in to change notification settings

finleyfamily/oi

Repository files navigation

OI

CI pre-commit renovate

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.

Installation

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, python may still refer to Python 2 instead of Python 3. It is suggested to use the python3 binary 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.0

To 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-prereleases

By 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 zip

To uninstall OI, pass the --uninstall flag to the script.

curl -sSL https://raw.githubusercontent.com/finleyfamily/oi/refs/heads/master/install.py | python3 - --uninstall

Adding OI to your PATH

The install script creates an oi symlink in a well-known, platform-specific directory:

  • $HOME/.local/bin on 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/oi on Linux/Unix/macOS

Updating

To update OI, simply follow the steps in Installation section again.

Usage

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!";

Functions

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.