Ship small, reviewable PR stacks quickly without giving up safety.
stax installs both binaries: stax and the short alias st. This README uses st.
- Live docs: cesarferreira.github.io/stax
- Docs index in this repo: docs/index.md
Why stax
- Replace one giant PR with a clean stack of small, focused PRs
- Keep shipping while lower-stack PRs are still in review
- Navigate the full stack and diffs from an interactive TUI
- Restack/merge with transactional safety and fast recovery (
st undo,st redo) - Run stack-aware merge/cascade workflows with CI/readiness checks
- Generate PR bodies and standup summaries with your preferred AI agent
- Work across multiple worktrees, including parallel AI-agent workflows
Install
# Homebrew (macOS/Linux)
# Or cargo-binstall
Verify install:
60-Second Quick Start
Set up GitHub auth first (required for PR creation, CI checks, and review metadata).
# Option A (recommended): import GitHub CLI auth
# Option B: enter token interactively
# Option C: env var
By default, stax does not use ambient GITHUB_TOKEN unless you opt in with auth.allow_github_token_env = true.
# 1. Create stacked branches
# 2. Inspect stack
# ◉ auth-ui 1↑
# ○ auth-api 1↑
# ○ main
# 3. Submit PRs for whole stack
# 4. Sync trunk and restack after merges
Result: two stacked branches, submitted as two linked PRs, then kept up to date with one sync/restack command.
Next steps:
Core Commands
| Command | What it does |
|---|---|
st |
Launch interactive TUI |
st ls |
Show stack with PR/rebase status |
st ll |
Show stack with PR URLs and details |
st create <name> |
Create a branch stacked on current |
st ss |
Submit full stack and create/update PRs |
st merge |
Merge PRs from stack bottom to current |
st merge --when-ready |
Wait/poll until mergeable, then merge |
st rs |
Sync trunk and clean merged branches |
st rs --restack |
Sync trunk and restack full stack |
st cascade |
Restack, push, and create/update PRs |
st undo / st redo |
Recover or re-apply risky operations |
st standup |
Summarize recent engineering activity |
st generate --pr-body |
Generate PR body with AI |
st run <cmd> (alias: st test <cmd>) |
Run a command on each branch in stack |
For complete command and flag reference: docs/commands/core.md and docs/commands/reference.md.
Key Capabilities
Cascade Stack Merge
Merge from stack bottom up to your current branch with safety checks for CI/readiness.
# Merge from bottom -> current branch
# Wait for readiness explicitly before merging
# Merge full stack regardless of current position
Read more: docs/workflows/merge-and-cascade.md
Safe History Rewriting (Undo/Redo)
stax snapshots branch state before destructive operations (restack, submit, reorder) so recovery is immediate when something goes wrong.
Read more: docs/safety/undo-redo.md
Interactive TUI
Launch with no arguments to browse stacks, inspect diffs, and run common operations without leaving the terminal.
Read more: docs/interface/tui.md
Developer Worktrees
Work on multiple stacks in parallel without losing context. st worktree (alias st wt) creates and manages Git worktrees for your existing branches, with shell integration for transparent cd.
# One-time shell integration setup
# Create a worktree for an existing branch
# List all worktrees (* = current)
# Jump to a worktree (transparent cd via shell function)
# or the quick alias:
# Remove when done
Shortcuts: st w (list), st wtc [branch] (create), st wtgo <name> (go), st wtrm <name> (remove).
Read more: docs/workflows/multi-worktree.md
Agent Worktrees
Run multiple AI agents in isolated Git worktrees while preserving stack metadata and restack flows. st agent is title-based and includes editor integration and a registry.
# Create isolated worktrees for parallel tasks
# Keep all agent branches rebased when trunk moves
# View and clean up
Read more: docs/workflows/agent-worktrees.md
AI PR Body + Standup Summary
Use your configured AI agent to draft PR bodies and generate daily standup summaries.
# Generate/update PR body from branch diff + context
# Spoken-style standup summary
Read more: docs/integrations/pr-templates-and-ai.md and docs/workflows/reporting.md
Docs Map
If you want to...
- Install and configure quickly: docs/getting-started/install.md
- Learn stacked branch concepts: docs/concepts/stacked-branches.md
- Use day-to-day commands: docs/commands/core.md
- Explore full command/flag reference: docs/commands/reference.md
- Navigate branches efficiently: docs/commands/navigation.md
- Merge, cascade, and keep stacks healthy: docs/workflows/merge-and-cascade.md
- Work across multiple worktrees: docs/workflows/multi-worktree.md
- Use developer worktrees (
st worktree): docs/workflows/multi-worktree.md#stax-worktree - Use agent worktrees end-to-end: docs/workflows/agent-worktrees.md
- Configure auth/branch naming/remote behavior: docs/configuration/index.md
- Validate and repair metadata health: docs/commands/stack-health.md
Integrations
AI/editor integration guides:
- Claude Code: docs/integrations/claude-code.md
- Codex: docs/integrations/codex.md
- Gemini CLI: docs/integrations/gemini-cli.md
- OpenCode: docs/integrations/opencode.md
- PR templates + AI generation: docs/integrations/pr-templates-and-ai.md
Shared skill/instruction file used across agents: skills.md
Performance & Compatibility
st lsis benchmarked against alternative stacked-branch CLIs and is typically much faster in this repo's benchmark setup.- stax is freephite/graphite compatible for common stacked-branch workflows.
Details:
- Benchmarks: docs/reference/benchmarks.md
- Compatibility: docs/compatibility/freephite-graphite.md
Configuration
Config file location:
~/.config/stax/config.toml
Common settings include branch naming format, auth source preferences, and enterprise GitHub API host overrides.
Read full config reference: docs/configuration/index.md
Contributing & License
- License: MIT
- Before opening a PR, run the repo test command policy from AGENTS.md:
# or
For project docs and architecture, start at docs/index.md.