Homebrew is the package manager macOS doesn’t ship with (it runs on Linux too). It installs command-line tools and, through casks, regular apps.

Installation

Install it from the terminal:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Then put it on your PATH. On Apple silicon, Homebrew lives in /opt/homebrew, and the line belongs in ~/.zprofile, which runs once per login shell instead of in every new shell:

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

Basic Usage

ActionCommand
Install a packagebrew install <formula>
Install a GUI appbrew install --cask <app>
Update Homebrewbrew update
Upgrade packagesbrew upgrade
Search for packagesbrew search <query>
List installedbrew list
Uninstallbrew uninstall <name>
Health checkbrew doctor

Brewfile (Infrastructure as Code)

A Brewfile lists everything you install, so a new Mac can be set up with one command. Export your current setup with:

brew bundle dump

To install everything from an existing Brewfile:

brew bundle

Example Brewfile

# Core Utilities
brew "git"
brew "gh"
brew "node"
brew "python"
brew "ripgrep"
brew "fd"
brew "fzf"
brew "bat"
brew "eza"
brew "zoxide"
brew "starship"
 
# Development Tools
brew "neovim"
brew "tmux"
 
# Desktop Applications (Casks)
cask "ghostty"
cask "visual-studio-code"
cask "sioyek"
cask "raycast"
cask "discord"
cask "spotify"

Maintenance

Remove old versions of installed formulae and clear the download cache:

brew cleanup

brew doctor from the table above reports anything misconfigured.


(y) Return to Notes | (y) Return to CLI & Tools | (y) Return to Home