Skip to content
Latchkey

brew Command Reference: Flags, Usage & CI Examples

brew is the Homebrew package manager for macOS and Linux.

brew installs command-line tools and (via casks) applications on macOS runners, where apt and yum are unavailable. It is the default way to add toolchain dependencies on GitHub-hosted macOS images.

Common flags and usage

  • install <formula...>: install command-line packages
  • install --cask <app>: install a GUI application
  • bundle --file=Brewfile: install everything in a Brewfile
  • list / info: list installed packages or show details
  • HOMEBREW_NO_AUTO_UPDATE=1: skip the slow auto-update
  • HOMEBREW_NO_INSTALL_CLEANUP=1: skip post-install cleanup

Example

shell
export HOMEBREW_NO_AUTO_UPDATE=1
brew install postgresql@16 jq
brew bundle --file=Brewfile

In CI

Set HOMEBREW_NO_AUTO_UPDATE=1 so brew does not spend a minute updating itself before every install. A checked-in Brewfile plus brew bundle makes macOS toolchain setup reproducible across runs.

Key takeaways

  • brew is the package manager for macOS CI runners.
  • HOMEBREW_NO_AUTO_UPDATE=1 avoids slow auto-updates per install.
  • brew bundle with a Brewfile makes setup reproducible.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →