package.json for Node.js or requirements.txt for Python. zerobrew provides commands to install packages from Brewfiles and export your installed packages to a Brewfile.
Installing from a Brewfile
Default Brewfile
To install all packages listed in aBrewfile in the current directory:
Brewfile and installs each package sequentially:
Custom file location
To install from a different file:Install without linking
To install packages without creating symlinks in the prefix:Brewfile Format
Brewfiles support multiple formats:Simple format
List one package per line:Homebrew format
Usebrew directives with quotes:
Comments
Add comments with#:
Mixed format
Combine formats in the same file:Tap and Cask directives
Exporting to a Brewfile
Default export
To export all installed packages to aBrewfile in the current directory:
brew directive format:
Custom output file
To dump to a different file:Overwrite existing files
By default,dump will fail if the target file exists:
Common Workflows
1
Create a portable development environment
Export your current setup:Commit to version control:
2
Restore on a new machine
Clone your dotfiles:Install all packages:
Team development environment
Create a shared Brewfile for your project:Brewfile
Update and sync
After installing new packages, update your Brewfile:Brewfile Parsing Details
Duplicate handling
Duplicate entries are automatically deduplicated:jq and wget are installed (jq appears once).
Empty lines and whitespace
Empty lines and leading/trailing whitespace are ignored:jq, wget, git.
Error handling
If the Brewfile contains only comments or is empty:Command Reference
zb bundle install
-f, --file <FILE>- Path to Brewfile (default:Brewfile)--no-link- Install without creating symlinks
zb bundle dump
-f, --file <FILE>- Output file path (default:Brewfile)--force- Overwrite existing file
Related Commands
zb install <formula>- Install individual packageszb list- View all installed packages- Migration Guide - Migrate from Homebrew and export to Brewfile