Summarizing my attempts to understand Homebrew codebase


  • Formula - package definition.

  • Keg - installation prefix of a formula.

  • Cellar - where all kegs are located.

  • Tap - git repo of formulae and/or commands.

  • Bottle - pre-built keg.

  • Cask - extension of Homebrew to install native MacOS apps.

General notes:

  • I like how formulae come with tests.

  • Formula dev guide is pretty great.

  • Ruby seems like a great choice for DLSs like this.

  • Overall code structure seems moderately simple, e.g. there are not too many layers of redirection for the most part.

  • Implementation details are often rather convoluted, with not too many comments.

  • A lot of long methods.



Last updated