Homebrew’s Formula API
This is the public API for Homebrew.
The main class you should look at is theclass (and classes linked from there). That’s the class that’s used to create Homebrew formulae (i.e. package descriptions). Assume anything else you stumble upon is private.