Homebrew is the missing package manager for macOS (and Linux). It simplifies the installation of software that Apple (or your Linux system) didn’t include.

Installation

Install Homebrew by running the following command in your terminal:

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

After installation, ensure it is in your PATH by adding it to your .zshrc or .bash_profile:

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zshrc
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 allows you to manage all your dependencies in a single file. You can export your current setup with:

brew bundle dump

To install everything from an existing Brewfile:

brew bundle

Example Brewfile

tap "homebrew/bundle"
tap "homebrew/services"
 
# 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

Keep your system clean by removing old versions of installed formulae:

brew cleanup

Check for potential issues:

brew doctor

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