Skip to content

πŸ€– Automate pull request management across multiple Git repositories. Manage PR automation centrally through YAML configuration. Watch repositories, check PR status, and automatically merge ready PRs across GitHub, GitLab, and Bitbucket.

License

Notifications You must be signed in to change notification settings

pacphi/git-pr-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

42 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Git PR Manager

Version CI Known Vulnerabilities

πŸš€ Modern Go-based tool for automating pull request management across multiple Git repositories

Git PR CLI provides a fast, reliable, and feature-rich solution for managing dependency updates and pull requests across GitHub, GitLab, and Bitbucket repositories from a single configuration.

✨ Features

  • πŸ”„ Multi-Provider Support - GitHub, GitLab, and Bitbucket in one tool
  • 🎯 Smart Filtering - Only merge PRs from trusted bots (dependabot, renovate, etc.)
  • πŸ›‘οΈ Safety First - Dry-run mode, status checks, and approval requirements
  • ⚑ High Performance - Native Go performance with concurrent processing
  • πŸ“± Notifications - Slack webhook and email SMTP notifications
  • πŸ”§ Interactive Setup - Automated repository discovery and configuration wizard
  • πŸ“Š Rich Statistics - Detailed repository and PR analytics
  • πŸ–₯️ Cross-Platform - Native binaries for macOS, Linux, and Windows

πŸš€ Quick Start

Install

Download the latest release for your platform:

# macOS (Apple Silicon)
curl -L -o git-pr-cli https://github.com/pacphi/git-pr-manager/releases/latest/download/git-pr-cli-darwin-arm64
chmod +x git-pr-cli
sudo mv git-pr-cli /usr/local/bin/

# Or build from source
git clone https://github.com/pacphi/git-pr-manager.git
cd git-pr-manager
make build

Configure Authentication

# Set required environment variables
export GITHUB_TOKEN="ghp_..."
export GITLAB_TOKEN="glpat_..."
export BITBUCKET_USERNAME="username"
export BITBUCKET_APP_PASSWORD="password"

Setup Repositories

# Interactive setup wizard
git-pr-cli setup wizard

# Validate configuration
git-pr-cli validate --check-repos

Start Automating

# Check what's ready to merge
git-pr-cli check

# Dry run to see what would be merged
git-pr-cli merge --dry-run

# Merge ready PRs
git-pr-cli merge

# Watch continuously
git-pr-cli watch --interval=5m

πŸ“‹ Commands

Command Description
check Check pull request status across repositories
completion Generate the autocompletion script for the specified shell
help Help about any command
info Show configuration and provider information
merge Merge ready pull requests
setup wizard Interactive configuration setup
stats Show repository and PR statistics
validate Validate configuration and connectivity
watch Continuously monitor pull requests

πŸ“– Documentation

πŸ”§ Configuration Example

# config.yaml - Updated for Go-based schema
pr_filters:
  allowed_actors:
    - "dependabot[bot]"
    - "renovate[bot]"
  skip_labels:
    - "do-not-merge"
    - "wip"

repositories:
  github:
    - name: "myorg/web-app"
      auto_merge: true
      merge_strategy: "squash"
      require_checks: true
    - name: "myorg/*"
      auto_merge: false
      require_checks: true

auth:
  github:
    token: "${GITHUB_TOKEN}"
  gitlab:
    token: "${GITLAB_TOKEN}"
    url: "${GITLAB_URL}"
  bitbucket:
    username: "${BITBUCKET_USERNAME}"
    app_password: "${BITBUCKET_APP_PASSWORD}"

notifications:
  slack:
    webhook_url: "${SLACK_WEBHOOK_URL}"
    channel: "#deployments"
    enabled: false

πŸ—οΈ Development

Build

# Build both CLI and MCP server
make build

# Cross-platform builds
make cross-compile

# Run tests
make test

# Run linting
make lint

Project Structure

β”œβ”€β”€ cmd/
β”‚   β”œβ”€β”€ git-pr-cli/     # CLI application
β”‚   └── git-pr-mcp/     # MCP server for AI assistants
β”œβ”€β”€ pkg/                # Shared libraries
β”‚   β”œβ”€β”€ config/         # Configuration management
β”‚   β”œβ”€β”€ providers/      # Git provider implementations
β”‚   β”œβ”€β”€ pr/            # PR processing logic
β”‚   β”œβ”€β”€ merge/         # Merge strategies
β”‚   └── notifications/ # Notification systems
β”œβ”€β”€ internal/          # Application-specific code
└── docs/             # Documentation

Technology Stack

  • CLI: Cobra + Viper
  • MCP Server: Model Context Protocol for AI assistant integration
  • Providers: Official Go clients (go-github, go-gitlab, go-bitbucket)
  • HTTP: Resty with retry logic and rate limiting
  • Configuration: YAML with environment variable support
  • Logging: Structured logging with Logrus
  • Testing: Testify + GoMock

πŸ” Security

  • Tokens stored only in environment variables
  • HTTPS/TLS enforcement for all API calls
  • Input validation and sanitization
  • Rate limiting and retry logic
  • No sensitive data logging

πŸ“Š Performance

  • Native Go performance
  • Concurrent API processing with controlled limits
  • Built-in rate limiting per provider
  • HTTP connection pooling and keepalive
  • Memory-efficient streaming for large datasets

πŸš€ Why Git PR CLI

This modern Go-based solution provides:

  • High Performance - Native Go performance with concurrent processing
  • Robust Error Handling - Structured error messages and recovery
  • Enterprise Reliability - Retry logic, timeout handling, and rate limiting
  • Rich Features - Interactive wizard, detailed statistics, flexible notifications
  • Cross-Platform - Single binary works on macOS, Linux, and Windows

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make changes with tests
  4. Run make ci to verify
  5. Submit a pull request

πŸ“„ License

MIT License - see LICENSE file for details.

πŸ™ Acknowledgments

Built with these excellent Go libraries:

About

πŸ€– Automate pull request management across multiple Git repositories. Manage PR automation centrally through YAML configuration. Watch repositories, check PR status, and automatically merge ready PRs across GitHub, GitLab, and Bitbucket.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •