Skip to content

Generate Homebrew cask completions at install time#1085

Merged
gtrrz-victor merged 1 commit intomainfrom
add-latest-goreleaser-completion-feature
Apr 30, 2026
Merged

Generate Homebrew cask completions at install time#1085
gtrrz-victor merged 1 commit intomainfrom
add-latest-goreleaser-completion-feature

Conversation

@gtrrz-victor
Copy link
Copy Markdown
Contributor

@gtrrz-victor gtrrz-victor commented Apr 30, 2026

https://entire.io/gh/entireio/cli/trails/271

Summary

  • Switch both homebrew_casks (entire, entire@nightly) from a static completions: block to goreleaser v2.15+ generate_completions_from_executable. Brew now runs the installed binary at cask install time to emit bash / zsh / fish completions, so completions can never drift from the binary they ship next to.
  • shell_parameter_format: cobra is sufficient — Homebrew's cask DSL already appends completion <shell>. (Initial draft also passed args: [completion] which produced doubled entire completion completion bash and was killed by Gatekeeper before the cask install error surfaced.)
  • Build-time generation kept untouched: the before: hook still runs mise run completions, and archives.files: completions/* still bundles the files for tarball and Scoop users (the new field is homebrew-cask-only).

Test plan

  • goreleaser check passes against the new config.
  • goreleaser release --snapshot --clean --skip=publish,announce,sign,notarize produces a cask containing generate_completions_from_executable "entire", shell_parameter_format: :cobra, shells: [:bash, :zsh, :fish].
  • Local-tap install (brew tap-new local/entire-test → copy snapshot cask → HOMEBREW_CASK_OPTS=--no-quarantine brew install --cask local/entire-test/entire) installs cleanly with no completion-generation warnings.
  • Files land in /opt/homebrew/etc/bash_completion.d/entire (16 KB), /opt/homebrew/share/zsh/site-functions/_entire (7.7 KB), /opt/homebrew/share/fish/vendor_completions.d/entire.fish (9.6 KB); zsh file starts with #compdef entire / compdef _entire entire (real cobra output).
  • CI uses goreleaser-pro action with version: latest — already ≥ v2.15, no version pin bump needed.

Notes

  • --no-quarantine was only needed to bypass Gatekeeper on the unsigned snapshot binary during local validation. Production releases go through the existing notarize: block, so end users will not need any flag.

🤖 Generated with Claude Code


Note

Medium Risk
Medium risk because it changes Homebrew cask packaging behavior by generating shell completions at install time, which could break installs if the CLI’s completion command or Cobra parameters change.

Overview
Switches both Homebrew casks (entire and entire@nightly) from shipping static completion files to using GoReleaser’s generate_completions_from_executable so Homebrew generates bash/zsh/fish completions from the installed entire binary at install time.

This aligns completions with the exact binary being installed and removes the per-shell completions: file references from the cask config.

Reviewed by Cursor Bugbot for commit b11faa5. Configure here.

Use goreleaser v2.15+ generate_completions_from_executable so brew runs
the installed binary to emit shell completions, eliminating drift between
cask and binary. Archive-bundled completions kept for tarball/Scoop users.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 9118215b7597
Copilot AI review requested due to automatic review settings April 30, 2026 13:02
@gtrrz-victor gtrrz-victor requested a review from a team as a code owner April 30, 2026 13:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the GoReleaser configuration so Homebrew casks generate shell completions from the installed entire executable at install time, preventing shipped cask completions from drifting from the binary.

Changes:

  • Replaces the static completions: mapping for both entire and entire@nightly casks with generate_completions_from_executable.
  • Configures Homebrew completion generation to use Cobra’s completion argument format and emit bash, zsh, and fish completions.

Copy link
Copy Markdown
Contributor

@toothbrush toothbrush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@gtrrz-victor gtrrz-victor merged commit 25cc008 into main Apr 30, 2026
14 checks passed
@gtrrz-victor gtrrz-victor deleted the add-latest-goreleaser-completion-feature branch April 30, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants