Skip to main content

Stack CLI - Stacked diffs for Git

Project description

stkd-cli

PyPI License

Stack CLI distributed via PyPI — Install the gt binary for managing stacked pull requests on GitHub and GitLab.

Stack is an open-source, Graphite-compatible CLI that breaks large changes into small, reviewable PRs that stay in sync automatically. This Python package downloads the correct prebuilt binary for your platform (macOS, Linux) and installs it as the gt command.


What is Stack?

Large pull requests 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.

Why Stacked Diffs?

Traditional PRs Stacked Diffs
One large PR with many changes Multiple small, focused PRs
Reviewers overwhelmed Easy to review incrementally
All-or-nothing merging Land changes as they're approved
Blocked waiting for review Unblock yourself, keep coding

Features

  • Auto-restack — Edit any branch, all dependents rebase automatically
  • GitHub + GitLab — Full support for both platforms, including self-hosted GitLab
  • Stack-aware submit — One command creates PRs for your entire stack
  • Interactive TUI — Keyboard-driven terminal UI for browsing stacks
  • MCP Server — AI agent integration via Model Context Protocol
  • Undo/redo — Recover from mistakes with gt undo
  • Graphite compatible — Drop-in replacement for gt commands

Installation

pip install stkd-cli

With uv

uv pip install stkd-cli

In a virtual environment

python -m venv .venv
source .venv/bin/activate
pip install stkd-cli

Quick Start

# Initialize in your repository
gt init

# Authenticate with GitHub or GitLab
gt auth --github

# Create a stack
gt create feature/step-1
gt create feature/step-2
gt create feature/step-3

# Submit all as PRs
gt submit --stack

Platform Support

  • macOS (Intel & Apple Silicon)
  • Linux (x86_64 & aarch64)

If a prebuilt binary is not available for your platform, the installer falls back to building from source with cargo.

Python API

from stkd_cli import run, run_json

# Run a command
result = run(["log", "--json"])
print(result.stdout)

# Run and parse JSON
stack = run_json(["log"])
print(stack)

Documentation

Full documentation at docs.neullabs.com/stkd.

License

Apache-2.0. See LICENSE for details.

Built by Neul Labs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stkd_cli-0.1.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stkd_cli-0.1.0-py3-none-any.whl (3.2 MB view details)

Uploaded Python 3

File details

Details for the file stkd_cli-0.1.0.tar.gz.

File metadata

  • Download URL: stkd_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for stkd_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 223fe14b32cdc5b504e93f02dbfb9892f6612f1a4b708449330cee23c19ff6ed
MD5 9a571c97f0ca3239143441ea9c642983
BLAKE2b-256 388876fd899976d631c575f694a3bec70fb0166602a3cad434685f90b15adf14

See more details on using hashes here.

File details

Details for the file stkd_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: stkd_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for stkd_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 74d4bdc5d0e700a97d11778afe3326fc110f2331a1accac845687c04f9a7933d
MD5 c82b5860098792cb33d0c51eb2a50105
BLAKE2b-256 25c8126f3292603884cee68b065785967dc1a8f9b8bfcae5ed6ed7459035fc03

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page