Skip to main content
Manage package installations using Brewfiles, which are text files that list packages to install. This provides a declarative way to manage your development environment and makes it easy to reproduce setups across machines.

Usage

zb bundle [SUBCOMMAND] [OPTIONS]

Subcommands

install

Install packages from a Brewfile.
zb bundle install [OPTIONS]
Options:
--file
path
Alias: -fDefault: BrewfilePath to the Brewfile to read packages from.
Install formulas but skip linking them into the prefix directory.

dump

Export currently installed packages to a Brewfile.
zb bundle dump [OPTIONS]
Options:
--file
path
Alias: -fDefault: BrewfilePath to write the Brewfile to.
--force
boolean
Overwrite the file if it already exists. Without this flag, dump will fail if the target file exists.

Global Options

--root
path
Environment: ZEROBREW_ROOTOverride the root directory for zerobrew’s content-addressable store.
--prefix
path
Environment: ZEROBREW_PREFIXOverride the prefix directory where packages are linked.
--concurrency
number
Default: 20Number of concurrent operations to perform during installation.
--auto-init
boolean
Alias: --yesEnvironment: ZEROBREW_AUTO_INITAutomatically initialize zerobrew if not already set up.

Brewfile Format

Brewfiles use a simple text format compatible with Homebrew:
# Comments are supported
brew "jq"
brew "wget"
brew "git"

# Casks are supported
cask "docker-desktop"

# Taps are ignored by zerobrew
tap "homebrew/cask"

# Simple format also works
ripgrep
fd
Syntax rules:
  • Lines starting with # are comments
  • brew "name" - Install a formula
  • cask "name" - Install a cask
  • tap "name" - Ignored by zerobrew
  • Plain package names are also supported
  • Inline comments are supported: jq # JSON processor
  • Duplicate entries are automatically deduplicated

Examples

Install from default Brewfile

Create a Brewfile in your current directory:
brew "jq"
brew "wget"
brew "git"
Then install:
zb bundle
==> Installing 3 formulas from Brewfile...
==> Installing jq...
==> Resolving dependencies (1 packages)...
    jq 1.7.1
==> Downloading and installing formulas...
    jq               ━━━━━━━━━━━━━━━━━━━━━━━━━ ✓ installed

==> Installed 1 packages in 2.45s
==> Installing wget...
...
==> Finished installing manifest in 15.32s

Install from custom file

zb bundle install -f myfile
==> Installing 5 formulas from myfile...
...

Export installed packages

zb bundle dump
==> Dumped 12 packages to Brewfile
Generated Brewfile:
brew "jq"
brew "wget"
brew "git"
brew "openssl@3"
brew "pcre2"
brew "gettext"
brew "ripgrep"
brew "fd"
brew "bat"
brew "exa"
brew "httpie"
brew "tree"

Dump to custom file

zb bundle dump -f ~/my-setup/Brewfile
==> Dumped 12 packages to /Users/username/my-setup/Brewfile

Overwrite existing file

zb bundle dump --force
Without --force, if the file exists:
Error: file Brewfile already exists (use --force to overwrite)

Install without linking

zb bundle install --no-link
All packages will be installed but not symlinked into your PATH.

Workflow Examples

Sync environment across machines

On machine A:
zb bundle dump
git add Brewfile
git commit -m "Update Brewfile"
git push
On machine B:
git pull
zb bundle install

Project-specific dependencies

Add a Brewfile to your project repository:
# Brewfile
brew "node"
brew "[email protected]"
brew "postgresql@15"
brew "redis"
Team members can install dependencies:
cd project
zb bundle install

Environment profiles

Create different Brewfiles for different purposes:
zb bundle dump -f Brewfile.dev      # Development tools
zb bundle dump -f Brewfile.data     # Data science tools
zb bundle dump -f Brewfile.ops      # DevOps tools
Switch environments:
zb bundle install -f Brewfile.data

Comparison with Homebrew

FeaturezerobrewHomebrew
Install from Brewfilezb bundlebrew bundle
Custom filezb bundle install -f FILEbrew bundle --file=FILE
Export Brewfilezb bundle dumpbrew bundle dump
Force overwritezb bundle dump --forcebrew bundle dump --force
No linkzb bundle install --no-linkNot available

Error Handling

File not found

zb bundle install -f missing.txt
Error: failed to read manifest missing.txt: No such file or directory

Empty Brewfile

If your Brewfile contains only comments:
Error: manifest Brewfile did not contain any formulas

File exists (dump)

zb bundle dump
If Brewfile already exists:
Error: file Brewfile already exists (use --force to overwrite)
Use --force to overwrite:
zb bundle dump --force

Build docs developers (and LLMs) love