What is Homebrew?
Homebrew is the essential package manager for macOS. It lets you easily install developer tools, command-line utilities, and even GUI applications from your terminal. If you're doing AI development, you'll need Homebrew.
Step 1: Install Homebrew
Open Terminal and run this command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
The installer will:
- Check for Xcode Command Line Tools (install if needed)
- Create the /opt/homebrew directory (on Apple Silicon) or /usr/local (Intel)
- Set up necessary permissions
Note: You may need to enter your Mac password during installation.
Step 2: Add Homebrew to Your PATH
After installation, add Homebrew to your shell. For zsh (default on macOS):
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
For Intel Macs, replace /opt/homebrew with /usr/local
Step 3: Verify Installation
brew --version
brew doctor
brew doctor checks for common issues. Fix any warnings it reports.
Essential Commands
brew install <package>
Install a package
brew search <term>
Search for packages
brew list
Show installed packages
brew update
Update Homebrew
brew upgrade
Upgrade all packages
brew uninstall <package>
Remove a package
Install AI Development Tools
Here are essential packages for AI development:
# Python & tools
brew install [email protected]
brew install pipx
brew install uv
# Git & version control
brew install git
brew install gh
# Terminal enhancements
brew install ripgrep
brew install fzf
brew install bat
# AI/ML tools
brew install ollama
brew install cmake
# Node.js (for web dev)
brew install node
🔧 Troubleshooting
"brew: command not found"
Homebrew isn't in your PATH. Run the shellenv commands from Step 2 again.
Permission denied errors
Run sudo chown -R $(whoami) /opt/homebrew (or /usr/local on Intel)
Slow downloads
Homebrew uses GitHub releases. If you're outside the US, consider setting a mirror.
🎉 Homebrew is Ready!
You can now install any developer tool with a single command. Next, set up VS Code, Git, and your other development essentials.