Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@claycoleman/gt-wrapper) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
GT - Enhanced Graphite CLI
A drop-in replacement for the Graphite CLI that adds custom sync and submit commands while preserving all original functionality.
⚠️ Important: Replacing Existing Graphite CLI
This package replaces the original Graphite CLI completely. If you have the original installed, you need to uninstall it first:
# If installed via npm:
npm uninstall -g @withgraphite/graphite-cli
# If installed via brew:
brew uninstall withgraphite/tap/graphite
# Then install this enhanced version:
npm install -g @claycoleman/gt-wrapperWhy? Both packages provide gt and graphite commands. Installing this will overwrite the original, and uninstalling this will remove the commands entirely until you reinstall something.
Installation
Prerequisites Check
Before installing, check if you have existing Graphite CLI:
which gtIdeal scenario (ready to install):
- Command returns nothing or "gt not found" - Perfect! ✅
If you see a path (like /usr/local/bin/gt):
- You have existing Graphite CLI installed
- Follow the "Replacing Existing Graphite CLI" instructions above first
Install
Install this enhanced version:
npm install -g @claycoleman/gt-wrapperRequirements:
- Node.js 14+
- Python 3
- Git
- GitHub CLI (gh) for PR operations
Usage
This package provides both gt and graphite commands that work identically:
Custom Enhanced Commands
# Custom sync with branch cleanup
gt sync
gt sync --dry-run
gt sync --skip-restack
# Custom submit with stack management
gt submit
gt submit --single
gt submit --upstack
gt submit --downstack
gt submit --whole-stack
gt submit --dry-runAll Original Graphite Commands Work
gt status
gt branch create my-feature
gt stack
gt log
gt restack
# ... all other gt commands work exactly as beforeUse Either Command Name
# These are identical:
gt sync
graphite sync
gt status
graphite statusWhat This Replaces
- Original Graphite CLI - This package bundles v1.4.3 and provides all the same functionality
- Plus enhanced commands - Custom sync/submit logic via Python scripts
- Drop-in replacement - No need to change your workflow
How It Works
- When you run
gt syncorgt submit, it calls custom Python scripts with enhanced logic - All other commands (
gt status,gt branch, etc.) pass through to the bundled Graphite CLI v1.4.3 - Zero configuration needed - just install and use
Enhanced Sync Command
The sync command:
- Switches to main and pulls latest changes
- Identifies local branches that have been merged (closed PRs)
- Prompts to delete merged branches
- Runs
gt restackto clean up the stack - Returns to your original branch
Enhanced Submit Command
The submit command:
- Analyzes your current stack
- Offers multiple submission modes (single, upstack, downstack, whole-stack)
- Creates/updates PRs with proper stack references
- Adds stack navigation comments to PRs
- Returns to your original branch
Migration from Original Graphite CLI
Step-by-step migration:
Check what you have:
which gt # If it shows something like /usr/local/bin/gt, you have the original
Uninstall original:
# For npm installations: npm uninstall -g @withgraphite/graphite-cli # For brew installations: brew uninstall withgraphite/tap/graphite
Install enhanced version:
npm install -g @claycoleman/gt-wrapper
Verify:
gt --version # Should show: GT Wrapper: 1.0.0, Bundled Graphite CLI: 1.4.3
Everything works exactly the same, plus you get the enhanced sync/submit commands!
Development
To modify the custom commands, see:
bin/gt_commands.py- Contains the custom sync and submit logic plus command routing
Uninstall
npm uninstall -g @claycoleman/gt-wrapperTo go back to the original Graphite CLI:
npm install -g @withgraphite/graphite-cli