commands help text#88
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves CLI discoverability by adding Long descriptions and Example blocks to every gh stack command, organizes the root help into command groups via cobra.Group, appends a "Learn more" footer with docs/feedback links to the root help output, adds contextual next-step hints after push and checkout, and updates the CLI reference docs (re-orders the unstack and switch sections).
Changes:
- Add
Long/Exampleblocks across all command files and group commands incmd/root.gowith a customHelpFuncthat prints a "Learn more" footer. - Add post-command hints (
push→ "view your stack of PRs",checkout→ "see the full stack"). - Re-order the CLI reference docs to match the new help groupings, and add a
TestRootCmd_HelpOutputtest.
Show a summary per file
| File | Description |
|---|---|
| cmd/root.go | Rewrite root Long/Example, add command groups, register subcommands with GroupIDs, add Learn-more help footer. |
| cmd/root_test.go | Add help output test verifying group titles and footer links. |
| cmd/add.go | Add Example block. |
| cmd/alias.go | Add Example block. |
| cmd/checkout.go | Add Example block and post-checkout hint pointing to gh stack view. |
| cmd/feedback.go | Add Example block. |
| cmd/link.go | Add Example block. |
| cmd/modify.go | Add Example block; reformat indentation of an existing Printf. |
| cmd/navigate.go | Add Long/Example for up/down/top/bottom. |
| cmd/push.go | Add Long/Example and post-push hint when all branches have PRs. |
| cmd/rebase.go | Add Example block covering downstack/upstack/continue/abort. |
| cmd/submit.go | Add Long/Example. |
| cmd/switch.go | Reformat Long and add Example. |
| cmd/unstack.go | Add Example block. |
| cmd/view.go | Add Long/Example (contains "JSO" typo). |
| docs/src/content/docs/reference/cli.md | Move unstack under Stack Operations and switch under Navigation to match grouping. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 16/16 changed files
- Comments generated: 1
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
ktravers
left a comment
There was a problem hiding this comment.
Incredibly helpful, thanks for adding all of this ✨ 🚀
I also didn't realize all of the functionality we'd packed into the gh-stack CLI -- lotta great stuff in here I'm going to start using!
Co-authored-by: Sameen Karim <[email protected]>
Improve CLI help text and command discoverability
Add
Longdescriptions andExampleblocks to every command, group commands into categories in root help, and add a "Learn More" footer with docs/feedback links.Changes
cmd/root.go): RewriteLongdescription to explain stacked PRs, add 4-step workflowExample, organize commands into groups (Core, Stack Management, Navigation, Other) usingcobra.Group, add "Learn More" footer linking to docs and feedbackExampleblocks with commented, real-world usage andLongdescriptions where missing (push,view,submit,switch,unstack, navigation commands,alias,feedback)add,push,submit, andcheckoutStack created with GitHub Stacks CLI • Give Feedback 💬