feat(cmd): add explicit completion subcommand for bash/zsh/fish/powershell (#54)#78
Merged
Merged
Conversation
…ershell (LastStep#54) Closes LastStep#54. Adds cmd/completion.go with an explicit `bonsai completion [bash|zsh|fish|powershell]` subcommand. The Long help names the install snippets per shell so users can copy-paste without leaving the terminal. Switch root.go from CompletionOptions.HiddenDefaultCmd to DisableDefaultCmd so the auto-generated completion command does not register at all -- otherwise AddCommand("completion") in completion.go would conflict with it. README "Install" gets a "Shell completion" subsection mirroring the per-shell install snippets. Verified: - `make build` clean (`go build ./...` + `go vet ./...`) - `go test ./cmd/...` 21 passed - `./bonsai completion bash | head` prints a valid completion script - `./bonsai --help` lists `completion` between `catalog` and `guide` Out of scope per the issue: completion handlers for `bonsai add <skill>` ability-name arguments — that needs a follow-up issue.
Owner
|
Thanks for the contribution @mvanhorn — first external PR to Bonsai 🎉 Merging. Reasoning:
Polish items deferred to follow-up issues (none blocking):
Welcome to the project. 🌱 |
LastStep
added a commit
that referenced
this pull request
May 7, 2026
… Backlog - cmd/completion.go: fix stale `init()` comment — references the `CompletionOptions.DisableDefaultCmd = true` line in root.go rather than the prior `HiddenDefaultCmd` wording. - Status.md: record first external contribution merge (PR #78, @mvanhorn, `bonsai completion` for #54). - Backlog.md: add ability-name argument completion follow-up under Group C (OSS Readiness), linking to #54 hint. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 tasks
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.
Closes #54.
Adds `cmd/completion.go` with an explicit `bonsai completion [bash|zsh|fish|powershell]` subcommand. The `Long` help names the install snippets per shell so users can copy-paste without leaving the terminal.
Switched `root.go` from `CompletionOptions.HiddenDefaultCmd` to `DisableDefaultCmd` so the auto-generated completion command does not register at all — otherwise `AddCommand("completion")` in `completion.go` would conflict with it. README "Install" gains a "Shell completion" subsection mirroring the per-shell install snippets.
Out of scope per the issue: completion handlers for `bonsai add ` ability-name arguments — that needs a follow-up issue.
Verified