goreleaser: bundle shell completions in release archives - #479
Merged
Conversation
Writes the completion script to a file instead of stdout, creating any missing parent directories. Mirrors the pattern from circleci-cli. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add before hooks to generate bash and zsh completion scripts into share/ during the release build using the new --output flag. Archives include the scripts at the standard UNIX paths: share/bash-completion/completions/chunk share/zsh/site-functions/_chunk The Homebrew formula installs these to the standard completion directories so completions work out of the box for Homebrew users without any runtime subprocess on shell startup. share/ is gitignored as a generated artifact. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
michael-webster
force-pushed
the
goreleaser-completions
branch
from
August 6, 2026 17:36
89106f2 to
57f22da
Compare
michael-webster
marked this pull request as ready for review
August 6, 2026 17:41
pete-woods
approved these changes
Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
beforehooks to generate bash and zsh completion scripts at release timeshare/bash-completion/completions/chunk,share/zsh/site-functions/_chunk)--output/-oflag tochunk completion bashandchunk completion zshso the hooks don't need shell redirection ormkdir -pwrappers (mirrors circleci-cli)share/to.gitignore(generated artifact)completion installis unchanged and continues to work as a fallback for manual curl installsMotivation
chunk completion installwas writingsource <(chunk completion zsh)to.zshrc, which spawns achunksubprocess on every new shell session. This was generating ~400 telemetry events per day from shell startups rather than intentional user invocations.For Homebrew users (the majority), completions now land in the right system directories during installation with no runtime cost. The
completion installfallback is preserved for users who install via curl.Reproduction steps
Test plan
brew install chunk-cli && chunk <TAB>completes without spawning a subprocess🤖 Generated with Claude Code