gh-stack is a GitHub CLI extension for managing stacked branches and pull requests. Learn more about GitHub Stacked PRs here.
View the Quick Start guide to get started.
Install the extension with:
gh extension install github/gh-stackOr upgrade to the latest version with:
gh extension upgrade stackWhat's new in v0.1.1
Added
- Vim-style
j/knavigation: The interactiveview,checkout, andswitchpickers now acceptj/kto move down and up, alongside the existing arrow keys (themodifyandmergeTUIs already supported them). Navigation hints now read↓↑/jk.submitis intentionally left on arrow keys, since its auto-focused text fields need literaljandkinput. gh stack checkoutfinds stacks on GitHub: Runningcheckoutwith no argument now detects when your current branch isn't part of a local stack but belongs to an active stack on GitHub, and offers to check that stack out. Andgh stack checkout <branch>now resolves a branch name against active remote stacks when it isn't tracked locally, importing the match through the existing PR checkout flow. Both are best-effort — network failures, no or multiple matches, or a declined prompt fall through to the existing behavior, and fully merged stacks are ignored.gh stack addcan initialize a stack: Runningaddfrom a branch that isn't part of a stack now offers to initialize a new stack — using your explicit or auto-generated branch name as the first layer — instead of failing.initalso now restores a missing local trunk from the selected remote before creating branches, covering repositories where the default branch was renamed locally.
Changed
- Leaner agent skill: The bundled
gh-stackagent skill is restructured into a concise core plus references that load only when needed, cuttingSKILL.mdfrom ~891 lines / ~10.8K tokens to ~183 lines / ~2.1K tokens (an 81% reduction) and correcting stale guidance. In evaluations across two models it passed every tested workflow while using fewer tool calls and ~34% fewer input tokens than the previous skill. - Taller
gh stack checkoutpicker: The stack picker now expands to use the available terminal height when more than 10 stacks are available, instead of always capping the list at 10 rows, while staying compact for smaller result sets. $EDITORfallback in the submit TUI: When no editor is configured, the submit TUI's external description editor now falls back tovi(when available onPATH); configured editors keep their existing precedence.
Fixed
- PR links were unusable without OSC 8 hyperlink support: On terminals that don't support OSC 8 hyperlinks (tmux, screen, Apple Terminal, Konsole, non-TTY output, and unknown terminals),
gh stack view --shortand other non-TUI status output now print the full PR URL as#N (URL)instead of an unclickable reference. SetGH_STACK_HYPERLINKS=1to force hyperlinks orGH_STACK_HYPERLINKS=0to force full URLs. TUI and JSON output are unchanged.
Changelog
- Remove private preview mentions from docs by @skarim in #368
- Improve skill efficiency and performance by @skarim in #388
- Bump js-yaml from 4.3.0 to 4.3.1 in /docs in the npm_and_yarn group across 1 directory by @dependabot[bot] in #432
- navigate down/up with j/k by @skarim in #468
- submit: fall back to vi when no editor is configured by @skarim in #484
- checkout: dynamic height for picker by @skarim in #469
- checkout: detect remote stack from current branch by @skarim in #475
- checkout: resolve remote stack by branch name by @skarim in #477
- add: offer to initialize a stack automatically by @skarim in #486
- Print full PR URLs when OSC 8 hyperlinks are unsupported by @skarim in #479
Full Diff: v0.1.0...v0.1.1