Zillowe FoundationZillowe Documentation

Zoi

Universal Package Manager & Environment Setup Tool.

This guide will provide you with everything you need to know to get started, from installation to advanced usage.

Nel Package Registry

Zoi provides an online package registry, the Nel Registry, to help you discover and search for packages. It provides a user-friendly web interface to browse all the packages available in the official Zoi repositories.

Repository

Introduction

Zoi is a universal package manager and environment setup tool, designed to simplify package management and environment configuration across multiple operating systems. It's part of the Zillowe Development Suite (ZDS) and aims to streamline your development workflow by managing tools and project environments with ease.

Features

  • Cross-Platform: Works seamlessly on Linux, macOS, and Windows.
  • Dynamic Package Definitions: Define packages with dynamic Lua scripts (.pkg.lua) for maximum flexibility.
  • Universal Package Support: Install from binaries, compressed archives, source, or installer scripts.
  • Extensive Dependency Management: Integrates with over 40 package managers (apt, brew, cargo, npm, pip, etc.).
  • Rich Dependencies: Define runtime and build dependencies with required, optional, and selectable options.
  • Project Environments: Manage project-specific commands and environments with zoi.yaml.
  • Repository-Based: Use official, community, or your own private/public Git-based repositories.
  • Secure & Verifiable: Verifies package integrity and authenticity with checksums and GPG signatures. Manage keys with zoi pgp.
  • Versatile Package Types: Supports standard packages, collections, services, configs, app templates, extensions, libraries, and inline scripts.
  • Local Package Development: A dedicated zoi package command set (meta, build, install) to streamline creating and testing packages locally.
  • Advanced CLI Tools:
    • zoi man: Read package manuals in the terminal.
    • zoi why: Understand why a package is installed.
    • zoi rollback: Revert a package to its previous version.
    • zoi pin: Pin a package to a specific version.
    • zoi exec: Run a package without installing it.
  • Library Support: Use as a Rust library and get compiler/linker flags via zoi pkg-config.

Getting Started

Getting started with Zoi is simple. Just follow these three steps:

  1. Install Zoi: Choose one of the installation methods below.

  2. Sync Repositories: Before you can install packages, you need to sync the package repositories.

    zoi sync
  3. Install a Package: Now you can install any package you want. For example, to install hello:

    zoi install hello

Installation

You can install Zoi using a package manager, an installer script, or by building it from source.

Package Managers

Arch Linux (AUR)

Install zoi-bin (Pre-compiled binary) or zoi (built from source) from the AUR:

yay -S zoi-bin

macOS (Homebrew)

brew install Zillowe/tap/zoi

Windows (Scoop)

scoop bucket add zillowe https://github.com/Zillowe/scoop.git
scoop install zoi

From Crates.io

You can install zoi directly from crates.io using cargo

cargo install zoi-rs

From NPM

You can install @zillowe/zoi from npm also.

npx @zillowe/zoi
bunx @zillowe/zoi
pnpm dlx @zillowe/zoi
yarn dlx @zillowe/zoi

Scripts

Linux / macOS:

curl -fsSL https://zillowe.pages.dev/scripts/zoi/install.sh | bash

Windows:

powershell -c "irm zillowe.pages.dev/scripts/zoi/install.ps1|iex"

Build from Source

You'll need Rust installed.

# Build the release binary
# For Linux/macOS
./build/build-release.sh
# For Windows
./build/build-release.ps1

# Install it locally
./configure
make
sudo make install
# Install CLI completions (bash, zsh, fish, elvish, powershell)
make install-completion

Platforms

What platforms we currently support.

OSArchZoi BinaryPackages Support
Linuxamd64✔️✔️
Linuxarm64✔️✔️
macOSamd64✔️✔️
macOSarm64✔️✔️
Windowsamd64✔️✔️
Windowsarm64✔️
FreeBSDamd64✔️
FreeBSDarm64✔️
OpenBSDamd64✔️
OpenBSDarm64✔️

We're planning to add support for more platforms.

Usage & Commands

Zoi provides a wide range of commands to manage your packages and environment. For a full list of commands and their options, you can always run zoi --help.

General Commands

