Usage
Subcommands
install
Install packages from a Brewfile.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.Alias:
-fDefault: BrewfilePath to write the Brewfile to.Overwrite the file if it already exists. Without this flag,
dump will fail if the target file exists.Global Options
Environment:
ZEROBREW_ROOTOverride the root directory for zerobrew’s content-addressable store.Environment:
ZEROBREW_PREFIXOverride the prefix directory where packages are linked.Default:
20Number of concurrent operations to perform during installation.Alias:
--yesEnvironment: ZEROBREW_AUTO_INITAutomatically initialize zerobrew if not already set up.Brewfile Format
Brewfiles use a simple text format compatible with Homebrew:- Lines starting with
#are comments brew "name"- Install a formulacask "name"- Install a casktap "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 aBrewfile in your current directory:
Install from custom file
Export installed packages
Brewfile:
Dump to custom file
Overwrite existing file
--force, if the file exists:
Install without linking
Workflow Examples
Sync environment across machines
On machine A:Project-specific dependencies
Add aBrewfile to your project repository:
Environment profiles
Create different Brewfiles for different purposes:Comparison with Homebrew
| Feature | zerobrew | Homebrew |
|---|---|---|
| Install from Brewfile | zb bundle | brew bundle |
| Custom file | zb bundle install -f FILE | brew bundle --file=FILE |
| Export Brewfile | zb bundle dump | brew bundle dump |
| Force overwrite | zb bundle dump --force | brew bundle dump --force |
| No link | zb bundle install --no-link | Not available |
Error Handling
File not found
Empty Brewfile
If your Brewfile contains only comments:File exists (dump)
Brewfile already exists:
--force to overwrite:
Related Commands
zb install- Install individual packageszb list- List installed packageszb uninstall- Uninstall packages