st merge- Cascade-merge your stack from bottom -> current with CI/rebase-aware safety checks.st merge --when-ready- Merge in explicit wait-for-ready mode with configurable polling.st generate --pr-body- Generate polished PR descriptions with AI from your branch diff and context.AI skill integrations- Embedskills.mdinto Claude Code, Codex, Gemini CLI, or OpenCode so your AI can create and stack PRs.st standup- Get a quick summary of recent PRs, pushes, and activity for daily standups.st ss- Submit or update the full PR stack with correct parent/child base relationships.st rs --restack- Sync trunk and restack descendants so your branch tree stays clean and current.Interactive TUI- Browse your stack tree, PR status, diffs, and reorder branches visually.st undo/st redo- Recover safely from restacks and rebases with transactional history snapshots.st demo- Interactive tutorial that walks you through stacked branches in a temp repo (no auth needed).st test- Run a command on each branch in the stack to validate before submitting.
Instead of one massive PR with 50 files, stacked branches let you split work into small, reviewable pieces that build on each other (and visualize it as a tree).
Why this is great:
- Smaller reviews - Each PR is focused, so reviewers move faster and catch more issues
- Parallel progress - Keep building on top while lower PRs are still in review
- Safer shipping - Merge foundations first; reduce the risk of “one giant PR” landing at once
- Cleaner history - Each logical change lands independently (easier to understand, revert, and
git blame)
Example stack
◉ feature/auth-ui 1↑
○ feature/auth-api 1↑
○ main
Each branch is a focused PR. Reviewers see small diffs. You ship faster.
stax is a modern stacked-branch workflow that keeps PRs small, rebases safe, and the whole stack easy to reason about.
- Blazing fast - Native Rust binary (~22ms
st lson a 10-branch stack) - Terminal UX - Interactive TUI with tree view, PR status, diff viewer, and reorder mode
- Ship stacks, not mega-PRs - Submit/update a whole stack of PRs with correct bases in one command
- Safe history rewriting - Transactional restacks + automatic backups +
st undo/st redo - Merge the stack for you - Cascade merge bottom → current, with rebase/PR-base updates along the way
- Drop-in compatible - Uses freephite metadata format—existing stacks migrate instantly
# Homebrew (macOS/Linux)
brew install cesarferreira/tap/stax
# Or with cargo binstall
cargo binstall staxBoth st and stax are installed automatically. All examples below use st.
- Live docs: https://cesarferreira.github.io/stax/
- Source docs index: docs/index.md
Run docs locally with uv:
uv run --with-requirements docs/requirements.txt zensical serveSet up GitHub auth first (required for PR creation, CI checks, and review metadata):
# Option A (recommended): use GitHub CLI auth
gh auth login
st auth --from-gh
# Option B: enter a personal access token manually
st auth
# Option C: provide a stax-specific env var
export STAX_GITHUB_TOKEN="ghp_xxxx"By default, stax does not use ambient GITHUB_TOKEN unless you opt in via [auth].allow_github_token_env = true in config.
# 1. Create stacked branches
st create auth-api # First branch off main
st create auth-ui # Second branch, stacked on first
# 2. View your stack
st ls
# ◉ auth-ui 1↑ ← you are here
# ○ auth-api 1↑
# ○ main
# 3. Submit PRs for the whole stack
st ss
# Creating PR for auth-api... ✓ #12 (targets main)
# Creating PR for auth-ui... ✓ #13 (targets auth-api)
# 4. After reviews, sync and rebase
st rs --restack| Command | What it does |
|---|---|
st |
Launch interactive TUI |
st ls |
Show your stack with PR status and what needs rebasing |
st ll |
Show stack with PR URLs and full details |
st create <name> |
Create a new branch stacked on current |
st ss |
Submit stack - push all branches and create/update PRs |
st merge |
Merge PRs from bottom of stack up to current branch |
st merge --when-ready |
Merge with explicit wait-for-ready mode and configurable polling interval |
st rs |
Repo sync - pull trunk, clean up merged branches |
st rs --restack |
Sync and rebase all branches onto updated trunk |
st restack |
Restack current stack (ancestors + current + descendants) |
st restack --auto-stash-pop |
Restack even when target worktrees are dirty (auto-stash/pop) |
st rs --restack --auto-stash-pop |
Sync, restack, auto-stash/pop dirty worktrees |
st cascade |
Restack from bottom, push, and create/update PRs |
st cascade --no-pr |
Restack and push (skip PR creation/updates) |
st cascade --no-submit |
Restack only (no remote interaction) |
st cascade --auto-stash-pop |
Cascade even when target worktrees are dirty (auto-stash/pop) |
st co |
Interactive branch checkout with fuzzy search |
st u / st d |
Move up/down the stack |
st m |
Modify - stage all changes and amend current commit |
st pr |
Open current branch's PR in browser |
st open |
Open repository in browser |
st copy |
Copy branch name to clipboard |
st copy --pr |
Copy PR URL to clipboard |
st standup |
Show your recent activity for standups |
st changelog |
Generate changelog between two refs |
st undo |
Undo last operation (restack, submit, etc.) |
st abort |
Abort in-progress rebase/conflict resolution |
st detach |
Remove a branch from its stack (reparent children) |
st reorder |
Interactively reorder branches in a stack |
st validate |
Validate stack metadata health |
st fix |
Auto-repair broken metadata |
st test <cmd> |
Run a command on each branch in the stack |
st demo |
Interactive tutorial (no auth/repo needed) |
Run st create without arguments to launch the guided wizard:
$ st create
╭─ Create Stacked Branch ─────────────────────────────╮
│ Parent: feature/auth (current branch) │
╰─────────────────────────────────────────────────────╯
? Branch name: auth-validation
? What to include:
● Stage all changes (3 files modified)
○ Empty branch (no changes)
? Commit message (Enter to skip): Validate auth tokens
✓ Created cesar/auth-validation
→ Stacked on feature/authUse a one-liner when the branch name and commit message come from the same text:
st create -am "migrate checkout webhooks to v2"
# Creates a branch name from the message (using your branch format),
# stages all changes, and commits with the same message.Generate a PR description using AI, based on your diff, commit messages, and the repo's PR template:
st generate --pr-bodystax collects the diff, commit messages, and PR template for the current branch, sends them to an AI agent (Claude, Codex, Gemini CLI, or OpenCode), and updates the PR body on GitHub.
Prerequisites:
- Current branch must be tracked by stax
- Current branch must already have a PR (create one with
st submit/st ss)
You can also generate during submit:
st submit --ai-bodyIf no AI agent is configured, stax auto-detects what's installed and walks you through setup:
? Select AI agent:
> claude (default)
codex
gemini
opencode
? Select model for claude:
> claude-sonnet-4-5-20250929 — Sonnet 4.5 (default, balanced)
claude-haiku-4-5-20251001 — Haiku 4.5 (fastest, cheapest)
claude-opus-4-6 — Opus 4.6 (most capable)
? Save choices to config? (Y/n): Y
✓ Saved ai.agent = "claude", ai.model = "claude-sonnet-4-5-20250929"
--agent <name>: Override the configured agent for this invocation (claude,codex,gemini,opencode)--model <name>: Override the model (e.g.,claude-haiku-4-5-20251001,gpt-4.1-mini,gemini-2.5-flash)--edit: Open $EDITOR to review/tweak the generated body before updating the PR
st generate --pr-body --agent codex # Use codex this time
st generate --pr-body --model claude-haiku-4-5-20251001 # Use a specific model
st generate --pr-body --agent gemini --model gemini-2.5-flash
st generate --pr-body --agent opencode
st generate --pr-body --edit # Review in editor firstRun st with no arguments to launch the interactive terminal UI:
stTUI Features:
- Visual stack tree with PR status, sync indicators, and commit counts
- Full diff viewer for each branch
- Keyboard-driven: checkout, restack, submit PRs, create/rename/delete branches
- Reorder mode: Rearrange branches in your stack with
othenShift+↑/↓
| Key | Action |
|---|---|
j/k or ↑/↓ |
Navigate branches |
Enter |
Checkout branch |
r |
Restack selected branch |
R (Shift+r) |
Restack all branches in stack |
s |
Submit stack |
p |
Open selected branch PR |
o |
Enter reorder mode (reparent branches) |
n |
Create new branch |
e |
Rename current branch |
d |
Delete branch |
/ |
Search/filter branches |
Tab |
Toggle focus between stack and diff panes |
? |
Show all keybindings |
q/Esc |
Quit |
Rearrange branches within your stack without manually running reparent commands:
- Select a branch and press
oto enter reorder mode - Use
Shift+↑/↓to move the branch up or down in the stack - Preview shows which reparent operations will happen
- Press
Enterto apply changes and automatically restack
Split a branch with many commits into multiple stacked branches:
st splitHow it works:
- Run
st spliton a branch with multiple commits - Navigate commits with
j/kor arrows - Press
sto mark a split point and enter a branch name - Preview shows the resulting branch structure in real-time
- Press
Enterto execute - new branches are created with proper metadata
| Key | Action |
|---|---|
j/k or ↑/↓ |
Navigate commits |
s |
Mark split point at cursor (enter branch name) |
d |
Remove split point at cursor |
S-J/K |
Move split point down/up |
Enter |
Execute split |
? |
Show help |
q/Esc |
Cancel and quit |
Example: You have a branch with commits A→B→C→D→E. Mark splits after B ("part1") and D ("part2"):
Before: After:
main main
└─ my-feature (A-E) └─ part1 (A, B)
└─ part2 (C, D)
└─ my-feature (E)
Split uses the transaction system, so you can st undo if needed.
Struggling to remember what you worked on yesterday? Run st standup to get a quick summary of your recent activity:
Shows your merged PRs, opened PRs, recent pushes, and anything that needs attention - perfect for daily standups.
st standup # Last 24 hours (default)
st standup --hours 48 # Look back further
st standup --json # For scriptingGenerate a pretty changelog between two git refs - perfect for release notes or understanding what changed between versions:
st changelog v1.0.0 # From v1.0.0 to HEAD
st changelog v1.0.0 v2.0.0 # Between two tags
st changelog abc123 def456 # Between commitsExample output:
Changelog: v1.0.0 → HEAD (5 commits)
──────────────────────────────────────────────────
abc1234 #42 feat: implement user auth (@johndoe)
def5678 #38 fix: resolve cache issue (@janesmith)
ghi9012 chore: update deps (@bob)
Working in a monorepo? Filter commits to only those touching a specific folder:
st changelog v1.0.0 --path apps/frontend
st changelog v1.0.0 --path packages/shared-utilsThis shows only commits that modified files within that path - ideal for generating changelogs for individual packages or services.
For scripting or CI pipelines:
st changelog v1.0.0 --json{
"from": "v1.0.0",
"to": "HEAD",
"path": null,
"commit_count": 3,
"commits": [
{
"hash": "abc1234567890",
"short_hash": "abc1234",
"message": "feat: add feature (#42)",
"author": "johndoe",
"pr_number": 42
}
]
}PR numbers are automatically extracted from commit messages (GitHub's squash merge format: (#123)).
stax is worktree-aware. When you have branches checked out across multiple worktrees, restack, sync, and cascade all work correctly without requiring you to switch worktrees manually.
- Restack / upstack restack / sync
--restack: When a branch to be rebased is checked out in another worktree, stax runsgit rebaseinside that worktree instead of checking it out in the current one. - Merged middle branches (including squash merges): When sync reparents children off a merged branch, stax preserves the old-base boundary and uses
git rebase --ontoso child branches replay only novel commits instead of replaying already-integrated parent history. - Cascade: Before restacking, stax fetches from remote and fast-forwards your local trunk — even if trunk is checked out in a different worktree. This prevents rebasing onto a stale local trunk, which would cause PRs to include commits already merged to remote.
- Sync trunk update: If trunk is checked out in another worktree, stax pulls it there directly.
By default, stax fails fast if a target worktree has uncommitted changes, showing you the branch name and worktree path.
Use --auto-stash-pop to let stax stash changes automatically before rebasing and restore them afterward:
st restack --auto-stash-pop
st upstack restack --auto-stash-pop
st sync --restack --auto-stash-popIf the rebase results in a conflict, the stash is kept intact so your changes are not lost. Run git stash list to find them.
| Command | Behavior |
|---|---|
st cascade |
restack → push → create/update PRs |
st cascade --no-pr |
restack → push (skip PR creation/updates) |
st cascade --no-submit |
restack only (no remote interaction) |
st cascade --auto-stash-pop |
any of the above, auto-stash/pop dirty worktrees |
Use --no-pr when your remote branches should be updated (pushed) but you aren't ready to open or update PRs yet — e.g. branches still in progress. Use --no-submit for a pure local restack with no network activity at all. Use --auto-stash-pop if any branch in the stack is checked out in a dirty worktree.
Tip: run
st rsbeforest cascadeto pull the latest trunk and avoid rebasing onto stale commits. If your local trunk is behind remote,st cascadewill warn you.
Stax makes rebasing and force-pushing safe with automatic backups and one-command recovery:
# Make a mistake while restacking? No problem.
st restack
# ✗ conflict in feature/auth
# Your repo is recoverable via: st undo
# Instantly restore to before the restack
st undo
# ✓ Undone! Restored 3 branch(es).Every potentially-destructive operation (restack, submit, sync --restack, TUI reorder) is transactional:
- Snapshot - Before touching anything, stax records the current commit SHA of each affected branch
- Backup refs - Creates Git refs at
refs/stax/backups/<op-id>/<branch>pointing to original commits - Execute - Performs the operation (rebase, force-push, etc.)
- Receipt - Saves an operation receipt to
.git/stax/ops/<op-id>.json
If anything goes wrong, st undo reads the receipt and restores all branches to their exact prior state.
| Command | Description |
|---|---|
st undo |
Undo the last operation |
st undo <op-id> |
Undo a specific operation |
st redo |
Redo (re-apply) the last undone operation |
Flags:
--yes- Auto-approve prompts (useful for scripts)--no-push- Only restore local branches, don't touch remote
If the undone operation had force-pushed branches, stax will prompt:
st undo
# ✓ Restored 2 local branch(es)
# This operation force-pushed 2 branch(es) to remote.
# Force-push to restore remote branches too? [y/N]Use --yes to auto-approve or --no-push to skip remote restoration.
You're building a payments feature. Instead of one 2000-line PR:
# Start the foundation
st create payments-models
# ... write database models, commit ...
# Stack the API layer on top
st create payments-api
# ... write API endpoints, commit ...
# Stack the UI on top of that
st create payments-ui
# ... write React components, commit ...
# View your stack
st ls
# ◉ payments-ui 1↑ ← you are here
# ○ payments-api 1↑
# ○ payments-models 1↑
# ○ main
# Submit all 3 as separate PRs (each targeting its parent)
st ss
# Creating PR for payments-models... ✓ #101 (targets main)
# Creating PR for payments-api... ✓ #102 (targets payments-models)
# Creating PR for payments-ui... ✓ #103 (targets payments-api)Reviewers can now review 3 small PRs instead of one giant one. When payments-models is approved and merged:
st rs --restack
# ✓ Pulled latest main
# ✓ Cleaned up payments-models (merged)
# ✓ Rebased payments-api onto main
# ✓ Rebased payments-ui onto payments-api
# ✓ Updated PR #102 to target mainMerge your entire stack with one command! st merge intelligently merges PRs from the bottom of your stack up to your current branch, handling rebases and PR updates automatically.
Need strict "merge when ready" behavior with configurable polling? Use st merge --when-ready.
The legacy command st merge-when-ready (alias: st mwr) remains available as a compatibility alias.
Stack: main ← PR-A ← PR-B ← PR-C ← PR-D
Position │ What gets merged
────────────────┼─────────────────────────────
On PR-A │ Just PR-A (1 PR)
On PR-B │ PR-A, then PR-B (2 PRs)
On PR-C │ PR-A → PR-B → PR-C (3 PRs)
On PR-D (top) │ Entire stack (4 PRs)
The merge scope depends on your current branch:
- Bottom of stack: Merges just that one PR
- Middle of stack: Merges all PRs from bottom up to current
- Top of stack: Merges the entire stack
# View your stack
st ls
# ◉ payments-ui 1↑ ← you are here
# ○ payments-api 1↑
# ○ payments-models 1↑
# ○ main
# Merge all 3 PRs into main
st mergeYou'll see an interactive preview before merging:
╭──────────────────────────────────────────────────────╮
│ Stack Merge │
╰──────────────────────────────────────────────────────╯
You are on: payments-ui (PR #103)
This will merge 3 PRs from bottom → current:
┌─────────────────────────────────────────────────┐
│ 1. payments-models (#101) ✓ Ready │
│ ├─ CI: ✓ passed │
│ ├─ Reviews: ✓ 2/2 approved │
│ └─ Merges into: main │
├─────────────────────────────────────────────────┤
│ 2. payments-api (#102) ✓ Ready │
│ ├─ CI: ✓ passed │
│ ├─ Reviews: ✓ 1/1 approved │
│ └─ Merges into: main (after rebase) │
├─────────────────────────────────────────────────┤
│ 3. payments-ui (#103) ✓ Ready │ ← you are here
│ ├─ CI: ✓ passed │
│ ├─ Reviews: ✓ 1/1 approved │
│ └─ Merges into: main (after rebase) │
└─────────────────────────────────────────────────┘
Merge method: squash (change with --method)
? Proceed with merge? [y/N]
For each PR in the stack (bottom to top):
- Wait for readiness - Polls until CI passes and approvals/mergeability are ready (or use
--no-waitto fail fast) - Merge - Merges the PR using your chosen method (squash/merge/rebase)
- Rebase next - Rebases the next PR onto updated main
- Update PR base - Changes the next PR's target from the merged branch to main
- Push - Force-pushes the rebased branch
- Repeat - Continues until all PRs are merged
- Sync local repo - Runs
st rs --forceto fast-forward trunk and finalize local cleanup (use--no-syncto skip)
If anything fails (CI, conflicts, permissions), the merge stops safely. Already-merged PRs remain merged, and you can fix the issue and run st merge again to continue (or st merge --when-ready if you were using that mode).
# Merge with preview only (no actual merge)
st merge --dry-run
# Merge entire stack regardless of current position
st merge --all
# Choose merge strategy
st merge --method squash # (default) Squash and merge
st merge --method merge # Create merge commit
st merge --method rebase # Rebase and merge
# Use explicit wait-for-ready mode (replacement for merge-when-ready)
st merge --when-ready
# Set custom polling interval for --when-ready mode (default: 15s)
st merge --when-ready --interval 10
# Skip CI polling (fail if not ready)
st merge --no-wait
# Keep branches after merge (don't delete)
st merge --no-delete
# Skip post-merge sync
st merge --no-sync
# Set custom CI timeout (default: 30 minutes)
st merge --timeout 60
# Skip confirmation prompt
st merge --yes--when-ready cannot be combined with --dry-run or --no-wait.
You can merge just part of your stack by checking out a middle branch:
# Stack: main ← auth ← auth-api ← auth-ui ← auth-tests
st checkout auth-api
# This merges only: auth, auth-api (not auth-ui or auth-tests)
st merge
# Remaining branches (auth-ui, auth-tests) are rebased onto main
# Run st merge again later to merge those tooAlready have open PRs on GitHub that aren't tracked by stax? Import them all at once:
st branch track --all-prsThis command:
- Fetches all your open PRs from GitHub
- Downloads any missing branches from remote
- Sets up tracking with the correct parent (based on each PR's target branch)
- Stores PR metadata for each branch
Perfect for onboarding an existing repository or after cloning a fresh copy.
You can have multiple independent stacks at once:
# You're working on auth...
st create auth
st create auth-login
st create auth-validation
# Teammate needs urgent bugfix reviewed - start a new stack
st co main # or: st t
st create hotfix-payment
# View everything
st ls
# ○ auth-validation 1↑
# ○ auth-login 1↑
# ○ auth 1↑
# │ ◉ hotfix-payment 1↑ ← you are here
# ○─┘ main| Command | What it does |
|---|---|
st u |
Move up to child branch |
st d |
Move down to parent branch |
st u 3 |
Move up 3 branches |
st top |
Jump to tip of current stack |
st bottom |
Jump to base of stack (first branch above trunk) |
st t |
Jump to trunk (main/master) |
st prev |
Toggle to previous branch (like git checkout -) |
st co |
Interactive picker with fuzzy search |
○ feature/validation 1↑
◉ feature/auth 1↓ 2↑ ⟳
│ ○ ☁ feature/payments PR #42
○─┘ ☁ main
| Symbol | Meaning |
|---|---|
◉ |
Current branch |
○ |
Other branch |
☁ |
Has remote tracking |
1↑ |
1 commit ahead of parent |
1↓ |
1 commit behind parent |
⟳ |
Needs restacking (parent changed) |
PR #42 |
Has open PR |
st config # Show config path and current settingsConfig at ~/.config/stax/config.toml:
# ~/.config/stax/config.toml
# Created automatically on first run with these defaults:
[branch]
date_format = "%m-%d"
replacement = "-"
[remote]
name = "origin"
base_url = "https://github.com"
[ui]
tips = true
[auth]
use_gh_cli = true
allow_github_token_env = false
[ai]
# agent = "claude" # or: "codex" / "gemini" / "opencode"
# model = "claude-sonnet-4-5-20250929"
# Common overrides you can enable later:
# [branch]
# format = "{user}/{date}/{message}"
# user = "cesar"
#
# [remote]
# api_base_url = "https://github.company.com/api/v3"
#
# [auth]
# gh_hostname = "github.company.com"Use format to template branch names with {user}, {date}, and {message} placeholders:
[branch]
format = "{user}/{date}/{message}" # "cesar/02-11/add-login"
user = "cesar" # Optional: defaults to git config user.name
date_format = "%m-%d" # Optional: chrono strftime (default: "%m-%d")Empty placeholders are cleaned up automatically.
stax looks for a GitHub token in the following order (first found wins):
STAX_GITHUB_TOKENenvironment variable- Credentials file (
~/.config/stax/.credentials) gh auth token(whenauth.use_gh_cli = true, default)GITHUB_TOKENenvironment variable (only whenauth.allow_github_token_env = true)
# Option 1: stax-specific env var (highest priority)
export STAX_GITHUB_TOKEN="ghp_xxxx"
# Option 2: Interactive setup (saves to credentials file)
st auth
# Option 3: Import from GitHub CLI auth (saves to credentials file)
st auth --from-ghTo use GITHUB_TOKEN as a fallback, opt in explicitly:
[auth]
allow_github_token_env = trueexport GITHUB_TOKEN="ghp_xxxx"The credentials file is created with 600 permissions (read/write for owner only).
Check which source stax is actively using:
st auth statusTeach Claude Code how to use stax by installing the skills file:
# Create skills directory if it doesn't exist
mkdir -p ~/.claude/skills
# Download the stax skills file
curl -o ~/.claude/skills/stax.md https://raw.githubusercontent.com/cesarferreira/stax/main/skills.mdThis enables Claude Code to help you with stax workflows, create stacked branches, submit PRs, and more.
Teach Codex how to use stax by installing the skill file into your Codex skills directory:
# Create skills directory if it doesn't exist
mkdir -p "${CODEX_HOME:-$HOME/.codex}/skills/stax"
# Download the stax skill file
curl -o "${CODEX_HOME:-$HOME/.codex}/skills/stax/SKILL.md" https://raw.githubusercontent.com/cesarferreira/stax/main/skills.mdThis enables Codex to help you with stax workflows, create stacked branches, submit PRs, and more.
Teach Gemini CLI how to use stax by installing this repo's skill content as GEMINI.md in your project:
# From the stax repo root
curl -o GEMINI.md https://raw.githubusercontent.com/cesarferreira/stax/main/skills.mdGemini CLI loads project instructions from GEMINI.md, so this gives it stack-aware workflow guidance for branch creation, submit flows, and related operations.
Teach OpenCode how to use stax by installing the skill file in OpenCode's skills directory:
mkdir -p ~/.config/opencode/skills/stax
curl -o ~/.config/opencode/skills/stax/SKILL.md https://raw.githubusercontent.com/cesarferreira/stax/main/skills.mdThis enables OpenCode to help with stax workflows, stack operations, and PR generation.
stax uses the same metadata format as freephite and supports similar commands:
| freephite | st | graphite | st |
|---|---|---|---|
fp ss |
st ss |
gt submit |
st submit |
fp bs |
st branch submit |
gt branch submit |
st branch submit |
fp us submit |
st upstack submit |
gt upstack submit |
st upstack submit |
fp ds submit |
st downstack submit |
gt downstack submit |
st downstack submit |
fp rs |
st rs |
gt sync |
st sync |
fp bc |
st bc |
gt create |
st create |
fp bco |
st bco |
gt checkout |
st co |
fp bu |
st bu |
gt up |
st u |
fp bd |
st bd |
gt down |
st d |
fp ls |
st ls |
gt log |
st log |
Migration is instant - just install stax and your existing stacks work.
stax automatically discovers PR templates in your repository:
If you have one template at .github/PULL_REQUEST_TEMPLATE.md, stax uses it automatically:
st submit # Auto-uses template, shows "Edit body?" promptPlace templates in .github/PULL_REQUEST_TEMPLATE/ directory:
.github/
└── PULL_REQUEST_TEMPLATE/
├── feature.md
├── bugfix.md
└── docs.md
stax shows an interactive fuzzy-search picker:
st submit
# ? Select PR template
# > No template
# bugfix
# feature
# docs--template <name>: Skip picker, use specific template--no-template: Don't use any template--edit: Always open $EDITOR for body (regardless of template)
st submit --template bugfix # Use bugfix.md directly
st submit --no-template # Empty body
st submit --edit # Force editor openClick to expand full command reference
| Command | Alias | Description |
|---|---|---|
st status |
s, ls |
Show stack (simple view) |
st ll |
Show stack with PR URLs and full details | |
st log |
l |
Show stack with commits and PR info |
st submit |
ss |
Submit full current stack (ancestors + current + descendants) |
st merge |
Merge PRs from bottom of stack to current | |
st merge --when-ready |
Merge with explicit wait-for-ready mode (legacy alias: st merge-when-ready) |
|
st sync |
rs |
Pull trunk, delete merged branches |
st restack |
Restack current stack (ancestors + current + descendants) | |
st diff |
Show diffs for each branch vs parent | |
st range-diff |
Show range-diff for branches needing restack |
| Command | Alias | Description |
|---|---|---|
st create <name> |
c, bc |
Create stacked branch |
st checkout |
co, bco |
Interactive branch picker |
st modify |
m |
Stage all + amend current commit |
st rename |
b r |
Rename branch and optionally edit commit message |
st branch track |
Track an existing branch | |
st branch track --all-prs |
Track all your open PRs | |
st branch untrack |
ut |
Remove stax metadata for a branch (keep git branch) |
st branch reparent |
Change parent of a branch | |
st branch submit |
bs |
Submit only current branch |
st branch delete |
Delete a branch | |
st branch fold |
Fold branch into parent | |
st branch squash |
Squash commits on branch | |
st detach |
Remove branch from stack, reparent children | |
st reorder |
Interactively reorder branches in stack | |
st upstack restack |
Restack current branch + descendants | |
st upstack submit |
Submit current branch + descendants | |
st downstack get |
Show branches below current | |
st downstack submit |
Submit ancestors + current branch |
| Command | Alias | Description |
|---|---|---|
st up [n] |
u, bu |
Move up n branches |
st down [n] |
d, bd |
Move down n branches |
st top |
Move to stack tip | |
st bottom |
Move to stack base | |
st trunk |
t |
Switch to trunk |
st prev |
p |
Toggle to previous branch |
| Command | Description |
|---|---|
st |
Launch interactive TUI |
st split |
Interactive TUI to split branch into multiple stacked branches |
| Command | Description |
|---|---|
st abort |
Abort in-progress rebase/conflict resolution |
st undo |
Undo last operation (restack, submit, etc.) |
st undo <op-id> |
Undo a specific operation by ID |
st redo |
Re-apply the last undone operation |
| Command | Description |
|---|---|
st validate |
Validate stack metadata (orphans, cycles, staleness) |
st fix |
Auto-repair broken metadata |
st fix --dry-run |
Preview fixes without applying |
st test <cmd> |
Run a command on each branch in the stack |
st test <cmd> --fail-fast |
Stop after first failure |
st test <cmd> --all |
Run on all tracked branches |
| Command | Description |
|---|---|
st auth |
Set GitHub token (--from-gh supported) |
st auth status |
Show active GitHub auth source and resolution order |
st config |
Show configuration |
st doctor |
Check repo health |
st demo |
Interactive tutorial (no auth/repo needed) |
st continue |
Continue after resolving conflicts |
st pr |
Open PR in browser |
st open |
Open repository in browser |
st ci |
Show CI status for current branch (full table with ETA) |
st ci --stack |
Show CI status for all branches in current stack |
st ci --all |
Show CI status for all tracked branches |
st ci --watch |
Watch CI until completion (polls every 15s, records history) |
st ci --watch --interval 30 |
Watch with custom polling interval in seconds |
st ci --verbose |
Compact summary cards instead of full per-check table |
st ci --json |
Output CI status as JSON |
st copy |
Copy branch name to clipboard |
st copy --pr |
Copy PR URL to clipboard |
st comments |
Show PR comments with rendered markdown |
st comments --plain |
Show PR comments as raw markdown |
st standup |
Show your recent activity for standups |
st standup --hours 48 |
Look back 48 hours instead of default 24 |
st standup --json |
Output activity as JSON for scripting |
st changelog <from> [to] |
Generate changelog between two refs |
st changelog v1.0 --path src/ |
Changelog filtered by path (monorepo) |
st changelog v1.0 --json |
Output changelog as JSON |
st generate --pr-body |
Generate PR body with AI and update the PR |
st generate --pr-body --edit |
Generate and review in editor before updating |
st create -m "msg"- Create branch with commit messagest create -a- Stage all changesst create -am "migrate checkout webhooks to v2"- Create branch from message, stage all changes, and commitst branch create --message "msg" --prefix feature/- Create with explicit message and prefixst branch reparent --branch feature-a --parent main- Reparent a specific branchst rename new-name- Rename current branchst rename -e- Rename and edit commit messagest branch rename --push- Rename and update remote branch in one stepst branch squash --message "Squashed commit"- Squash branch commits with explicit messagest branch fold --keep- Fold branch into parent but keep branchst submit --draft- Create PRs as draftsst branch submit/st bs- Submit current branch onlyst upstack submit- Submit current branch and descendantsst downstack submit- Submit ancestors and current branchst submit --yes- Auto-approve promptsst submit --no-pr- Push branches only, skip PR creation/updatesst submit --no-fetch- Skipgit fetch; use cached remote-tracking refsst submit --open- Open the current branch PR in browser after submit (st ss --open/st bs --open)st submit --force- Submit even when restack check failsst submit --no-prompt- Use defaults, skip interactive promptsst submit --template <name>- Use specific template by name (skip picker)st submit --no-template- Skip template selection (no template)st submit --edit- Always open editor for PR bodyst submit --ai-body- Generate PR body with AI during submitst submit --reviewers alice,bob- Add reviewersst submit --labels bug,urgent- Add labelsst submit --assignees alice- Assign usersst submit --rerequest-review- Re-request review from existing reviewers when updating PRsst submit --quiet- Minimize submit outputst submit --verbose- Show detailed submit output, including GitHub API request countsst merge --all- Merge entire stackst merge --method squash- Choose merge method (squash/merge/rebase)st merge --dry-run- Preview merge without executingst merge --when-ready- Use explicit wait-for-ready mode (legacy:st merge-when-ready)st merge --when-ready --interval 10- Use custom poll interval in secondsst merge --no-wait- Don't wait for CI, fail if not readyst merge --no-delete- Keep branches after mergest merge --no-sync- Skip the automatic post-mergest rs --forcest merge --timeout 60- Wait up to 60 minutes for CI per PRst merge --quiet- Minimize merge outputst restack --auto-stash-pop- Auto-stash/pop dirty target worktrees during restackst restack --all- Restack all branches in current stackst restack --continue- Continue after resolving restack conflictsst restack --submit-after ask|yes|no- After restack, ask/auto-submit/skipst ssst restack --quiet- Minimize restack outputst upstack restack --auto-stash-pop- Auto-stash/pop when restacking descendantsst rs --restack --auto-stash-pop- Sync, restack, auto-stash/pop dirty worktrees (rs= sync alias)st sync --force- Force sync without promptsst sync --safe- Avoid hard reset when updating trunkst sync --continue- Continue after resolving sync/restack conflictsst sync --quiet- Minimize sync outputst sync --verbose- Show detailed sync outputst cascade --no-pr- Restack and push branches; skip PR creation/updatesst cascade --no-submit- Restack only, no remote interactionst cascade --auto-stash-pop- Auto-stash/pop dirty target worktrees during cascade restackst sync --restack- Sync and rebase all branchesst status --stack <branch>- Show only one stackst status --current- Show only current stackst status --compact- Compact outputst status --json- Output as JSONst log --stack <branch> --current --compact --json- Filter log outputst checkout --trunk- Jump directly to trunkst checkout --parent- Jump to parent branchst checkout --child 1- Jump to first child branchst ci --refresh- Bypass CI cachest undo --yes- Undo without promptsst undo --no-push- Undo locally only, skip remotest undo --quiet- Minimize undo outputst redo --quiet- Minimize redo outputst auth --token <token>- Set GitHub token directlyst generate --pr-body --edit- Generate and review in editorst generate --pr-body --agent codex- Use specific AI agentst generate --pr-body --agent gemini- Use Gemini CLI as the agentst generate --pr-body --agent opencode- Use OpenCode as the agentst generate --pr-body --model claude-haiku-4-5-20251001- Use specific model
CI/Automation example:
st submit --draft --yes --no-prompt
st merge --yes --method squash| Command | stax | freephite | graphite |
|---|---|---|---|
ls (10-branch stack) |
46.8ms | 1374.0ms | 506.0ms |
Raw hyperfine results:
➜ hyperfine 'st ls' 'fp ls' 'gt ls' --warmup 5
Benchmark 1: st ls
Time (mean ± σ): 46.8 ms ± 0.5 ms [User: 7.9 ms, System: 8.8 ms]
Range (min … max): 45.7 ms … 48.6 ms 57 runs
Benchmark 2: fp ls
Time (mean ± σ): 1.374 s ± 0.011 s [User: 0.417 s, System: 0.274 s]
Range (min … max): 1.361 s … 1.394 s 10 runs
Benchmark 3: gt ls
Time (mean ± σ): 506.0 ms ± 18.0 ms [User: 220.9 ms, System: 69.2 ms]
Range (min … max): 489.8 ms … 536.3 ms 10 runs
Summary
st ls ran
10.81 ± 0.40 times faster than gt ls
29.35 ± 0.41 times faster than fp ls
MIT



