- AI-Powered Generation — Analyzes commits and code diffs to produce Conventional Commit titles and structured PR descriptions.
- Hybrid Operation
- Local Mode — Use your own Gemini API key directly in the browser. No backend required.
- Service Mode — Connect to a hosted backend for shared team usage, caching, and centralized key management.
- Privacy & Efficiency
- Filters lockfiles (
package-lock.json,yarn.lock,pnpm-lock.yaml,.env) automatically. - Cleans git diff metadata to save tokens and reduce noise.
- User consent prompt before sending code data to any external service.
- Filters lockfiles (
- Security Hardened
- Explicit Content Security Policy (CSP) in manifest.
- API keys stored obfuscated (XOR + base64) in local storage — never plaintext.
- Minimal permissions: only
storageandactiveTab. - Scoped host permissions to GitHub PR/compare pages and Gemini API only.
- Service URL validated before use. No
innerHTML— all DOM built via safe APIs.
- Native Experience — Injects seamlessly into GitHub PR pages with a UI matching GitHub's design system.
git clone https://github.com/arifintahu/pr-please.git
cd pr-please/extension
npm install
npm run buildThen load in Chrome:
- Open
chrome://extensions/ - Enable Developer mode (top right toggle).
- Click Load unpacked.
- Select the
extension/distfolder.
Required only for Service Mode (e.g., shared team usage).
cd service
npm install
cp .env.example .envConfigure .env:
GEMINI_API_KEY=your_actual_api_key
PORT=3000
GEMINI_MODEL=gemini-2.5-flash
# Optional: Custom Gemini API Base URL (e.g. for proxies)
# GOOGLE_GEMINI_BASE_URL=https://generativelanguage.googleapis.comStart the server:
npm run build
npm start
# or for development:
npm run devThe service exposes:
GET /ping— Health checkPOST /generate— Accepts{ commits, diff }, returns{ title, description }
Click the PR-Please extension icon in your browser toolbar to configure.
Ideal for teams.
- Select Service mode.
- Enter the Service URL (default:
http://localhost:3000). - The extension will verify the connection via
/ping. - Click Save Settings.
Ideal for individual developers.
- Select Local mode.
- Enter your Google Gemini API Key.
- Choose your model (e.g.,
gemini-2.5-flash). - Click Save Settings.
Your API key is stored obfuscated in the browser's local storage and persists across sessions.
- Push your changes to GitHub.
- Open a Compare & pull request page.
- Click the Generate with AI button next to the PR title field.
- A consent dialog confirms the destination before sending your code.
- Review the generated title and description in the result bar.
- Click Apply to insert them into the form.
MIT