This guide explains how to set up the Homebrew tap for aicommit to enable brew install functionality.
- Create a GitHub Personal Access Token with
repopermissions - Add the token as a GitHub Actions secret named
HOMEBREW_TAP_TOKEN
- Create a new GitHub repository:
homebrew-aicommit - Initialize it with a README
Create Formula/aicommit.rb in the homebrew-aicommit repository:
class Aicommit < Formula
desc "AI-powered conventional commit message generator"
homepage "https://github.com/ApertaCodex/aicommit"
url "https://github.com/ApertaCodex/aicommit/archive/v1.0.0.tar.gz"
sha256 "PLACEHOLDER_SHA256"
license "MIT"
depends_on "jq"
depends_on "curl"
depends_on "git"
def install
bin.install "aicommit"
bin.install_symlink "aicommit" => "git-aicommit"
end
test do
system "#{bin}/aicommit", "--help"
end
endNote: The url and sha256 will be automatically updated by the update-homebrew.sh script during releases.
Add this job to .github/workflows/release.yml:
homebrew:
name: Update Homebrew Formula
needs: [build, github-release]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Update Homebrew tap
env:
GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
run: |
chmod +x scripts/update-homebrew.sh
git config --global url."https://x-access-token:${GH_TOKEN}@github.com/".insteadOf "https://github.com/"
./scripts/update-homebrew.sh ${{ needs.build.outputs.version }}- Go to your aicommit repository settings
- Navigate to Secrets and Variables → Actions
- Add a new secret:
- Name:
HOMEBREW_TAP_TOKEN - Value: Your GitHub Personal Access Token with
repopermissions
- Name:
After your first release with the Homebrew tap configured:
# Add the tap
brew tap apertacodex/aicommit
# Install aicommit
brew install aicommit
# Verify installation
aicommit --help
git aicommit --helpThe formula is automatically updated on each release by the update-homebrew.sh script, which:
- Downloads the release tarball
- Calculates its SHA256 checksum
- Updates the formula file with the new URL and checksum
- Commits and pushes the changes to the tap repository
Run brew audit --strict --online apertacodex/aicommit/aicommit to check for issues.
- Check that all dependencies (jq, curl, git) are available
- Verify the tarball URL is accessible
- Ensure the SHA256 checksum matches
Ensure the HOMEBREW_TAP_TOKEN has:
reposcope (full repository access)- Access to the
homebrew-aicommitrepository