Skip to content

arifintahu/pr-please

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PR-Please Logo

PR-Please

Generate structured GitHub Pull Request titles and descriptions instantly

Features

  • 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.
  • Security Hardened
    • Explicit Content Security Policy (CSP) in manifest.
    • API keys stored obfuscated (XOR + base64) in local storage — never plaintext.
    • Minimal permissions: only storage and activeTab.
    • 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.

Installation

1. Chrome Extension (Required)

git clone https://github.com/arifintahu/pr-please.git
cd pr-please/extension
npm install
npm run build

Then load in Chrome:

  1. Open chrome://extensions/
  2. Enable Developer mode (top right toggle).
  3. Click Load unpacked.
  4. Select the extension/dist folder.

2. Backend Service (Optional)

Required only for Service Mode (e.g., shared team usage).

cd service
npm install
cp .env.example .env

Configure .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.com

Start the server:

npm run build
npm start
# or for development:
npm run dev

The service exposes:

  • GET /ping — Health check
  • POST /generate — Accepts { commits, diff }, returns { title, description }

Configuration

Click the PR-Please extension icon in your browser toolbar to configure.

Service Mode (Default)

Ideal for teams.

  1. Select Service mode.
  2. Enter the Service URL (default: http://localhost:3000).
  3. The extension will verify the connection via /ping.
  4. Click Save Settings.

Local Mode

Ideal for individual developers.

  1. Select Local mode.
  2. Enter your Google Gemini API Key.
  3. Choose your model (e.g., gemini-2.5-flash).
  4. Click Save Settings.

Your API key is stored obfuscated in the browser's local storage and persists across sessions.

How to Use

  1. Push your changes to GitHub.
  2. Open a Compare & pull request page.
  3. Click the Generate with AI button next to the PR title field.
  4. A consent dialog confirms the destination before sending your code.
  5. Review the generated title and description in the result bar.
  6. Click Apply to insert them into the form.

License

MIT

About

Chrome Extension for generating structured GitHub Pull Request titles and descriptions instantly

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors