@hempun10/prflow
v1.0.0
Published
AI-powered CLI tool for creating beautiful, template-aware pull requests
Maintainers
Readme
PRflow ✈️
AI-powered CLI for creating beautiful, template-aware pull requests
PRflow streamlines your pull request workflow by intelligently generating PR descriptions from your commits, filling in templates automatically, and remembering your team's preferences.
✨ Features
- 🤖 AI-Powered Descriptions - Generate PR descriptions from commits using OpenAI, Anthropic, or local Ollama
- 📝 Template-Aware - Automatically detects and fills your PR template
- 🧠 Team Learning - Remembers your frequently used reviewers and labels
- 📋 Conventional Commits - Understands and leverages conventional commit format
- 👀 Preview Mode - Review your PR before creating
- ✏️ Editor Integration - Edit descriptions in vim, nano, or VS Code
- 🔌 Offline Mode - Works without AI when needed
🚀 Quick Start
# Install globally
npm install -g prflow
# Or use npx
npx prflow
# Create a PR (from your feature branch)
prflow
# Or use the short alias
prf📖 Usage
Create a Pull Request
# Basic usage - creates PR from current branch to main
prflow
# Specify base branch
prflow develop
# Create as draft
prflow --draft
# Preview before creating
prflow --preview
# Skip AI generation
prflow --no-aiConfiguration
# Interactive configuration wizard
prflow config
# Show current configuration
prflow config --show
# Configure globally
prflow config --global
# Configure for current project
prflow config --local
# Clear team learning data
prflow config --clear-learningInitialize in a Repository
# Create .prflowrc.json
prflow init
# Also create a PR template
prflow init --template⚙️ Configuration
PRflow looks for configuration in the following order:
.prflowrc.jsonin current directory.prflowrc.yamlin current directoryprflowkey inpackage.json- Global
~/.prflowrc.json - Environment variables
Example Configuration
{
"ai": {
"provider": "openai",
"model": "gpt-4o"
},
"editor": "vim",
"defaults": {
"assignSelf": true,
"draft": false,
"labels": [],
"reviewers": []
}
}Environment Variables
| Variable | Description |
|----------|-------------|
| GITHUB_TOKEN | GitHub personal access token (required) |
| OPENAI_API_KEY | OpenAI API key |
| ANTHROPIC_API_KEY | Anthropic API key |
| PR_PILOT_AI_PROVIDER | Override AI provider |
| PR_PILOT_AI_MODEL | Override AI model |
🤖 AI Providers
OpenAI (Default)
{
"ai": {
"provider": "openai",
"model": "gpt-4o"
}
}Anthropic (Claude)
{
"ai": {
"provider": "anthropic",
"model": "claude-sonnet-4-20250514"
}
}Ollama (Local)
{
"ai": {
"provider": "ollama",
"model": "llama3.2",
"baseUrl": "http://localhost:11434"
}
}Offline Mode
{
"ai": {
"provider": "none"
}
}📝 PR Templates
PRflow automatically detects templates in these locations:
.github/PULL_REQUEST_TEMPLATE.md.github/pull_request_template.mdPULL_REQUEST_TEMPLATE.mddocs/PULL_REQUEST_TEMPLATE.md
When a template is found, PRflow will:
- Parse all sections (Description, Impact, etc.)
- Detect checkboxes and type selections
- Fill in content intelligently using AI
- Preserve your template structure
🧠 Team Learning
PRflow remembers your preferences:
- Reviewers - Frequently selected reviewers appear first with ⭐
- Labels - Often-used labels are prioritized
Data is stored locally and persists across sessions.
🎯 Workflow Example
# 1. Create a feature branch
git checkout -b feature/user-authentication
# 2. Make commits (conventional commits work best)
git commit -m "feat(auth): add JWT token validation"
git commit -m "feat(auth): implement login endpoint"
git commit -m "test(auth): add authentication tests"
# 3. Create PR with PRflow
prflow
# PRflow will:
# ✅ Analyze your commits
# ✅ Detect conventional commit format
# ✅ Generate AI description
# ✅ Fill in your PR template
# ✅ Suggest relevant labels
# ✅ Show frequent reviewers first
# ✅ Preview before creating
# ✅ Create the PR with all metadata🛠️ Development
# Clone the repository
git clone https://github.com/yourusername/prflow.git
cd prflow
# Install dependencies
npm install
# Build
npm run build
# Run in development
npm run dev
# Link for local testing
npm link📄 License
MIT © Your Name
Built with ❤️ for the GitHub Copilot CLI Challenge