CommandDescription
versionDisplays the version number, build status, branch, and commit hash.
aboutDisplays the full application name, description, author, license, and homepage.
infoDisplays key system details like OS, CPU architecture, and available package managers (requires zoi sync to be run first for package manager detection).
checkVerifies that all required dependencies (like git) are installed.
setupConfigures the shell environment for Zoi to make package binaries available.
--scope <user system>: Set the scope (default: user).
syncClones or updates the package database from the configured registry.
--verbose: Show the full git output.
--fallback: If the primary registry fails, try to sync from official mirrors (GitHub, Codeberg, GitLab).
--no-pm: Skip checking for installed package managers.
upgradeDownloads the latest release of Zoi and replaces the current executable.
--full: Force a full download, skipping the patch-based upgrade.
--force: Force the upgrade even if the version is the same.
--tag <tag>: Upgrade to a specific git tag.
--branch <branch>: Upgrade to the latest release of a specific branch.
cleanClears the cache of downloaded package binaries.
autoremoveRemoves packages that were installed as dependencies but are no longer needed.
telemetryManages opt-in telemetry.

Package Management

CommandDescription
listLists installed or all available packages.
--all: List all packages, not just installed.
--repo <repo>: Filter by repository.
--type <type>: Filter by package type.
showShows detailed information about a package.
--raw: Display the raw, unformatted package file.
searchSearches packages by name, description, and tags.
--repo <repo>: Filter by repository.
--type <type>: Filter by package type.
-t, --tag <tag>: Filter by one or more tags (repeat or comma-separate).
shellInstalls completion scripts for a given shell (e.g. zoi shell bash).
installInstalls one or more packages. Can also install from a zoi.pkgs.json file (to restore all packages) or a <pkg>.manifest.yaml file (for reproducible dependency choices).
--repo <repo>: Install a package directly from a git repository (e.g. Zillowe/Hello or gl:Zillowe/Hello). The repository must contain a zoi.yaml file with a package field specifying a package name, a path to a .pkg.lua file, or a URL to one.
--force: Force re-installation if the package already exists.
--interactive: Choose the installation method interactively.
--all-optional: Install all optional dependencies.
buildBuilds and installs one or more packages from source.
--force: Force the package to be rebuilt.
uninstallRemoves one or more packages. Also removes any of its dependencies that are no longer needed. For collections, it removes all of its dependencies.
updateUpdates one or more packages to the latest version.
pinPins a package to a specific version to prevent updates.
unpinUnpins a package, allowing it to be updated again.
rollbackRolls back a package to its previously installed version. See Package Rollbacks.
whyExplains why a package is installed (e.g. as a dependency or directly).
cloneClones the source code repository of one or more packages. A target directory can only be specified when cloning a single package.
execDownloads a binary to a temporary cache and runs it without installing it.
extensionManages Zoi extensions (add, remove).
createCreates an application from an app template. Usage: zoi create <source> <appName>
manRenders a package's manual in the terminal.
--upstream: Fetch the manual from its remote URL, ignoring any local copy.
--raw: Print the raw manual content without rendering.
pkg-configProvides compiler and linker flags for installed libraries.

Project Environment

CommandDescription
runExecutes a command from a local zoi.yaml file. Can be run interactively.
envSets up project environments from a zoi.yaml file. Can be run interactively.

See the full schema and examples in Project Configuration (zoi.yaml).

Service Management

CommandDescription
startStarts a package that is a service.
stopStops a running service package.

Package Development

CommandDescription
packageBuild, create, and manage Zoi packages (meta, build, install).
pgpManage PGP keys for package signature verification (add, remove, list).

Sync Management (sync)

Manages the package database registry URL.

SubcommandDescription
sync set <url or keyword>Sets the package database registry URL. Keywords: default, gitlab, github, codeberg.
sync showDisplays the current registry URL.

Repository Management (repo)

Manages the list of package repositories that Zoi uses.

SubcommandDescription
repo add <name-or-url>Add an official repo by name or clone from a git URL (interactive if no args).
repo rm <name>Remove a repository from the active list.
repo lsShow active repositories. Use repo ls all to show all available repositories.
repo git lsList cloned git repositories under ~/.zoi/pkgs/git.
repo git rm <repo-name>Remove a cloned git repository directory (~/.zoi/pkgs/git/<repo-name>).

Example:

# Add a repository interactively
zoi repo add

# Add a repository by name
zoi repo add community

# Add a repository by git URL (auto-clone)
zoi repo add https://example.com/my-zoi-repo.git

# Remove a repository
zoi repo rm community

# List active repositories
zoi repo ls

For an overview of official repositories, mirrors, and repository tiers, see Repositories.

Zoi supports different types of packages, defined in the .pkg.lua file.

