Skip to content

sukeesh/ghpush

Repository files navigation

🚀 GHPush

AI-Powered GitHub Pull Request Creation Tool

PyPI version PyPI downloads License: MIT Python 3.11+


🌟 Overview

GHPush is an intelligent command-line tool that revolutionizes your GitHub workflow by automating pull request creation. It operates in two modes:

  • 🤖 AI Mode: Generates detailed, context-aware PR titles and descriptions using OpenAI
  • 📝 Basic Mode: Creates simple, effective summaries based on file changes

🚀 Quick Start

Installation

pip install ghpush

💡 Check out ghpush on PyPI for the latest version and release notes.

Configuration

1. GitHub CLI Authentication (Required)

# Install GitHub CLI if you haven't already
brew install gh  # macOS
# For other platforms, see: https://cli.github.com/

# Authenticate with GitHub
gh auth login

2. Choose Operating Mode

GHPush operates in two modes:

🤖 AI Mode (Recommended)

To enable AI-powered summaries:

# Linux/macOS
export OPENAI_API_KEY=your-api-key-here

# Windows (PowerShell)
$env:OPENAI_API_KEY="your-api-key-here"
📝 Basic Mode
  • Automatically used when OpenAI API key is not set
  • No configuration needed
  • Provides simple summaries based on changed files

Usage

ghpush --base main

That's it! GHPush will:

  1. 📝 Analyze your changes
  2. 🤖 Generate a PR title and description (AI or Basic mode)
  3. 🔄 Push your branch
  4. 🌐 Open the PR creation page

💡 Tip: Make sure you've authenticated with GitHub CLI (gh auth login) before using GHPush.

✨ Features

  • 🔄 Dual Operation Modes:
    • AI-Powered Mode: Rich, contextual PR summaries using OpenAI
    • Basic Mode: Simple, effective change summaries
  • 🚀 Automated Workflow: Push your branch and open GitHub's PR page in one command
  • 📊 Smart Diff Analysis: Intelligent analysis of your code changes
  • 🔒 No GitHub Token Needed: Works with your local git configuration
  • 🌐 Cross-Platform: Seamless experience on Windows, macOS, and Linux

🛠 Technical Requirements

  • Python ≥ 3.11
  • Dependencies:

🤝 Contributing

We love contributions! Here's how you can help:

🛠️ Development Setup

  1. Clone the repository:
git clone https://github.com/sukeesh/ghpush
cd ghpush
  1. Set up Python environment:

Using pyenv (Recommended)

# Install Python 3.11.9
pyenv install 3.11.9

# Create a virtual environment
pyenv virtualenv 3.11.9 ghpush-dev

# Activate the environment
pyenv activate ghpush-dev

Using venv (Alternative)

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -e .
  1. Run locally:
# Using Python module directly (recommended for development)
python -m ghpush.cli --base main

# Or after installing in development mode
ghpush --base main

💡 Note: Using pyenv is recommended as it provides better Python version management and isolation.

🔄 Contribution Steps

  1. 🍴 Fork the repository
  2. 🌿 Create your feature branch (git checkout -b feature/amazing-feature)
  3. 💻 Make your changes
  4. ✅ Ensure tests pass
  5. 📝 Update documentation if needed
  6. 🔄 Create a pull request

🧪 Testing

# Install test dependencies
pip install pytest

# Run tests
pytest

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🌟 Show Your Support

If you find GHPush useful, please consider:

  • ⭐ Starring the repository
  • 🐛 Reporting issues
  • 🤝 Contributing to the code
  • 📢 Spreading the word

Made by Sukeesh