Stack CLI

July 2, 2026 · View on GitHub

CI Crates.io npm PyPI docs.rs License Docs

Stacked diffs. Simplified. An open-source, Graphite-compatible CLI for managing stacked pull requests on GitHub and GitLab. Break large changes into small, reviewable PRs that stay in sync automatically. Self-hosted. Multi-platform. AI-ready.

Website · Documentation · GitHub

Why Stacked Diffs?

Large PRs are hard to review. Stacked diffs let you split work into a chain of dependent branches, each with its own focused PR:

main
 └── feature/auth-base      PR #1: Core authentication
      └── feature/auth-oauth    PR #2: OAuth support (depends on #1)
           └── feature/auth-2fa     PR #3: 2FA (depends on #2)

When you update a branch, Stack automatically rebases all dependent branches. When PRs merge, the stack collapses cleanly.

Installation

# macOS / Linux (Homebrew)
brew install neul-labs/tap/stkd

# Or install from crates.io
cargo install stkd-cli

# Or via npm
npm install -g stkd-cli

# Or via pip
pip install stkd-cli

# Or quick install (downloads binary or builds from source)
curl -fsSL https://raw.githubusercontent.com/neul-labs/stkd/main/install.sh | bash

# Or build from source
cargo install --path crates/stkd-cli

The binary is named gt for Graphite compatibility.

Quick Start

# Initialize in your repository
gt init

# Authenticate with GitHub or GitLab
gt auth --github

# Create a stack of branches
gt create feature/step-1    # First branch on main
# ... make changes, commit ...

gt create feature/step-2    # Stacks on step-1
# ... make changes, commit ...

gt create feature/step-3    # Stacks on step-2
# ... make changes, commit ...

# See your stack
gt log
# ○ feature/step-1
#   ○ feature/step-2
#     ◉ feature/step-3  ← you are here

# Or explore interactively
gt tui

# Submit all as PRs
gt submit --stack

Core Workflow

CommandDescription
gt create <name>Create a branch stacked on current
gt logVisualize the stack
gt up / gt downNavigate between branches
gt restackRebase all dependent branches
gt submit --stackCreate/update PRs for the stack
gt syncFetch, restack, clean merged branches
gt land --stackMerge the stack in order
gt tuiInteractive terminal UI
gt modifyEdit a branch's commits interactively

Key Features

  • Auto-restack: Edit any branch, all dependents rebase automatically
  • GitHub + GitLab: Full support for both platforms
  • PR automation: Reviewers, labels, templates, draft PRs
  • Stack-aware submit: One command creates PRs for your entire stack
  • Interactive TUI: Keyboard-driven terminal UI for browsing stacks and status
  • MCP Server: AI agent integration via Model Context Protocol
  • Web Dashboard: Self-hosted visualization and management UI
  • Conflict handling: gt continue / gt abort for rebase conflicts
  • Undo/redo: Recover from mistakes with gt undo

Try the Demo

See Stack in action with an interactive demo:

./demo.sh

Documentation

Full documentation at docs.neullabs.com/stkd:

Architecture

crates/
├── stkd-cli          # CLI binary (gt)
├── stkd-core         # Core library (Repository, Stack, DAG)
├── stkd-engine       # Programmatic engine for multi-agent harnesses
├── stkd-mcp          # MCP server for AI agent integration
├── stkd-provider-api # Provider trait definitions
├── stkd-github       # GitHub implementation
├── stkd-gitlab       # GitLab implementation
├── stkd-db           # Database layer (SQLite/PostgreSQL)
└── stkd-server       # Web dashboard API

Comparison with Graphite

FeatureGraphiteStack
Open sourceNoYes
Self-hostedNoYes
GitHubYesYes
GitLabNoYes
CLI compatiblegtgt

Contributing

git clone https://github.com/neul-labs/stkd
cd stkd
cargo build
cargo test

See CONTRIBUTING.md for guidelines.

Part of the Neul Labs toolchain

Explore the rest of the Neul Labs developer tools:

ProjectDescription
rjestA blazing-fast, Jest-compatible test runner — 100x faster warm runs.
rpytestRun your pytest suite faster. Change nothing.
rninjaDrop-in Ninja replacement with built-in caching.
gityMake large Git repositories feel instant.
griteThe issue tracker that lives in your repo. Built for AI agents.

Learn more at neullabs.com.

License

Apache-2.0 - See LICENSE for details.


Built by Neul Labs