This document explains how to set up a Homebrew tap repository for the cursor-rules CLI tool.
-
Go to GitHub and create a new repository named
homebrew-tap
- The repository must be public
- The repository name must start with
homebrew-
- Initialize with a README
-
Clone the repository locally:
git clone https://github.com/fireharp/homebrew-tap.git cd homebrew-tap
-
Create a
Formula
directory:mkdir -p Formula
-
Commit and push the directory:
git add Formula git commit -m "Add Formula directory" git push
The GitHub token used by GoReleaser needs permissions to push to the tap repository:
- Go to GitHub -> Settings -> Developer settings -> Personal access tokens
- Create a new token with the
repo
scope - Save this token securely
In your release workflow, make sure the GitHub token has the right permissions:
permissions:
contents: write # For creating the release
packages: write # If you're using GitHub Packages
To create a new release that will automatically update the Homebrew formula:
git tag v0.1.0
git push origin v0.1.0
The GitHub Actions workflow will run GoReleaser, which will:
- Build the binaries
- Create a GitHub release
- Generate the Homebrew formula
- Push the formula to your homebrew-tap repository
Once the release is done, users can install cursor-rules with:
# Add the tap
brew tap fireharp/tap
# Install cursor-rules
brew install cursor-rules
# or
brew install fireharp/tap/cursor-rules
- If the formula doesn't get updated, check the GitHub Actions logs
- Verify that your GitHub token has the right permissions
- Make sure the repository names in the GoReleaser config match your GitHub username