TypeDescription
PackageA standard software package that can be installed. This is the default type.
CollectionA meta-package that groups other packages together as dependencies.
ServiceA package that runs as a background service. Can be managed with shell commands or via Docker Compose.
ConfigA package that manages configuration files. It includes commands for installing and uninstalling the configuration.
AppAn app template. Not installable; used via zoi create to scaffold an application (e.g. frameworks like Rails).
ExtensionA package that can modify Zoi's configuration, such as adding new package repositories. It is not installed in the traditional sense but its changes are applied or reverted. See the Extensions Guide.
LibraryA software library with headers and/or binaries (.so, .dll, .a). Can provide pkg-config files.
ScriptA package that runs a series of inline shell commands instead of installing a binary.

Creating Packages (.pkg.lua)

Packages for Zoi are defined using .pkg.lua files. These are Lua scripts that define package metadata and installation logic, allowing for highly dynamic and flexible package definitions.

  • Dynamic & Flexible: Use Lua scripting to define dynamic URLs, platform-specific logic, and complex installation steps.
  • Comprehensive Examples: For a deep dive into creating packages, see the Creating Packages guide and the Package Examples.

.pkg.lua Structure

A .pkg.lua file is a Lua script that calls global functions like package{}, install{}, and dependencies{} to define the package.

-- my-cli.pkg.lua
package({
  name = "my-cli",
  repo = "community",
  version = "1.2.3",
  description = "A simple command-line utility.",
  -- ... more metadata
})

install({
  {
    type = "binary",
    url = "https://example.com/my-cli-v" .. PKG.version .. "-" .. SYSTEM.OS .. "-" .. SYSTEM.ARCH,
    platforms = { "all" },
  }
})

This approach allows you to use Lua's full power to construct your package definition. You have access to global variables like PKG (the package table) and SYSTEM (with OS, ARCH, DISTRO).

Installation Methods

Zoi supports four types of installation methods within the installation list:

  1. binary: Downloads a pre-compiled binary directly from a URL.
  2. com_binary: Downloads a compressed archive (.zip, .tar.gz, etc.), extracts it, and finds the binary within. Supports bin_path to point to the executable inside the archive and a files field to copy additional files (e.g. manuals, licenses). On Windows targets, if bin_path lacks .exe, Zoi will also try with .exe appended.
  3. source: Clones a git repository and runs your defined build_commands. Zoi then moves the final executable to the installation directory. By default, Zoi looks for an executable with the same name as the package. If the executable has a different name or is in a subdirectory, you must specify its location with the bin_path field. Also supports a files field to copy additional files from the build directory. Supports optional tag or branch (use only one). If none is provided, the default branch HEAD is used. For reproducible builds, you can specify a docker_image to run the build inside a container.
  4. script: Downloads and executes an installation script (e.g. install.sh).

For the list of supported archive formats for com_binary, see Supported Archives for Compressed Binaries.

Dependencies

For the full list of supported dependency managers, usage semantics, and commands Zoi runs, see Dependencies & Supported Package Managers.

FAQ

















Examples

  • Install a package:

    zoi install <package_name>
  • Install multiple packages:

    zoi install <package_1> <package_2>
  • Update a package:

    zoi update <package_name>
  • Update multiple packages:

    zoi update <package_1> <package_2>
  • Update all packages:

    zoi update all
  • Uninstall a package:

    zoi uninstall <package_name>
  • Uninstall multiple packages:

    zoi uninstall <package_1> <package_2>
  • Install from a specific repository:

    # Install from a top-level repository
    zoi install @community/htop
    
    # Install from a nested repository
    zoi install @core/linux/amd64/nvidia-driver
  • List all available packages from active repos:

    zoi list --all
  • Search for a package:

    zoi search <term>
  • Search by tag directly:

    # The term matches tags too
    zoi search editor
    
    # Require specific tag(s)
    zoi search editor -t cli,devtools
    zoi search editor -t cli -t devtools
  • Check why a package is installed:

    zoi why <package_name>
  • Create an app from a template:

    zoi create <source> <appName>
    # e.g.
    zoi create rails-app MyBlog
    zoi create @community/rails-app MyBlog
    # The term matches tags too
    zoi search editor
    
    # Require specific tag(s)
    zoi search editor -t cli,devtools
    zoi search editor -t cli -t devtools
  • Check why a package is installed:

    zoi why <package_name>
  • Create an app from a template:

    zoi create <source> <appName>
    # e.g.
    zoi create rails-app MyBlog
    zoi create @community/rails-app MyBlog

Last updated on