Add Homebrew tap distribution for ShellTime CLI#271
Conversation
Add brews section to .goreleaser.yaml to auto-publish the Homebrew formula to shelltime/homebrew-tap on each release. Pass HOMEBREW_TAP_GITHUB_TOKEN in the release workflow. https://claude.ai/code/session_01TwCfzkqy4jkzx6UaZjHdp6
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request adds a Homebrew formula configuration to .goreleaser.yaml to automate the distribution of the ShellTime CLI and daemon. A critical issue was identified regarding the installation caveats: the current CLI logic for installing the daemon expects a specific local path that conflicts with Homebrew's standard installation locations, which will cause the recommended setup commands to fail for Homebrew users.
| caveats: | | ||
| To get started with ShellTime, run: | ||
| shelltime init | ||
|
|
||
| Or set up manually: | ||
| shelltime auth | ||
| shelltime hooks install | ||
| shelltime daemon install | ||
|
|
||
| For more info, visit https://shelltime.xyz |
There was a problem hiding this comment.
The shelltime init and shelltime daemon install commands mentioned in the caveats will fail for users who install via Homebrew.
The current implementation of commandDaemonInstall in commands/daemon.install.go (lines 54-58) explicitly checks for the daemon binary at ~/.shelltime/bin/shelltime-daemon. However, Homebrew installs binaries to the system PATH (e.g., /usr/local/bin or /opt/homebrew/bin).
When a Homebrew user runs these commands, they will receive an error message directing them to use the curl installation script, which defeats the purpose of the Homebrew distribution. You should update the CLI logic to look for shelltime-daemon in the system PATH as a fallback before checking the local directory.
| brews: | ||
| - name: shelltime | ||
| ids: | ||
| - mt-common | ||
| - mac | ||
| repository: | ||
| owner: shelltime | ||
| name: homebrew-tap | ||
| token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}" | ||
| directory: Formula | ||
| homepage: "https://shelltime.xyz" | ||
| description: "Track and analyze your shell usage - ShellTime CLI" | ||
| license: "MIT" | ||
| commit_author: | ||
| name: shelltime-bot | ||
| email: bot@shelltime.xyz | ||
| install: | | ||
| bin.install "shelltime" | ||
| bin.install "shelltime-daemon" | ||
| test: | | ||
| system "#{bin}/shelltime", "--version" | ||
| caveats: | | ||
| To get started with ShellTime, run: | ||
| shelltime init | ||
|
|
||
| Or set up manually: | ||
| shelltime auth | ||
| shelltime hooks install | ||
| shelltime daemon install | ||
|
|
||
| For more info, visit https://shelltime.xyz |
There was a problem hiding this comment.
🟡 README not updated with Homebrew install method, violating AGENTS.md documentation rule
AGENTS.md mandates: "When command behavior, setup flow, config formats, or integrations change, update the docs in the same change." This PR adds Homebrew tap as a new installation method via .goreleaser.yaml but does not update README.md to mention it. The README Install section (README.md:10-14) only shows the curl method. Users discovering the tap would have no documentation of brew install shelltime/tap/shelltime as an install option.
Prompt for agents
AGENTS.md requires that when the setup flow changes, README.md must be updated in the same change. This PR adds a Homebrew tap (shelltime/homebrew-tap) via the new brews section in .goreleaser.yaml, but the Install section in README.md (around lines 10-14) only documents the curl-based install. Add a Homebrew install option to README.md, e.g.:
## Install
brew install shelltime/tap/shelltime
Or via curl:
curl -sSL https://shelltime.xyz/i | bash
Adjust the exact tap/formula name to match the repository owner (shelltime) and formula name (shelltime) configured in .goreleaser.yaml lines 140-147.
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
This PR adds Homebrew tap distribution support to the ShellTime CLI release pipeline, enabling users to install ShellTime via Homebrew on macOS.
Key Changes
GoReleaser Configuration: Added Homebrew formula configuration to
.goreleaser.yamlthat:shelltime/homebrew-taprepositorymt-commonandmacbuild artifactsshelltimeandshelltime-daemonbinariesGitHub Actions: Updated
.github/workflows/release.yamlto pass theHOMEBREW_TAP_GITHUB_TOKENsecret to the release job, enabling automated formula updates to the Homebrew tap repositoryImplementation Details
Formuladirectory in theshelltime/homebrew-taprepositoryshelltime-botaccounthttps://claude.ai/code/session_01TwCfzkqy4jkzx6UaZjHdp6