https://github.com/finleyfamily/oi
OI! A zsh function library based on bashio but for general use.
https://github.com/finleyfamily/oi
zsh zsh-library
Last synced: 2 months ago
JSON representation
OI! A zsh function library based on bashio but for general use.
- Host: GitHub
- URL: https://github.com/finleyfamily/oi
- Owner: finleyfamily
- License: apache-2.0
- Created: 2024-10-18T15:48:29.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2026-04-16T20:49:36.000Z (3 months ago)
- Last Synced: 2026-04-16T22:30:09.244Z (3 months ago)
- Topics: zsh, zsh-library
- Language: Shell
- Homepage:
- Size: 546 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OI
[](https://github.com/finleyfamily/oi/actions/workflows/ci.yml)
[](https://github.com/pre-commit/pre-commit)
[](https://developer.mend.io/github/finleyfamily/oi)
OI! A zsh function library based on [bashio](https://github.com/hassio-addons/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](https://github.com/finleyfamily/oi/blob/master/install.py) to make installation easy.
The install script requires Python ^3.10.
```console
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.
```console
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.
```console
curl -sSL https://raw.githubusercontent.com/finleyfamily/oi/refs/heads/master/install.py | python3 - --allow-prereleases
```
To 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`.
```console
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 - -g
```
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.
```console
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.
```console
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](#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:
```shell
#! /usr/bin/env bash
echo "[INFO] Hello world!";
```
After:
```shell
#! /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/`](./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.