Repository navigation
fix(shortcuts): seed scm.yaml subcommands with their own gh command - #1329
Merged
Merged
Conversation
resolveCommandConfig appends a subcommand's name to the parent args when the subcommand declares no command of its own, so the seeded /scm shortcuts ran invalid commands like 'gh issues issue list'. Give each subcommand command: gh with the full args, the pattern the seeded /git commit subcommand already uses, and align the SCM customization example in the shortcuts guide.
This was referenced Sep 25, 2026
edenreich
marked this pull request as ready for review
September 25, 2026 22:41
Contributor
|
🎉 This PR is included in version 0.208.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Resolves #1328
Summary
The
scm.yamlseeded byinfer initrelied onCustomShortcut.resolveCommandConfigappending a subcommand's ownname:before itsargs:when the subcommand declares nocommand:of its own. Since the invoked names (issues,issue) do not match gh's real subcommands (issue list,issue view), both/scmshortcuts resolved to invalid commands (gh issues issue list ...,gh issue issue view ...) and failed at runtime. This gives each subcommand its owncommand: ghwith the full args - the same pattern the seeded/git commitsubcommand already uses - so the args resolve verbatim.Changes
cmd/init/init.go: the seededissuesandissuesubcommands now declarecommand: ghwith the full gh args, so/scm issuesrunsgh issue list --json ... --limit 20and/scm issue <number>runsgh issue view <number> --json ...cmd/init/init_test.go: addedTestSCMShortcutsSpellFullGHCommandspinning the seeded file against the regression (each subcommand declares its ownghcommand and starts with the real gh subcommand)docs/shortcuts-guide.md: the SCM Shortcuts customization example now mirrors the fixed seeded fileChecked the sibling seeded files (
git.yaml,mcp.yaml,reset.yaml,insights.yaml): they use the name-append pattern correctly (invoked name == real CLI subcommand) and are covered byTestVendoredShortcutsDelegateToCommands, so no change needed there.Docs follow-up ticket for the standalone docs site: to be linked once filed (this PR already fixes the in-repo
docs/shortcuts-guide.mdexample).Verification
go test ./cmd/init/...passestask precommit:run(mod tidy, fmt, lint:imports, golangci-lint, markdownlint) passes