AI-powered Pull Request description generator with multi-provider support
Automatically generate professional Pull Request descriptions using AI. Supports multiple AI providers including DeepSeek, OpenAI, OpenRouter, and Google Gemini.
# install
npm install -g pr-automator
# config ai tokens (only onces)
pra config
# create pr
pra create
That's it! 🎉
- 🤖 Multi-AI Provider Support: DeepSeek, OpenAI, OpenRouter, Google Gemini
- 📝 Smart PR Generation: Analyzes git diffs and generates comprehensive PR descriptions
- ⚙️ Easy Configuration: Simple CLI commands for setup and management
- 🔒 Secure: API keys stored securely in user configuration
- 🎯 Conventional Commits: Generates titles following conventional commit standards
- 🚀 GitHub Integration: Seamless integration with GitHub CLI
# Install globally
npm install -g pr-automator
# Or install locally
npm install pr-automator
- Node.js 14+
- Git
- GitHub CLI (
gh
)
📦 Installing GitHub CLI
macOS:
brew install gh
# or
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update && sudo apt install gh
Windows:
winget install GitHub.cli
# or
choco install gh
# or
scoop install gh
Linux:
# Ubuntu/Debian
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update && sudo apt install gh
# CentOS/RHEL/Fedora
sudo dnf install gh
# or
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update && sudo apt install gh
Verify:
gh --version
Gh login
gh auth login
-
Configure your AI provider:
pra config
This will start an interactive setup process.
-
Or configure manually:
pra config AI_PROVIDER "deepseek" pra config API_KEY "your-api-key-here" pra config MODEL "deepseek-chat"
-
Check your configuration:
pra status
# Create a PR with AI-generated description
pra create
# Preview PR description without creating (dry run)
pra create --dry-run
Configure AI provider settings.
# Interactive configuration
pra config
# Set specific values
pra config AI_PROVIDER "openai"
pra config API_KEY "sk-..."
pra config MODEL "gpt-4-turbo"
# View specific config
pra config AI_PROVIDER
List all available AI providers with descriptions.
pra list-providers
Show current configuration status and readiness.
pra status
Create a Pull Request with AI-generated description.
# Create PR
pra create
# Dry run (preview without creating)
pra create --dry-run
Provider | Description | Default Model |
---|---|---|
deepseek |
DeepSeek AI - Fast and reliable AI service | deepseek-chat |
openai |
OpenAI GPT - Industry leading AI models | gpt-4-turbo |
openrouter |
OpenRouter - Access to multiple AI providers | google/gemini-pro |
gemini |
Google Gemini - Advanced AI from Google | gemini-pro |
Configuration is stored in ~/.pr-automator
(i.e. $HOME/.pr-automator
) as a simple text file with KEY=VALUE format.
Example configuration file:
# PR Automator Configuration
# This file contains your AI provider settings
# Format: KEY=VALUE
AI_PROVIDER=deepseek
API_KEY=your-api-key-here
MODEL=deepseek-chat
You can also use environment variables instead of the config command:
export AI_PROVIDER="deepseek"
export API_KEY="your-api-key"
export MODEL="deepseek-chat"
The tool generates PR descriptions in the following format:
**Title:** 🚀 feat: Add user authentication system
**Overview:** Implement comprehensive user authentication with JWT tokens and role-based access control.
**Key Features Implemented:**
- 🔐 JWT-based authentication system
- 👥 Role-based access control (RBAC)
- 🔒 Password hashing with bcrypt
- 📧 Email verification flow
- 🛡️ Rate limiting for login attempts
**Technical Details:**
- Added authentication middleware using Express.js
- Implemented JWT token generation and validation
- Created user model with Mongoose schema
- Added bcrypt password hashing for security
- Integrated email service for verification
**Future Enhancements:**
- Add OAuth integration (Google, GitHub)
- Implement password reset functionality
- Add session management
pr-automator/
├── src/
│ ├── cli.js # Command-line interface
│ ├── config.js # Configuration management
│ ├── ai-providers.js # AI provider configurations
│ ├── pr-generator.js # Core PR generation logic
│ └── index.js # Module exports
├── package.json
└── README.md
# Clone the repository
git clone https://github.com/vincentqyw/pr-automator.git
cd pr-automator
# Install dependencies
npm install
# Link for local development
npm link
# Run the tool
pra --help
- Visit DeepSeek Console
- Create an account and get your API key
- Configure:
pra config AI_PROVIDER "deepseek"
- Visit OpenAI Platform
- Create an API key
- Configure:
pra config AI_PROVIDER "openai"
- Visit OpenRouter
- Get your API key
- Configure:
pra config AI_PROVIDER "openrouter"
- Visit Google AI Studio
- Create an API key
- Configure:
pra config AI_PROVIDER "gemini"
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
"Missing critical dependencies"
- Ensure Git and GitHub CLI are installed
- Run
git --version
andgh --version
to verify
"Configuration is incomplete"
- Run
pra config
to set up your AI provider - Check
pra status
for current configuration
"API analysis failed"
- Verify your API key is correct
- Check your AI provider's service status
- Ensure you have sufficient API credits
"No changes detected"
- Make sure you're on a feature branch
- Ensure you have commits ahead of
origin/main
- Check the status:
pra status
- List available providers:
pra list-providers
- View help:
pra --help
- Built with Commander.js for CLI
- Interactive prompts with Inquirer.js
- Beautiful CLI output with Chalk
Made with ❤️ for developers who love clean, professional Pull Requests.