Code2PR: AI-Powered Pull Request Description Generator
🚀 Overview
Code2PR is a VS Code extension that automatically generates comprehensive Pull Request descriptions by analyzing your Git changes using AI. Save time and improve code review quality with intelligent, detailed PR descriptions that help reviewers understand your changes instantly.
✨ Key Features
- 🤖 AI-Powered Analysis: Automatically analyzes your code changes and generates detailed descriptions
- 📊 Comprehensive Summaries: Creates organized, professional PR descriptions with proper categorization
- ⚡ Fast Processing: Supports GPU acceleration for faster analysis (optional)
- 📝 Markdown Format: Outputs clean, formatted descriptions ready for GitHub, GitLab, or Bitbucket
- 🎯 Smart Categorization: Automatically groups and organizes changes by file type and purpose
- 🔍 Change Detection: Identifies new features, bug fixes, refactoring, and breaking changes
- ✅ Review Checklist: Includes helpful review checklists for thorough code reviews
🎯 Benefits
- Save Time: Generate PR descriptions in seconds instead of writing them manually
- Improve Quality: Ensure consistent, detailed documentation for every PR
- Better Reviews: Help reviewers understand changes quickly and thoroughly
- Track Impact: Automatically identify breaking changes and migration requirements
- Professional Output: Create well-structured descriptions that follow best practices
📋 Requirements
- VS Code: Version 1.102.0 or higher
- Python: 3.8 or higher (must be installed on your system)
- Git: Must be installed and repository initialized
- Internet Connection: Required for initial setup and AI model download
Optional
- NVIDIA GPU: For faster processing (automatically detected)
🛠️ Installation
From VS Code Marketplace (Recommended)
- Open VS Code
- Go to Extensions (Ctrl+Shift+X or Cmd+Shift+X on Mac)
- Search for "Code2PR"
- Click Install
- Reload VS Code when prompted
First-Time Setup
When you first use the extension, it will automatically:
- Create a Python virtual environment
- Download required AI models and dependencies
- Configure your system for optimal performance
This one-time setup may take 5-10 minutes depending on your internet speed.
🎮 How to Use
Generate a PR Description
- Make Your Changes: Edit your code and save the files
- Stage/Commit (Optional): You can stage or commit your changes, or just save them
- Generate Description:
- Open Command Palette (Ctrl+Shift+P or Cmd+Shift+P on Mac)
- Type "Generate PR Description"
- Select Code2PR: Generate PR Description
- Wait for Analysis: A progress notification will show while analyzing
- Review Output: A new Markdown document will open with your PR description
- Copy to PR: Copy the generated description to your Pull Request
What Gets Analyzed?
- All modified, added, and deleted files in your Git repository
- Code structure and architectural changes
- Potential impacts and breaking changes
- File categorization and grouping
- Change statistics and summaries
⚙️ Configuration
Access settings: File → Preferences → Settings → Search for "Code2PR"
Available Settings
- Force GPU Usage: Enable this if you have a GPU but it's not automatically detected
- Default:
false
- Set to
true
to force GPU acceleration
📖 Understanding the Output
The generated PR description includes:
1. Executive Summary
- Total files modified
- Lines added/removed
- High-level overview of changes
2. File Categories
Your changes are organized into:
- 📦 Package & Configuration
- 🐍 Python Code
- 🌐 JavaScript/TypeScript
- 📚 Documentation
- 🧪 Tests
- ⚙️ Configuration Files
- 🔨 Build & Deploy Scripts
3. Detailed Analysis
For each file:
- Change type (New, Modified, Deleted)
- Impact level (Low, Medium, High)
- Summary of changes
- Technical context
- Potential impacts
4. Review Checklist
A comprehensive checklist covering:
- Code quality
- Functionality
- Performance
- Security
- Testing
- Documentation
🔧 Troubleshooting
Extension Not Working?
Check Python Installation
- Open terminal and run:
python --version
(Windows) or python3 --version
(Mac/Linux)
- Should show Python 3.8 or higher
Verify Git Repository
- Ensure you're in a Git repository
- Check for
.git
folder in your workspace
View Logs
- Go to View → Output
- Select "Code2PR" from dropdown
- Check for error messages
Common Issues
"No workspace folder found"
- Open a folder in VS Code (File → Open Folder)
"Python not found"
- Install Python from python.org
- Restart VS Code after installation
"No changes found"
- Make sure you have saved your file changes
- Verify you have uncommitted changes:
git status
Slow Performance
- First run downloads AI models (one-time)
- Consider enabling GPU support if available
- Close other heavy applications
Reset Extension
If you encounter persistent issues:
- Delete the virtual environment folder:
.venv
in your workspace
- Reload VS Code
- Run the command again (will recreate environment)
💡 Tips for Best Results
- Save All Files: Ensure all your changes are saved before generating
- Clear Commits: Works best with focused, related changes
- GPU Acceleration: If you have an NVIDIA GPU, the extension will use it automatically
- Review Output: Always review and customize the generated description
- Add Context: Supplement the generated description with business context when needed
🔒 Privacy & Security
- Local Processing: All analysis happens locally on your machine
- No Code Upload: Your code is never sent to external servers
- Offline Capable: After initial setup, works without internet
- Secure: Uses official Microsoft AI models
🗺️ What's Next?
Current Version (0.0.1)
- ✅ Basic PR description generation
- ✅ AI-powered analysis
- ✅ File categorization
- ✅ GPU support
Coming Soon
- Support for custom templates
- Multiple language support
- Integration with GitHub/GitLab APIs
- Team collaboration features
- Custom AI models
🏆 Credits
Created by Karthick Raja M
AI/ML Engineer & Full Stack Developer
Enjoy using Code2PR! 🎉
Making code reviews smarter, one PR at a time