| name | graphite-cli |
| description | Use Graphite CLI (gt) for stacked PRs and branch management. Use when creating branches, committing changes, submitting PRs, syncing with trunk, or managing stacked pull requests. |
Graphite CLI (gt)
Graphite CLI simplifies stacked PR workflows by automating branch management, rebasing, and PR creation.
Key Concepts
| Term | Definition |
|---|
| Stack | A sequence of PRs, each building on its parent (main <- PR1 <- PR2) |
| Trunk | The base branch stacks merge into (usually main) |
| Upstack | PRs above a given PR (descendants) |
| Downstack | PRs below a given PR (ancestors) |
Agent Usage Notes
CRITICAL: Always use --no-interactive for automation. Many commands prompt for input by default.
gt submit --no-interactive
gt submit --no-edit
Branch names are POSITIONAL, not flags:
gt create my-feature --all --message "feat: add feature"
gt create --branch my-feature --all --message "feat: add feature"
The force-rename trap (renaming a branch that already has a PR):
gt rename <new> --force on a branch with an open PR . The next creates a PR for the renamed branch; the
original PR is left orphaned on the old branch name. There is no "repurpose the existing
PR under a new branch name" path — GitHub PR head refs + Graphite tracking do not survive
the force.