Skip to content

KazooTTT/qkpr

Repository files navigation

qkpr

npm version npm downloads License

Create a Pull Request with interactive branch selection

Usage Demo

quick create pr with interactive branch selection

demo

Installation

# Using npm
npm install -g qkpr

# Using pnpm
pnpm add -g qkpr

# Using yarn
yarn global add qkpr

Claude Code Integration

qkpr provides a Claude Code skill for better AI assistant integration. To install:

Global Installation (Recommended)

# From npm (if installed globally)
cp -r $(npm root -g)/qkpr/skills/qkpr ~/.claude/skills/

# From pnpm
cp -r $(pnpm root -g)/qkpr/skills/qkpr ~/.claude/skills/

# Or download directly
mkdir -p ~/.claude/skills/qkpr
curl -o ~/.claude/skills/qkpr/SKILL.md \
  https://raw.githubusercontent.com/KazooTTT/qkpr/main/skills/qkpr/SKILL.md

Project-Specific Installation

mkdir -p .claude/skills/qkpr
curl -o .claude/skills/qkpr/SKILL.md \
  https://raw.githubusercontent.com/KazooTTT/qkpr/main/skills/qkpr/SKILL.md

Once installed, you can ask Claude Code to:

  • "Create a PR for this branch using qkpr"
  • "Generate a commit message with qkpr"
  • "Suggest a branch name for my changes"

Usage

Interactive Menu

Navigate to your git repository and run:

qkpr

The CLI will show an interactive menu where you can choose from all available features:

  • πŸ”§ Create Pull Request
  • πŸ€– Generate Commit Message
  • 🌿 Generate Branch Name
  • βš™οΈ Configure API Key
  • πŸ”§ Configure Model

Create Pull Request

You can directly access the PR creation feature:

qkpr pr
# or specify the target branch directly
qkpr pr main

The CLI will interactively guide you through creating a pull request:

  1. Repository Detection: Automatically detects the current Git repository
  2. Branch Selection: Interactively select the target branch with search functionality
  3. PR Generation: Generates a standardized PR description with commit summaries
  4. Clipboard Integration: Copies the PR description to your clipboard
  5. Browser Launch: Opens the PR page in your default browser
  6. Merge Branch: Optionally creates a suggested merge branch for conflict resolution

AI-Powered Commit Message Generation

Generate commit messages automatically using AI:

qkpr commit

Features:

  • πŸ€– AI-Powered: Uses Google Gemini 2.0 Flash to analyze your changes
  • πŸ“ Angular Convention: Follows Angular commit message standards
  • 🌿 Branch Name Suggestion: Suggests appropriate branch names based on changes
  • 🎯 Smart Analysis: Analyzes staged changes (git diff --cached)
  • βœ… Interactive: Choose to commit, copy, or regenerate
  • πŸš€ Auto Push: Option to automatically push the commit to the remote repository

First Time Setup

  1. Get your Gemini API Key from Google AI Studio

  2. Configure your API key (choose one method):

    • Method 1: Using config command

      qkpr config
    • Method 2: Using environment variable

      export QUICK_PR_GEMINI_API_KEY=your_api_key_here
      # or use the legacy variable name
      export GEMINI_API_KEY=your_api_key_here

Or the tool will prompt you to enter it on first use.

Model Configuration

By default, the tool uses gemini-2.0-flash. You can configure a different model:

qkpr config:model

The tool will:

  1. Dynamically fetch all available models from Google's API (if API key is configured)
  2. Display a list of models to choose from
  3. Allow custom model name input

Common Gemini models include (updated 2025.11.17, fetched from Google API):

Common Gemini Models:

  • gemini-2.5-pro
  • gemini-2.5-flash
  • gemini-2.0-flash (default)
  • gemini-2.0-flash-exp
  • gemini-flash-latest

You can also set the model via environment variable:

export QUICK_PR_GEMINI_MODEL=gemini-2.5-pro
# or use the legacy variable name
export GEMINI_MODEL=gemini-2.5-pro

Workflow Example

# Stage your changes
git add .

# Generate commit message
qkpr commit

# The tool will:
# 1. Analyze your staged changes
# 2. Generate a commit message following Angular conventions
# 3. Suggest a branch name
# 4. Ask if you want to commit, copy to clipboard, or regenerate

Features

Pull Request Creation

  • πŸ”§ Interactive Branch Selection: Choose target branch with search functionality
  • πŸ“Œ Protected Branches: Highlights and pins important branches (main, master, etc.)
  • πŸ—‚οΈ Smart Categorization: Groups branches by prefix (feat/, fix/, merge/, etc.)
  • ⏰ Time Display: Shows last commit time for each branch
  • πŸ“‹ Auto-Generated PR Description: Includes commit summaries and formatted content
  • πŸ“‹ Clipboard Integration: Automatically copies PR description to clipboard
  • 🌐 Browser Integration: Opens PR comparison page automatically
  • πŸ”„ Merge Branch Suggestion: Offers to create a merge resolution branch
  • 🏷️ Multi-Platform Support: Compatible with GitHub, GitLab, and Gitee

AI Commit Messages

  • πŸ€– Gemini AI: Powered by Google Gemini 2.0 Flash
  • πŸ“ Angular Convention: Follows industry-standard commit message format
  • 🌿 Branch Naming: Suggests semantic branch names
  • πŸ” Smart Analysis: Analyzes git diff to understand changes
  • πŸ’Ύ Secure Storage: API key stored locally in ~/.qkpr/config.json

Other Features

  • πŸ”„ Auto Update Check: Notifies when new version is available
  • βš™οΈ Easy Configuration: Simple setup for API keys
  • 🎨 Beautiful UI: Colorful and intuitive terminal interface

Available Commands

Interactive Menu (Default)

qkpr

Shows an interactive menu to choose from all available features

Create PR

qkpr pr

Directly create a pull request with interactive branch selection. You can also specify the target branch directly:

qkpr pr [branch]

Generate Commit Message

qkpr commit

Directly generate commit message using AI (requires Gemini API key)

Generate Branch Name

qkpr branch

Directly generate a semantic branch name based on your staged changes using AI (requires Gemini API key)

Configuration

qkpr config

Configure Gemini API key for AI features

qkpr config:model

Configure Gemini model for AI commit message generation

Version

qkpr --version
# or
qkpr -v

Help

qkpr --help
# or
qkpr -h

Requirements

  • git version 2.0+
  • Node.js version 18+
  • Gemini API key (for AI commit feature) - Get it from Google AI Studio

License

MIT License Β© KazooTTT

Contributing

Contributions, issues, and feature requests are welcome!

Note for Developers

This project uses pnpm workspaces and tsdown for building. For development:

# Install dependencies
pnpm install

# Build the project
pnpm run build

# Run tests
pnpm run test

# Lint
pnpm run lint

About

create pr quickly

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

 
 
 

Contributors