How homebrew/brew works
Homebrew is a macOS/Linux package manager: users invoke brew commands to find, install, update, and manage formulae and casks, with brew bundle and brew services providing related workflows. The map preserves those distinct product areas, plus package metadata, auditing, and analytics documented by the README. The supplied excerpts chiefly cover services and supporting features; dashed, uncited links mark major runtime relationships that are not directly shown in the sampled source.
Main entry points: cmd/install.rb Install command · commands.rb Brew commands · subcommand/install.rb Bundle command · cli.rb Service manager
Components 22
Command interface
- Brew commands
Library/Homebrew/commands.rb - Install command
Library/Homebrew/cmd/install.rb - Search command
Library/Homebrew/cmd/search.rb - Update command
Library/Homebrew/cmd/update.rb
Package lifecycle
- Formula packages
Library/Homebrew/formula.rb - Cask packages
Library/Homebrew/cask/cask.rb - Source downloads
Library/Homebrew/downloadable.rb - Formula builds
Library/Homebrew/build.rb - Install actions
Library/Homebrew/install_steps/formula_actions.rb - Installed packages
Catalog and audit
- Package API
Library/Homebrew/api.rb - Packages index
Library/Homebrew/api/packages_index.rb - Cask audit
Library/Homebrew/cask/audit.rb - Usage analytics
Library/Homebrew/api/analytics.rb
Environment bundles
- Bundle command
Library/Homebrew/bundle/subcommand/install.rb - Brewfile DSL
Library/Homebrew/bundle/dsl.rb - Bundle installer
Library/Homebrew/bundle/installer.rb
Background services
- Services command
Library/Homebrew/cmd/services.rb - Service definition
Library/Homebrew/service.rb - Service manager
Library/Homebrew/services/cli.rb
Other components
- Homebrew user
- launchd / systemd
Connections 21
- Homebrew user → Brew commands: runs
README.md - Brew commands → Install command: dispatches
- Brew commands → Search command: dispatches
- Brew commands → Update command: dispatches
- Install command → Formula packages: installs
- Install command → Cask packages: installs
- Install command → Source downloads: fetches
- Install command → Formula builds: builds
- Install command → Install actions: executes
- Install actions → Installed packages: writes
- Search command → Packages index: queries
- Package API → Packages index: indexes
- Cask audit → Cask packages: audits
- Homebrew user → Bundle command: runs
README.md - Bundle command → Brewfile DSL: reads
- Bundle command → Bundle installer: delegates
- Homebrew user → Services command: runs
Library/Homebrew/cmd/services.rb - Services command → Service manager: dispatches
Library/Homebrew/cmd/services.rb - Service manager → Service definition: configures
- Service manager → launchd / systemd: controls
- Homebrew user → Usage analytics: views
README.md