Saturday, Sep 6, 2025 Distributing your own scripts via Homebrew I use Homebrew all the time. Whenever I see a new CLI that offers an npm or uv install path alongside a brew one, I choose brew every single time. And yet, when it comes time to publish a CLI of my own, I usually just ship it as a Ruby gem or an npm package, because I had (and have!) no fucking clue how Homebrew works. I'm not enough of a neckbeard to peer behind the curtain as soon as root directories like /usr and /opt are involved, so I never bothered before today. But it's 2025 and we can consult LLMs to conjure whatever arcane incantations we need. And because he listens to the cast, I can always fall back on texting Mike McQuaid when his docs suck. So, because I'll never remember any of this shit (it's already fading from view as I type this), below are the steps involved in publishing your own CLI to Homebrew. The first formula I published is a simple Ruby script, but this guide should be generally applicable. Because Homebrew really fucking leans in to the whole "home brewing as in beer" motif when it comes to naming, it's easy to get lost in the not-particularly-apt nomenclature they chose. Translate these in your head when you encounter them: Formula → Package definition Tap → Git repository of formulae Cask → Manifest for installing pre-built GUIs or large binaries Bottle → Pre-built binary packages that are "poured" (copied) instead of built from source Cellar → Directory containing your installed formulae (e.g. /opt/homebrew/Cellar) Keg → Directory housing an installed formula (e.g. Cellar/foo/1.2.3) First thing to know is that the Homebrew team doesn't want your stupid CLI in the core repository. Instead, the golden path for us non-famous people is to: Make your CLI, push it to GitHub, cut a tagged release Create a Homebrew tap Create a Homebrew formula Update the formula for each CLI release After you complete the steps outlined below, users will be able to install your cool CLI in just ...
First seen: 2025-09-10 17:10
Last seen: 2025-09-10 20:11