Skip to main content
Zerobrew can be configured using environment variables to customize installation paths and behavior. These variables can be set in your shell configuration or passed directly when running commands.

Core Variables

string
The root directory where zerobrew stores all its data, including the package store, cellar, cache, database, and locks.This directory contains:
  • store/ - Content-addressed package storage
  • cellar/ - Installed package metadata
  • cache/ - Downloaded package archives
  • db/ - SQLite database (zb.sqlite3)
  • locks/ - File locks for concurrent operations
Platform defaults:
  • macOS: /opt/zerobrew
  • Linux: $XDG_DATA_HOME/zerobrew (typically ~/.local/share/zerobrew)
Example:
string
The prefix directory where package binaries and libraries are symlinked. This is the directory you should add to your PATH.Platform-specific behavior:
  • macOS: Defaults to ZEROBREW_ROOT directly (e.g., /opt/zerobrew) to maintain compatibility with Mach-O binary path length constraints (13 characters, same as Homebrew’s /opt/homebrew)
  • Linux: Defaults to $ZEROBREW_ROOT/prefix to separate data from the installation prefix
This directory typically contains:
  • bin/ - Executable binaries
  • lib/ - Shared libraries
  • include/ - Header files
  • share/ - Shared data files
  • etc/ - Configuration files
  • opt/ - Individual package directories
Example:
boolean
default:"false"
Automatically initialize zerobrew without prompting when running commands for the first time.When set to true, zerobrew will automatically:
  • Create the root and prefix directories
  • Set up the internal directory structure
  • Initialize the package database
This is useful for:
  • CI/CD environments where interactive prompts are not possible
  • Automated scripts and provisioning tools
  • Docker containers and other non-interactive environments
Example:

Additional Environment Variables

Zerobrew also respects and sets several other environment variables for compatibility and functionality:

Package Config

string
Automatically set by zerobrew’s shell initialization to include $ZEROBREW_PREFIX/lib/pkgconfig for pkg-config to find installed libraries.Example:

SSL Certificates

Zerobrew automatically configures SSL certificate paths when available:
string
Path to the CA certificate bundle for curl and other tools. Automatically set to one of:
  • $ZEROBREW_PREFIX/opt/ca-certificates/share/ca-certificates/cacert.pem
  • $ZEROBREW_PREFIX/etc/ca-certificates/cacert.pem
  • $ZEROBREW_PREFIX/etc/openssl/cert.pem
  • $ZEROBREW_PREFIX/share/ca-certificates/cacert.pem
string
Path to the SSL certificate file. Uses the same priority order as CURL_CA_BUNDLE.
string
Directory containing SSL certificates. Automatically set to one of:
  • $ZEROBREW_PREFIX/etc/ca-certificates
  • $ZEROBREW_PREFIX/etc/openssl/certs
  • $ZEROBREW_PREFIX/share/ca-certificates

Usage Examples

Custom Installation Location

CI/CD Environment

Docker Container

Development Setup

CLI Flag Override

Environment variables can be overridden using CLI flags:

Priority Order

Zerobrew determines configuration values in the following priority order (highest to lowest):
  1. CLI flags - --root, --prefix, --auto-init
  2. Environment variables - ZEROBREW_ROOT, ZEROBREW_PREFIX, ZEROBREW_AUTO_INIT
  3. Existing installation - If /opt/zerobrew exists, it will be used
  4. Platform defaults - macOS uses /opt/zerobrew, Linux uses $XDG_DATA_HOME/zerobrew
On macOS, the prefix must not exceed 13 characters due to Mach-O binary limitations. Zerobrew defaults to using the root directory as the prefix (/opt/zerobrew) to maintain compatibility with Homebrew’s path length.