Skip to main content
The zb init command sets up zerobrew for first use by creating necessary directories and configuring your shell environment to use zerobrew packages.

Usage

Options

flag
Skip automatic shell configuration. Use this if you want to manually configure your shell or manage PATH yourself.

What Gets Initialized

Directory Structure

The following directories are created:
  • $ZEROBREW_ROOT/store - Content-addressable package storage
  • $ZEROBREW_ROOT/db - Package installation database
  • $ZEROBREW_ROOT/cache - Downloaded bottle cache
  • $ZEROBREW_ROOT/locks - Concurrency control
  • $ZEROBREW_PREFIX/bin - Symlinks to package executables
  • $ZEROBREW_PREFIX/Cellar - Package installation directories (kegs)

Shell Configuration

Unless --no-modify-path is specified, init adds a configuration block to your shell profile: For Bash/Zsh:
  • Environment variables (ZEROBREW_DIR, ZEROBREW_ROOT, ZEROBREW_PREFIX, etc.)
  • PKG_CONFIG_PATH configuration
  • SSL/TLS certificate paths (CURL_CA_BUNDLE, SSL_CERT_FILE, SSL_CERT_DIR)
  • PATH updates to include zerobrew binaries
For Fish:
  • Creates ~/.config/fish/conf.d/zerobrew.fish with equivalent configuration

Shell Profile Detection

The command automatically detects your shell and updates the appropriate config file:

Permissions

If the target directories require elevated permissions, init will:
  1. Prompt for sudo to create directories
  2. Create the directory structure
  3. Change ownership to your user account
This is common when using system paths like /opt/zerobrew.

Examples

Standard Initialization

Configure zerobrew with default settings:
Output:

Manual PATH Configuration

Skip automatic shell configuration:
Output:
Then manually add to your shell config:

Custom Paths

Use environment variables to customize locations:
On macOS, the prefix path is limited to 13 characters due to Mach-O binary format constraints. Longer paths will cause warnings and may fail for path-sensitive packages like git and curl.

Auto-Initialization

If you run any zerobrew command without initializing first, you’ll be prompted:
To skip this prompt, use the --auto-init flag:
Or set the environment variable:

Environment Variables Set

After initialization, these environment variables are configured:
string
Location of zerobrew installation (default: ~/.zerobrew)
string
Location of zerobrew binaries (default: ~/.zerobrew/bin)
string
Root directory for zerobrew data (store, db, cache)
string
Installation prefix for packages (bin, Cellar)
string
Updated to include zerobrew’s pkg-config files
string
SSL certificate bundle (set if ca-certificates is installed)
string
SSL certificate file (set if ca-certificates is installed)
string
SSL certificate directory (set if ca-certificates is installed)

Managed Configuration Block

The shell configuration is wrapped in marker comments:
Running zb init again will update the configuration block without duplicating it.

Troubleshooting

Changes Not Taking Effect

After initialization, reload your shell configuration:

Permission Denied

If you see permission errors, the command will prompt for sudo automatically. Ensure you have sudo privileges.

macOS Prefix Length Warning

Use a shorter prefix path (13 characters or less) on macOS.