Graphite CLI
$ gt Official Med RiskOfficial CLI from Graphite for creating, restacking, syncing, and submitting dependent GitHub pull request stacks. Supports --no-interactive (--quiet) for headless execution, though it lacks JSON output and performs remote Git/PR mutations.
brew install withgraphite/tap/graphite Stacked branch restacking and PR submission run directly against local git state via gt; faster and more reliable than remote MCP calls.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Provides --no-interactive and explicit -m/--no-edit flags, but omits --json output and defaults to interactive prompts when flags are missing.
- Supports
--no-interactiveand--quietacross commands - No
--jsonoutput ongt logorgt state
Writes local git branches/rebases and pushes/creates GitHub PRs via gt submit; lacks a global --dry-run mode and authenticates via long-lived user_config token.
gt submit --stackpushes multiple branches and PRs at once- No global
--dry-runflag
Available via Homebrew tap and npm (@withgraphite/graphite-cli), requiring Node.js or Homebrew formula on macOS/Linux (Windows requires WSL).
- Requires Node.js (npm) or macOS/Linux Homebrew tap
Dramatically simplifies stacked-PR rebasing, tracking parent branches, and batch PR updates.
- Automates multi-branch restacking and dependent PR base updates
Official first-party CLI actively maintained by Graphite.
- Official Graphite product CLI
Good official CLI reference at graphite.dev/docs/graphite-cli and --help output.
- Official command docs at graphite.dev
Security, Auth & Guardrails
Stores Graphite/GitHub OAuth token in ~/.config/graphite/user_config (set via gt auth --token).
Free CLI for individual/open-source use; Graphite team plans require paid seats.
# Graphite CLI (gt) Agent Rules - Always pass `--no-interactive` (and `--no-edit` on `gt submit`) so `gt` never waits for terminal input. - Never run `gt submit` or `gt merge` without explicit user confirmation, as both push branches and mutate GitHub PRs. - Inspect the stack first with `gt log short --no-interactive`.
Agent-Ready Command Recipes
Safe Read-Only Queries
gt log short --no-interactive
Prints a compact tree of stacked local branches without entering interactive navigation.
Controlled Writes & Previews
gt create -a -m "feat: step 1" --no-interactive
Stages tracked changes and creates a stacked branch on top of the current branch without launching prompts or an editor.
Strengths for Agents
- +
--no-interactiveprevents terminal hangs ongt create,gt sync, andgt submit. - + Handles dependent branch restacking and GitHub PR base updates cleanly in stacked workflows.
Caveats & Pitfalls
- ! No
--jsonoutput for stack state inspection. - ! Proprietary CLI tied to Graphite's GitHub PR workflow; Windows is only supported via WSL.