Skip to content

Instantly share code, notes, and snippets.

@connorads
Created April 21, 2025 09:32
Show Gist options
  • Save connorads/10b9aa04bd4c1c963702dbe1da903239 to your computer and use it in GitHub Desktop.
Save connorads/10b9aa04bd4c1c963702dbe1da903239 to your computer and use it in GitHub Desktop.
Creating homebrew casks

Creating casks

Create a cask in your local casks folder and then just copy it over to a git fork to actually commit it to homebrew-casks repository.

Install zap helper

brew tap nrlquaker/createzap

Create cask

brew create --cask hello-world

Locate casks

cd "$(brew --repo homebrew/cask)"  
# e.g. /opt/homebrew/Library/Taps/homebrew/homebrew-cask

Edit cask

You can use Nano if you want or your own IDE or whatever.

brew edit --cask hello-world

Fix style

brew style --fix hello-world

Audit

brew audit --new --online --cask hello-world

Install and run app

HOMEBREW_NO_INSTALL_FROM_API=1 brew install --cask

Generate zap stanza

brew createzap hello-world

Uninstall

brew uninstall --cask --zap hello-world

Test the zap

When I check this last, even if you add the Zap stanza before uninstalling it's not actually going to use it so you have to repeat the steps to install it etc and uninstall it to test the zap up stanza has worked.

Add to homebrew-casks

Copy your file over to your local fork and then Create a branch and push and create a pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment