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

Subcommands

install

Install packages from a Brewfile.
Options:
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.
Options:
path
Alias: -fDefault: BrewfilePath to write the Brewfile to.
boolean
Overwrite the file if it already exists. Without this flag, dump will fail if the target file exists.

Global Options

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

Brewfile Format

Brewfiles use a simple text format compatible with Homebrew:
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:
Then install:

Install from custom file

Export installed packages

Generated Brewfile:

Dump to custom file

Overwrite existing file

Without --force, if the file exists:

Install without linking

All packages will be installed but not symlinked into your PATH.

Workflow Examples

Sync environment across machines

On machine A:
On machine B:

Project-specific dependencies

Add a Brewfile to your project repository:
Team members can install dependencies:

Environment profiles

Create different Brewfiles for different purposes:
Switch environments:

Comparison with Homebrew

Error Handling

File not found

Empty Brewfile

If your Brewfile contains only comments:

File exists (dump)

If Brewfile already exists:
Use --force to overwrite: