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=BrewfileIn 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
apk Command Reference: Flags, Usage & CI ExamplesReference for Alpine apk: add, --no-cache, --virtual, del, and a CI example that installs build dependencies…
apt-get Command Reference: Flags, Usage & CI ExamplesReference for apt-get: update, install, -y, DEBIAN_FRONTEND, --no-install-recommends, and a CI example that i…
dnf Command Reference: Flags, Usage & CI ExamplesReference for dnf: install, -y, --setopt=install_weak_deps, remove, clean all, and a CI example that installs…