Skip to content

Repository files navigation

mise-zerobrew

A mise backend plugin that installs Homebrew formulae via zerobrew - a 5-20x faster Homebrew alternative.

Why?

Zerobrew provides significant speed improvements over Homebrew through:

  • Content-addressable storage - instant reinstalls from cache
  • APFS clonefile - zero disk overhead on macOS
  • Parallel operations - concurrent downloads and extraction
  • HTTP caching - aggressive CDN caching

This plugin lets you use zerobrew's speed while managing tools through mise.

Benchmarks

Tested on macOS (CI runner):

Package Homebrew Zerobrew Speedup
Cold install (no cache)
jq 5.42s 2.17s 2.4x
tree 4.16s 0.70s 5.9x
Warm install (cached)
jq 4.46s 0.33s 13.4x
tree 3.41s 0.27s 12.4x
wget 3.87s 1.05s 3.6x

Run benchmarks locally: mise run benchmark

Prerequisites

  1. Install mise
  2. Install zerobrew, either with its installer:
    curl -fsSL https://zerobrew.rs/install | bash
    ...or natively through mise (no Homebrew required), since zb is a self-contained Rust binary published as a GitHub release:
    mise use -g "github:lucasgelfond/zerobrew[matching=zb-,rename_exe=zb]"
    (matching=zb- selects the zb binary over zbx; rename_exe=zb names the command zb.) Either way, zb must be resolvable via command -v zb or mise which zb.

Installation

mise plugins install zerobrew https://github.com/kennyg/mise-zerobrew

Usage

Basic Usage

# Install the latest version of a formula
mise use zerobrew:jq
mise use zerobrew:ripgrep

# Install a specific versioned formula
mise use zerobrew:python@3.11
mise use zerobrew:node@20

# List available versions
mise ls-remote zerobrew:python

In mise.toml

[tools]
"zerobrew:jq" = "latest"
"zerobrew:python" = "3.11"
"zerobrew:node" = "20"

How It Works

Version Discovery

The plugin queries the Homebrew API to find:

  • Versioned formulae (e.g., python@3.11, node@20, go@1.21)
  • The base formula (exposed as version latest)

Installation

Each tool+version combination gets its own isolated zerobrew installation. The on-disk layout differs by OS, mirroring zerobrew's own default_prefix_for_os:

On macOS (zerobrew >= 0.1.2) the tree is flat under the install root (the prefix equals the root to stay within the Mach-O path-length limit):

~/.local/share/mise/installs/zerobrew-{tool}/{version}/
├── bin/           # Symlinks to binaries (mise uses this)
├── lib/           # Libraries
├── Cellar/        # Actual package files
├── store/         # Content-addressable cache
└── db/            # SQLite tracking database

On Linux (all versions) the prefix is nested under prefix/:

~/.local/share/mise/installs/zerobrew-{tool}/{version}/
├── prefix/
│   ├── bin/       # Symlinks to binaries (mise uses this)
│   ├── lib/       # Libraries
│   └── Cellar/    # Actual package files
├── store/         # Content-addressable cache
└── db/            # SQLite tracking database

The env hook (backend_exec_env.lua) detects whichever layout is present.

The plugin uses zb --root <path> install <formula> to isolate each installation.

Limitations

  • Versioned formulae only: Version selection relies on Homebrew's @version naming convention. Not all formulae have versioned variants.
  • macOS/Linux only: Zerobrew requires APFS (macOS) or ext4/xfs (Linux) for optimal performance.
  • Homebrew core tap only: Only formulae from the default Homebrew tap are supported.

Development

# Clone
git clone https://github.com/kennyg/mise-zerobrew
cd mise-zerobrew

# Link for local testing
mise plugins link zerobrew .

# Test
mise ls-remote zerobrew:python
mise install zerobrew:jq@latest

Running Tests

mise run test
mise run lint
mise run ci

License

MIT

About

A mise backend plugin that installs Homebrew formulae via zerobrew (5-20x faster)

Resources

Stars

39 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages