Production-ready git workflow automation for GitHub with Claude Code integration. Streamlines feature development with intelligent CI polling, comprehensive error reporting, automated PR workflows, multi-language verification (Python, Node.js, Go, Rust), and automated release validation.
Get started in 30 seconds:
# Install
npm install -g @littlebearapps/git-pr-manager
# Set GitHub token (get from: https://github.com/settings/tokens)
export GITHUB_TOKEN="ghp_your_token_here"
# Initialize
gpm init --interactive
# Use it!
gpm auto # Full automated PR workflow: verify β security scan β PR β CI β mergeWhat it does: Automates your entire GitHub PR workflowβcreate feature branches, run security scans, create PRs, wait for CI checks, and auto-mergeβall in one command. Supports Python, Node.js, Go, and Rust projects with automatic language detection.
Why gpm vs manual git workflows?
π‘ Time Savings & Consistency
Manual PR workflows take 15-20 minutes per PR:
- Run tests locally (forgot? CI fails after PR creation)
- Run security scan (forgot? Secrets leak into history)
- Create PR manually (copy-paste template, assign reviewers)
- Check CI every 5 minutes (browser tab watching)
- Click merge button when green
With gpm:
gpm autoβ 5-8 minutes, fully automated, never skip steps.For teams: Standardized workflow = no more "I forgot to run tests" PRs.
For AI agents: Machine-readable JSON output (--json flag) on all commands. See AI Agent Integration Guide.
- β‘ TL;DR - Get started in 30 seconds
- π API Reference - All commands with JSON schemas
- π¨ Common Workflows - Real-world usage patterns
- For Human Developers - Daily workflows, code review, hotfixes
- For AI Agents / CLI Tools - Python, JavaScript, Go examples
- π― Who Should Use This - Use cases and ideal scenarios
- π Quick Start - Installation, setup, basic usage
- π Commands - Full command reference
- Workflow Automation -
gpm auto,gpm ship,gpm feature - CI & Status -
gpm checks,gpm status - Configuration & Security -
gpm init,gpm security,gpm doctor - Git Hooks -
gpm install-hooks,gpm uninstall-hooks - Git Worktree Management -
gpm worktree list,gpm worktree prune
- Workflow Automation -
- β FAQ & Troubleshooting - Common questions and solutions
- π Multi-Language Support - Python, Node.js, Go, Rust auto-detection
- π§ CI/CD & Automation - GitHub Actions, AI agents
- π― Key Features - Security, CI polling, branch protection, performance
- π Configuration -
.gpm.ymlexamples and presets - ποΈ Architecture - Project structure and design
- π Performance Metrics - Speed improvements
- π§ͺ Testing - 593 tests, 89.67% coverage
- π Documentation - Guides, architecture, planning docs
- Step-by-Step Tutorials - 5 comprehensive tutorials (105 min total)
- Working Examples - Copy-paste workflows for daily use
- β¨ What's New - Latest features and updates
- πΊοΈ Roadmap - Current status and future plans
- π Changelog - Version history
- π₯ Contributors - Community contributions
- π License - MIT License
Quick reference for all commands with JSON output schemas:
| Command | Purpose | Key Flags | JSON Output Schema |
|---|---|---|---|
gpm auto |
Full automated workflow | --draft, --no-merge, --skip-security, --skip-verify |
{prNumber, url, ciStatus, merged} |
gpm ship |
Manual PR workflow | --no-wait, --draft, --title, --template |
{prNumber, url, ciStatus} |
gpm feature <name> |
Create feature branch | --from <branch> |
{branch, created} |
gpm checks <pr> |
CI status for PR | --details, --files |
{total, passed, failed, pending, overallStatus} |
gpm status |
Git/workflow status | - | {branch, clean, ahead, behind, hooks} |
gpm security |
Security scanning | - | {passed, secretsFound, vulnerabilities} |
gpm init |
Initialize config | --template <preset>, --interactive |
{created, template, config} |
gpm protect |
Branch protection | --show, --preset <type>, --branch |
{enabled, requirements} |
gpm setup |
Setup wizard | --update, --method, --token, --skip-validation |
{success, method, location, configured} |
gpm doctor |
System health check | --pre-release, --json |
{token, tools, checks} |
gpm install-hooks |
Install git hooks | --post-commit, --force |
{installed, hooks} |
gpm uninstall-hooks |
Remove git hooks | - | {removed} |
gpm worktree list |
List worktrees | - | {worktrees: [{path, branch, commit}]} |
gpm worktree prune |
Clean stale data | --dry-run |
{pruned, count} |
gpm verify | validate |
Pre-commit checks | --skip-format, --skip-lint, --skip-test |
{passed, tasks: [{name, status, fixable}]} |
gpm hooks status |
Git hooks status | - | {installed, hooks, config} |
gpm check-update |
Check for updates | --channel <next|latest>, --clear-cache |
{updateAvailable, currentVersion, latestVersion} |
gpm docs |
View documentation | --guide=<name> |
{guide, found, content} |
Note: Add --json flag to any command for machine-readable output. All commands support --quiet, --silent, and --verbose flags for output control.
Complete schemas: See JSON Output Schemas Guide for detailed field descriptions and examples.
Quick examples for the most common use cases:
# Daily feature development
gpm feature add-user-profile # Start new feature
# ... make changes ...
gpm auto # Ship it (verify β security β PR β CI β merge)
# Code review
gpm checks 47 # Check PR #47 status
gpm security # Run security scan
# Emergency hotfix
gpm feature hotfix-bug --from main # Create hotfix from main
gpm ship --skip-verify --no-wait # Fast-track PR
# Automation with JSON output
gpm auto --json # Machine-readable PR creation
gpm checks 47 --json # Structured CI status
gpm doctor --json # System health checkπ Complete Workflow Guides:
- Quick Reference - Human developer workflows with examples
- AI Agent Integration - Python, JavaScript, Go examples for automation
Ideal for: Solo developers, development teams, AI agents, and CI/CD engineers who want to automate GitHub workflows while maintaining control.
Perfect when you value:
- β‘ Speed: 60%+ time savings on PR workflows
- π Security: Built-in secret scanning and vulnerability checks
- π€ Automation: JSON output for scripting and AI agents
- π Multi-language: Python, Node.js, Go, Rust with auto-detection
Not ideal for: Local-only git usage, GUI tool preferences, non-GitHub platforms (GitLab, Bitbucket)
Ready to try? Run gpm setup for interactive configuration, then gpm auto for your first automated PR workflow.
π Complete Guide: See docs/tutorials/getting-started.md for detailed scenarios, team size recommendations, and real-world case studies.
Latest: v1.12.0 - AI Agent Hook Optimization (2025-11-24)
Git hooks now auto-detect AI agents and non-interactive environments:
- β TTY Detection: Hooks auto-skip in non-TTY mode (AI agents, pipes, redirects)
- β 70-80% Less Output: Cleaner command output for AI agents like Claude Code and Codex CLI
- β 100% Reliable JSON Parsing: No text pollution in automated workflows
- β 95% Faster Hook Execution: Immediate exit in automation contexts
Previous: v1.11.0 - TypeScript Type Safety + Branch Coverage (2025-11-24)
- β
Strict TypeScript Types: Eliminated all 29
@typescript-eslint/no-explicit-anywarnings - β Enhanced Branch Coverage: Improved from 76.58% to 79.15% (+2.57%)
- β Zero TypeScript Warnings: Full ESLint compliance with strict type checking enabled
- β 1001 Tests: All passing with improved edge case coverage for doctor command and GitService worktree methods
Recent highlights:
- β v1.10.0: Codex CLI compatibility with standardized JSON output, auto-suppressed prompts/spinners for automation contexts
- β
v1.9.0: Interactive setup wizard (
gpm setup) with guided GitHub token configuration and multi-method secure storage - β
Release validation: Automated pre-release checks (
gpm doctor --pre-release) ensure publish-ready state - β Multi-language support: Python, Node.js, Go, Rust with automatic detection (v1.7.0)
π Full Release History: See CHANGELOG.md for complete version history and detailed release notes.
npm install -g @littlebearapps/git-pr-managerThe easiest way to get started is with the interactive setup wizard:
gpm setupThis wizard will:
- β Detect and verify required tools (git, node)
- β Check optional dependencies (gh CLI, detect-secrets, pip-audit)
- β Guide you through creating a GitHub token (with direct link and exact scopes)
- β Test your GitHub connection before storing
- β Help you choose secure storage method (ranked by security)
- β Provide copy-paste commands for immediate setup
Result: Complete setup in ~5 minutes with guided assistance.
Advanced options:
gpm setup github-token # Configure GitHub token only
gpm setup --update # Re-run setup for existing projects
gpm doctor # Check system requirements anytimeClick to expand manual token setup options
If you prefer manual configuration or need custom setup:
1. Create GitHub Personal Access Token:
- Go to https://github.com/settings/tokens/new
- Token name:
gpm-cli - Select scopes:
repo(full control of private repositories) - Click "Generate token" and copy immediately
2. Store token (choose one method):
Option A: Shell profile (persistent, medium security)
echo 'export GITHUB_TOKEN="ghp_your_token_here"' >> ~/.zshrc
source ~/.zshrcOption B: Session variable (temporary, testing only)
export GITHUB_TOKEN="ghp_your_token_here"Option C: Project .env file (requires direnv)
echo 'GITHUB_TOKEN=ghp_your_token_here' >> .env
echo '.env' >> .gitignore # CRITICAL: Prevent token leak3. Verify:
echo $GITHUB_TOKEN # Should show your token
gpm doctor # Confirms setupWhy does gpm need a token?
π‘ Understanding GitHub Tokens
gpm creates pull requests and checks CI status on your behalf. GitHub requires a token to prove you're authorized to perform these actions. Think of it like a password, but specifically for automation tools.
What can it do?
- Create and merge pull requests
- Check CI/CD status
- Read repository information
What it CANNOT do:
- Access other repositories (only repos you have access to)
- Change account settings
- Access private information outside of repository scope
# Interactive setup wizard (recommended for first time)
gpm init --interactive
# Or use a preset template
gpm init --template standard # Balanced settings (recommended)
gpm init --template strict # Maximum protection
gpm init --template basic # Minimal configuration# Start a new feature
gpm feature add-login-form
# ... make your changes ...
# Ship it! (automated workflow)
gpm autoThat's it! gpm auto will:
- β Run verification checks (lint, test, typecheck)
- β Run security scans (secrets, vulnerabilities)
- β Push changes to GitHub
- β Create pull request
- β Wait for CI to pass
- β Merge and cleanup
New to gpm? Check out our Complete Beginner's Guide (15 min) for step-by-step instructions with screenshots and examples.
Quick command examples for the most common workflows:
# Full automated workflow (recommended)
gpm auto # Verify β Security β PR β CI β Merge
# Manual workflow
gpm feature <name> # Create feature branch
gpm ship # Create PR and wait for CI
gpm ship --draft # Create draft PR
# Pre-commit checks
gpm verify # Run format, lint, typecheck, test, build
gpm security # Scan secrets and vulnerabilities
# System utilities
gpm doctor # Check requirements & setup
gpm status # Show git/workflow status
gpm checks <pr> # Check CI status for PRSee API Reference above for complete command list with all flags and JSON schemas.
π Complete CLI Reference: See docs/CLI-REFERENCE.md for detailed documentation of all commands, options, examples, and exit codes.
Quick answers to common questions:
- Token setup: Run
gpm setupfor interactive GitHub token configuration - System check: Run
gpm doctorto verify all required and optional tools - Language detection: Auto-detects Python, Node.js, Go, Rust from project files
- CI/CD integration: See GitHub Actions Integration Guide
- JSON output: Add
--jsonflag to any command for machine-readable output
π Complete FAQ: See docs/FAQ.md for detailed troubleshooting, common errors, and solutions.
gpm verify automatically detects your project language and package manager, running appropriate verification commands for each ecosystem.
Supported Languages: Python, Node.js, Go, Rust
Quick Examples:
# Python project - auto-detects poetry, runs ruff, mypy, pytest
gpm verify
# Node.js project - auto-detects pnpm, runs eslint, tsc, jest
gpm verify
# Prefers Makefile targets when available
gpm verify # Uses 'make lint', 'make test', etc.Key Features:
- Automatic language and package manager detection
- Makefile integration with custom target mapping
- Workspace detection (npm/yarn/pnpm workspaces)
- Dependency installation support
- Custom task ordering and skip options
π Complete Guide: See docs/guides/MULTI-LANGUAGE-SUPPORT.md for detailed examples, configuration options, and troubleshooting.
GitHub Actions - Automated PR validation and CI orchestration:
- name: Run security scan
run: gpm security --json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}AI Agents - Machine-readable JSON output for Claude Code, Aider, Cursor:
gpm auto --json # Full PR workflow
gpm checks 123 --json # Get structured CI statusπ Complete Guides:
- GitHub Actions Integration - Complete workflows and examples
- AI Agent Integration - Implementation in Python, JavaScript, Go
Workflow Automation - Feature branch β PR β CI β Merge in one command (gpm auto)
Enterprise Security - Secret detection, vulnerability scanning, language-aware scanners
Intelligent CI Polling - Exponential backoff (5s β 30s), progress tracking, rich error reports
Branch Protection - Validation, presets (basic/standard/strict), PR readiness checks
Git Worktree Support - Conflict detection, smart parsing, enhanced error context
Performance - API caching (40-60% fewer calls), request batching, rate limit handling
Error Reporting - Classification, file extraction, suggested fixes, JSON output
Auto-Fix - Intelligent linting/formatting/security fixes with verification and rollback (AUTO-FIX.md)
Quick setup: Run gpm init --template standard to generate a .gpm.yml config file with sensible defaults.
Templates: Choose from basic (minimal), standard (recommended), or strict (enforced verification and branch protection).
π Complete Reference: See docs/CONFIG.md for all configuration options, YAML examples, CLI flags, and environment variables.
Verify your setup and identify missing dependencies:
gpm doctor # Check requirements & dependencies
gpm doctor --pre-release # Pre-release validation (7 checks)Checks: GitHub token, required tools (git, node), optional tools (gh, detect-secrets, pip-audit)
Use when: After installation, troubleshooting errors, before publishing to npm
π Complete Guide: See docs/FAQ.md#what-tools-do-i-need-to-have-installed for detailed output examples and optional dependency explanations.
Required:
export GITHUB_TOKEN="ghp_your_token_here" # GitHub authentication
# Token needs 'repo' scope - Generate at https://github.com/settings/tokens/newOptional:
export DEBUG=1 # Enable verbose logging
export NO_UPDATE_NOTIFIER=1 # Disable update checksCommands work without token: gpm status, gpm security, gpm init, gpm doctor, gpm install-hooks
π Complete Guide: See docs/CLI-REFERENCE.md#environment-variables for all variables and CI environment auto-detection.
Quick diagnostics if commands fail:
- Check GitHub token:
gpm doctor- Validates token and system setup - Common errors:
GitHub token invalidβ Rungpm setup github-token - Environment issues:
gpm: command not foundβ Add npm global bin to PATH
π Complete Troubleshooting Guide: See docs/FAQ.md for detailed error solutions, platform-specific issues, and common pitfalls.
π§ Edge Cases & Recovery: See docs/guides/EDGE-CASES.md for failure scenarios (rate limiting, network errors, token expiration, merge conflicts) with step-by-step recovery procedures.
Things that trip up new users:
- Must commit before creating PR - β
Right:
git add . && git commitβgpm auto - Requires clean working tree - β Commit or stash changes first
- Only works from feature branches - β
Create with
gpm feature <name> - GitHub token needs
reposcope - β Verify at https://github.com/settings/tokens
π Complete Troubleshooting Guide: See docs/FAQ.md#troubleshooting for detailed error solutions and common issues.
Clean TypeScript architecture with modular service layer:
- Commands (
src/commands/) - CLI command handlers (auto, ship, checks, security, etc.) - Services (
src/services/) - Core business logic (GitHub API, Git operations, CI polling, auto-fix) - Utils (
src/utils/) - Caching, error handling, logging, formatting
Built with: Octokit (GitHub API), simple-git (Git ops), Commander.js (CLI), TypeScript
Real-world performance improvements measured across versions:
| Metric | v1.3.0 | v1.4.0 | Improvement |
|---|---|---|---|
| CI Wait Time (5 min checks) | 10 min | 6-7 min | 30-40% β |
| PR Validation | 800ms | 380ms | 40-50% β |
| Config Load (cached) | 5ms | 0.1ms | 98% β |
| API Rate Limit Errors | 5-10/day | 0/day | 100% β |
| API Calls per Ship | 25-30 | 10-15 | 40-60% β |
Hardware: MacBook Pro (M1, 16GB RAM) OS: macOS Sonoma 14.x Network: Fiber broadband (100 Mbps), latency to GitHub API ~20-30ms Repo Size: Medium project (~500 files, 50K LOC)
- Sample Size: Metrics averaged over 50+ real-world workflow runs
- Measurement: Automated timing instrumentation + manual verification
- CI Wait Time: Measured with 5-minute duration checks (typical test suite)
- PR Validation: Time from
gpm statusinvocation to completion - Config Load: File read + parse + validation time (with cache warm/cold)
- API Calls: Counted via GitHub API response headers during
gpm shipworkflow - Variance: Β±10-15% typical across runs (network-dependent)
Results may vary based on:
- Network latency: GitHub API response times vary by region and time of day
- CI check duration: Longer test suites increase absolute wait time (but still benefit from adaptive polling)
- Cache effectiveness: First runs are slower; subsequent runs benefit from LRU cache
- Repository size: Larger repos may have slower git operations
- Concurrent workflows: Multiple PRs in flight may affect API rate limits
Measure your own performance:
# Enable debug mode for detailed timing
DEBUG=1 gpm ship --no-wait
# Get JSON performance data
gpm ship --json | jq '.performance'
# Monitor API call count
gpm ship --verbose | grep "API calls"Example output:
{
"performance": {
"totalDuration": 6734,
"apiCalls": 12,
"cacheHits": 8,
"cacheHitRate": 0.67
}
}Production-ready test coverage:
- 593 tests (565 unit + 28 integration) - β All passing
- 89.67% coverage (target: 80%) - β Exceeded
npm test # Run all tests
npm run test:coverage # With coverage reportπ Complete Test Documentation: See docs/TESTS.md for detailed coverage breakdown, testing patterns, and contribution guidelines.
Contributions welcome! See CONTRIBUTING.md for development setup, guidelines, and CODE_OF_CONDUCT.md for community standards.
Quick Links:
- Getting Started Tutorial (15 min) - New user guide
- CLI Reference - All commands with examples
- Configuration Reference -
.gpm.ymldocumentation - Edge Cases & Recovery - Failure scenarios and step-by-step recovery procedures
- JSON Output Schemas - Complete TypeScript interfaces and usage examples for all commands (v1.9.0)
- FAQ & Troubleshooting - Common questions and solutions
Learning Paths:
- Beginner: Tutorials (105 min total) β Basic Examples β FAQ
- Advanced: Multi-Language Guide β GitHub Actions β AI Agent Integration
- Contributors: Contributing Guide β Test Documentation β Architecture
π Complete Index: See docs/INDEX.md for comprehensive documentation navigation organized by user type, feature, and topic.
Current Status: Production Ready β (89.67% test coverage, 1.2k/month downloads)
Recent Achievements:
- v1.9.x: Setup wizard, AI agent enhancements, shields.io badges
- v1.8.x: Automated release validation, multi-language support (Python, Node.js, Go, Rust)
- v1.7.x: Git hooks integration, worktree management, security enhancements
Planned Features (community-driven priority):
- Enhanced AI integration (Claude Code workflows, smart commit messages)
- Team collaboration (shared configs, organization policies)
- Performance & scale (parallel CI polling, monorepo optimization)
- Extended language support (Java, C#, PHP, Ruby)
- Advanced security (SBOM, supply chain detection)
π Complete Roadmap: See docs/ROADMAP.md for detailed achievements, planned features, and how to contribute ideas.
Latest: v1.9.2 (2025-11-21) - Badge migration to shields.io + coverage/downloads badges
Recent releases: Setup wizard (v1.9.0), multi-language support (v1.7.0), automated release validation (v1.8.0), git hooks (v1.4.x)
π Complete Changelog: See CHANGELOG.md for detailed version history and release notes.
We're building git-pr-manager and looking for contributors to join us! Contributions of any kind are welcome.
Quick links:
- π Report bugs | π‘ Request features
- π§ Good first issues for beginners
- π CONTRIBUTING.md - Development setup and guidelines
- π¬ Discussions - Ask questions, share ideas
Core Team: Nathan Schram (@nathanschram) - Creator & Maintainer | Little Bear Apps
Support the project: β Star the repo | π’ Share with your team | π Report bugs | π Write about gpm
MIT License - Copyright (c) 2025 Nathan Schram / Little Bear Apps
See LICENSE for details.
Built with:
- Octokit - GitHub API client
- simple-git - Git operations
- Commander.js - CLI framework
- Chalk - Terminal styling
- Ora - Progress indicators
- prompts - Interactive prompts
Made with β€οΈ by Little Bear Apps
For support, please open an issue or contact nathan@littlebearapps.com.