Ship stacked PRs without the friction
A local-first CLI for tree-shaped stacked branches. Create dependent layers, restack safely, submit entire stacks, and drive it all from your shell, IDE, or an MCP-aware agent.
brew tap wiseiodev/dubstack
brew install dubstackBuilt for the stacked PR workflow
Everything you need to manage dependent branches, from creation to merge.
Tree-Shaped Stacks
Split work into focused layers — linear or branching. DubStack tracks the full stack tree and renders the current path in your terminal.
Safe Restack & Merge
Restack propagates parent changes upstack. merge-next picks the next safe PR, post-merge cleans up retargets, and undo/redo is multi-level.
AI Across The Flow
Pluggable providers (Anthropic, Gemini, OpenAI, Bedrock, Ollama, AI Gateway) generate branch names, commit bodies, PR descriptions, and resolve restack conflicts.
Agents & MCP
Every read command emits JSON with schemaVersion: 1. The built-in MCP server exposes stack tools to Claude Code, Cursor, and any MCP-aware agent with a per-repo security model.
Shell & IDE Integration
dub status drives prompts. dub completion + dub man emit shell completions and a man page from live commander metadata. Theming follows your terminal.
Graphite-Compatible
If you have gt muscle memory, DubStack maps 1:1. Local-first state under .git/dubstack, optional SQLite backend for large stacks, and a GitHub Action that retargets stacks after merges.
From zero to stacked PRs
Create a three-layer stack, view it, and submit all PRs in just a few commands.
# Start from trunk
git checkout main && git pull
# Create stacked branches
dub create feat/auth-types -am "feat: add auth types"
dub create feat/auth-login -am "feat: add login flow"
dub create feat/auth-tests -am "test: add auth tests"
# View your stack
dub log
# Submit all PRs
dub ss