An AI-powered Chrome extension that generates professional Pull Request descriptions and titles based on your code changes. Now supports both GitHub and GitLab! Works with OpenAI (ChatGPT) and Google Gemini APIs.
🚀 Smart PR/MR Generation: Automatically generates PR titles and descriptions based on:
- File changes and diff statistics
- Commit messages
- Existing PR/MR templates
- Configurable rules and preferences
🌍 Multi-Platform Support:
- GitHub: Pull Requests (PRs)
- GitLab: Merge Requests (MRs)
🔑 Multiple AI Providers:
- OpenAI (GPT-3.5, GPT-4, GPT-4 Turbo)
- Google Gemini (Gemini Pro, Gemini Pro Vision)
⚙️ Customizable Rules:
- Title formats (Conventional Commits, Descriptive, Custom)
- Description sections (Summary, Changes, Testing, Breaking Changes) or custom templates
- Content length limits
- Template integration
🎨 Clean UI: Modern, GitHub/GitLab-integrated interface that feels native to each platform
-
Clone this repository:
git clone <repository-url> cd prs-ai
-
Install dependencies:
npm install
-
Build the extension:
npm run build
-
Load the extension in Chrome:
- Open Chrome and go to
chrome://extensions/ - Enable "Developer mode" in the top right
- Click "Load unpacked"
- Select the
distfolder from this project
- Open Chrome and go to
To create a distributable .zip file:
npm run packageThis creates prs-ai-extension.zip in the project root.
OpenAI (ChatGPT):
- Visit OpenAI API Keys
- Sign in or create an account
- Click "Create new secret key"
- Copy the key and add it in the extension settings
Google Gemini:
- Visit Google AI Studio
- Sign in with your Google account
- Click "Create API key"
- Copy the key and add it in the extension settings
- After installation, the extension will open the settings page
- Add your API keys for OpenAI and/or Gemini
- Test the API keys to ensure they work
- Customize generation rules to match your preferences
- Save settings
-
Navigate to a PR/MR creation page:
GitHub:
- Creating a new PR from a branch comparison
- Opening an existing PR for editing
GitLab:
- Creating a new Merge Request
- Editing an existing Merge Request
-
Generate content:
- Click the "Generate with AI" button near the PR/MR description
- The extension will analyze code changes and generate appropriate content
- Review and modify the generated title and description as needed
-
Regenerate if needed:
- Use the "Regenerate" button to get alternative content
- Adjust settings for different results
src/
├── background/ # Service worker
├── content/ # GitHub/GitLab page integration
├── popup/ # Extension popup UI
├── options/ # Settings page
├── constants/ # Platform-specific configurations
├── utils/ # Platform detection and data extraction
└── shared/ # Common utilities and types
# Development build with watch mode
npm run dev
# Production build
npm run build
# Clean build directory
npm run clean
# Package for distribution
npm run package- TypeScript - Type-safe development
- React - UI components
- Webpack - Bundling and building
- Chrome Extensions Manifest V3 - Modern extension architecture
- Validates API keys before use
- Fallback between providers (tries OpenAI first, then Gemini)
- Configurable models for each provider
- Error handling and user feedback
GitHub:
- Detects PR creation and edit pages
- Extracts file changes, commit messages, and existing templates
- Preserves existing PR template structure
- Non-intrusive UI that matches GitHub's design
GitLab:
- Detects Merge Request creation and edit pages
- Extracts file changes, commit messages, and existing templates
- Integrates seamlessly with GitLab's interface
- Supports both GitLab.com and self-hosted instances
- Title Formats: Conventional Commits, descriptive, or custom templates
- Content Sections: Choose which sections to include in descriptions
- Analysis Scope: Include/exclude file changes and commit messages
- Length Limits: Configure maximum description length
- API keys are stored locally in Chrome's sync storage
- No data is sent to external servers except AI providers
- All communication uses HTTPS
- Open source - audit the code yourself
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
MIT License - see LICENSE file for details
For issues, questions, or feature requests, please:
- Open an issue on GitHub
- Check existing issues for solutions
- Provide detailed information about your setup
Note: This extension requires API keys from OpenAI and/or Google to function. Free tier limits may apply depending on your API provider.