The Ultimate Brewfile: Automate Your Entire Mac Toolchain
One file to install every CLI tool, app, and font on your Mac. Sync it everywhere.
What is a Brewfile?
A Brewfile is Homebrew's built-in way to declare every formula, cask, tap, and Mac App Store app you want installed. Think of it as a package.json for your entire Mac.
With one command — brew bundle — you can install everything on a fresh machine. Combine it with ConfigSync and you never manually install tools again.
Generate Your Brewfile
If you already have tools installed via Homebrew, dump them into a Brewfile:
brew bundle dump --file=~/.Brewfile --force
This captures your current formulas, casks, taps, and Mac App Store apps. The --force flag overwrites any existing Brewfile.
Anatomy of a Great Brewfile
# Taps
tap "homebrew/bundle"
tap "homebrew/cask-fonts"
# CLI Tools
brew "git"
brew "gh"
brew "ripgrep"
brew "fd"
brew "fzf"
brew "bat"
brew "eza"
brew "jq"
brew "delta"
brew "starship"
brew "node"
brew "python@3.12"
# Apps
cask "visual-studio-code"
cask "iterm2"
cask "docker"
cask "1password"
cask "raycast"
cask "arc"
cask "figma"
cask "slack"
# Fonts
cask "font-jetbrains-mono-nerd-font"
cask "font-fira-code"
# Mac App Store
mas "Xcode", id: 497799835
Organize by section: taps first, then CLI tools, apps, fonts, and Mac App Store apps. Add comments to explain non-obvious choices.
Install from a Brewfile
# Install everything
brew bundle --file=~/.Brewfile
# Install without upgrading existing packages
brew bundle --file=~/.Brewfile --no-upgrade
# See what would be installed (dry run)
brew bundle check --file=~/.Brewfile --verbose
# Remove packages not in the Brewfile
brew bundle cleanup --file=~/.Brewfile
Sync Your Brewfile with ConfigSync
ConfigSync's homebrew module tracks your Brewfile and can even generate one automatically:
# Add the homebrew module
configsync add module homebrew
# Push (captures ~/.Brewfile + brew bundle dump)
configsync push
# On a new Mac: pull and install
configsync pull
brew bundle --file=~/.Brewfile --no-upgrade
brew leaves and brew list --cask independently via configsync scan. The Brewfile is a bonus layer for reproducible installs.Auto-Install with Hooks
Set up a post-pull hook so packages install automatically after every pull:
hooks:
post_pull:
- "brew bundle --file=~/.Brewfile --no-upgrade"
Now when you run configsync pull on any machine, your Brewfile installs automatically after configs are restored.
Tips
- Use
--no-upgradein hooks to avoid surprise version bumps when you just want to restore configs. - Regenerate regularly: Run
brew bundle dump --forceafter installing new tools, thenconfigsync push. - Separate work and personal: Use ConfigSync profiles with different Brewfiles per context.
- Mac App Store apps require being signed into the App Store first. Skip
masentries if they cause issues on fresh installs.
Ready to try ConfigSync?
Sync your entire dev environment across machines in minutes. Free forever for up to 3 devices.