Create a Pull Request with interactive branch selection
quick create pr with interactive branch selection
# Using npm
npm install -g qkpr
# Using pnpm
pnpm add -g qkpr
# Using yarn
yarn global add qkprqkpr provides a Claude Code skill for better AI assistant integration. To install:
# 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.mdmkdir -p .claude/skills/qkpr
curl -o .claude/skills/qkpr/SKILL.md \
https://raw.githubusercontent.com/KazooTTT/qkpr/main/skills/qkpr/SKILL.mdOnce 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"
Navigate to your git repository and run:
qkprThe 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
You can directly access the PR creation feature:
qkpr pr
# or specify the target branch directly
qkpr pr mainThe CLI will interactively guide you through creating a pull request:
- Repository Detection: Automatically detects the current Git repository
- Branch Selection: Interactively select the target branch with search functionality
- PR Generation: Generates a standardized PR description with commit summaries
- Clipboard Integration: Copies the PR description to your clipboard
- Browser Launch: Opens the PR page in your default browser
- Merge Branch: Optionally creates a suggested merge branch for conflict resolution
Generate commit messages automatically using AI:
qkpr commitFeatures:
- π€ 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
-
Get your Gemini API Key from Google AI Studio
-
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.
By default, the tool uses gemini-2.0-flash. You can configure a different model:
qkpr config:modelThe tool will:
- Dynamically fetch all available models from Google's API (if API key is configured)
- Display a list of models to choose from
- Allow custom model name input
Common Gemini models include (updated 2025.11.17, fetched from Google API):
Common Gemini Models:
gemini-2.5-progemini-2.5-flashgemini-2.0-flash(default)gemini-2.0-flash-expgemini-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# 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- π§ 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
- π€ 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
- π Auto Update Check: Notifies when new version is available
- βοΈ Easy Configuration: Simple setup for API keys
- π¨ Beautiful UI: Colorful and intuitive terminal interface
qkprShows an interactive menu to choose from all available features
qkpr prDirectly create a pull request with interactive branch selection. You can also specify the target branch directly:
qkpr pr [branch]qkpr commitDirectly generate commit message using AI (requires Gemini API key)
qkpr branchDirectly generate a semantic branch name based on your staged changes using AI (requires Gemini API key)
qkpr configConfigure Gemini API key for AI features
qkpr config:modelConfigure Gemini model for AI commit message generation
qkpr --version
# or
qkpr -vqkpr --help
# or
qkpr -hgitversion 2.0+- Node.js version 18+
- Gemini API key (for AI commit feature) - Get it from Google AI Studio
Contributions, issues, and feature requests are welcome!
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