Skip to content

Repository files navigation

PR Commentor

繁體中文 | English

AI-powered PR descriptions and titles, generated directly inside GitHub — no copy-pasting required.

PR Commentor

PR Commentor injects a Generate Description button into every GitHub pull request comment box and a Generate Title button next to the PR title field. One click fetches the full diff and commit history from the GitHub API, sends it to your chosen AI model, and inserts the result straight into the text area — ready to submit.


Chrome Web Store

Detailed Description

PR Commentor adds AI-powered "Generate Description" and "Generate Title" buttons directly into the GitHub pull request UI. Stop writing PR descriptions from scratch — let the AI analyze your commits and diffs and do the first draft for you.

How it works

  1. Open any GitHub pull request (or the compare page before opening a PR).
  2. Click Generate Description in the comment toolbar — the extension fetches the PR metadata, all commits, and the full diff from the GitHub API, then sends it to your AI provider.
  3. The generated description is inserted into the comment box immediately. Edit and submit.
  4. Click Generate Title next to the PR title field to get a concise, imperative-mood title (≤ 72 characters) based on the same data.

Features

  • Three AI providers — Claude (Anthropic), GPT (OpenAI) and Gemini (Google). Each keeps its own API key and model, so you can set up all three and switch with one click. Bring your own keys; nothing is stored outside your browser.
  • Two output styles — PR Description produces an overall description with a summary, commit list, and testing notes. Per-commit explains each commit individually, one by one.
  • Output language — 16 languages: English, 繁體中文, 简体中文, 日本語, 한국어, Español, Português, Français, Deutsch, Italiano, Русский, ไทย, Tiếng Việt, Bahasa Indonesia, Türkçe, and Nederlands. Switch at any time in Settings.
  • Custom instructions — two separate fields, one For Title and one For Summary, each prepended to its own prompt (e.g. "Always flag missing tests. Focus on security implications.") to enforce team conventions.
  • Model picker — Fast / Balanced / Best shortcuts pick the newest model in each tier. The searchable list groups models by generation, tags reasoning models, and folds dated snapshots away. Any model name can still be typed in.
  • Connection test — verify your API key and model work before you need them.
  • Private repo support — works with both public and private repositories when your GitHub token has the required scopes.
  • UI language — the settings page itself supports all 16 languages, so you can configure the extension in your preferred language.
  • Inline review comments — Generate Description works not only in the main PR comment box, but also in inline review comment threads during code review.
  • Token visibility toggle — eye icon buttons on the GitHub Token and API Key fields let you show/hide credentials.
  • Model compatibility — Scan leaves out models that cannot generate text here (audio, image, embedding, Responses-API-only). The settings page warns when the chosen model is not in your key's list. Requests adapt to each model generation (token limit parameter, thinking budget, effort), and any parameter a model rejects is dropped and remembered.
  • Dark mode ready — uses GitHub's native CSS custom properties; looks correct in all themes.
  • GitHub SPA navigation — stays active as you navigate between PRs without refreshing the page.

Permissions used

  • storage — saves your settings (tokens, API keys, preferences) locally in your browser via chrome.storage.sync. Nothing is sent to any server other than the GitHub and AI provider APIs you configure.
  • activeTab — reads the current GitHub PR URL to extract owner, repo, and PR number.
  • Host permissions for api.github.com, api.anthropic.com, and api.openai.com — required to fetch PR data and call the AI APIs directly from the extension. The Gemini API allows browser requests, so it needs no extra permission.

Privacy

Your GitHub token and AI API key are stored only in Chrome's encrypted sync storage and are sent only to their respective services (GitHub and your chosen AI provider). PR Commentor does not collect, transmit, or log any data.


Features

Feature Detail
Generate Description Inserts a full PR description (overview + commits + testing notes) into any comment box, including inline review comments
Generate Title Suggests a concise PR title (≤ 72 chars, imperative mood) next to the title field
AI Providers Claude (claude-sonnet-5-5) · GPT (gpt-5-mini) · Gemini (gemini-2.5-flash) — one key per provider, switch any time
Output Style PR Description (overall) or Per-commit (explain each commit individually)
Output Language 16 languages (EN, 繁中, 简中, 日, 한, ES, PT, FR, DE, IT, RU, TH, VI, ID, TR, NL)
UI Language Settings page available in all 16 supported languages
Custom Instructions Separate prefix prompts for Generate Title and Generate Description
Model Picker Fast / Balanced / Best shortcuts, models grouped by generation, dated snapshots folded away
Model Scan Auto-fetches the models your key can use and leaves out ones that cannot generate text
Connection Test One-click API key + model validation
Token Visibility Eye icon toggle to show/hide GitHub Token and API Key fields
Private Repos Supported with a GitHub token with repo scope
Compare Pages Works on /compare/* pages before a PR is created
SPA Navigation Works across GitHub's Turbo/SPA navigation
Dark Mode Uses GitHub CSS variables — adapts to all themes automatically

Installation

From Chrome Web Store (recommended)

Search for PR Commentor in the Chrome Web Store and click Add to Chrome. Direct install link: PR Commentor on Chrome Web Store.

Manual (unpacked)

git clone https://github.com/your-username/pr-commentor.git
cd pr-commentor
npm install
npm run build
  1. Open chrome://extensions
  2. Enable Developer mode (top-right toggle)
  3. Click Load unpacked → select the dist/ folder

Setup

The settings page opens automatically on first install. You can reopen it anytime by clicking the extension icon.

Settings page — GitHub token and AI provider

1. GitHub Personal Access Token

Required to read PR data via the GitHub API.

  • Go to GitHub → Settings → Developer settings → Personal access tokens → Classic
  • Create a token with the repo scope (needed for private repos; public_repo is sufficient for public-only)
  • Paste the token (ghp_…) into the GitHub Token field

Fine-grained tokens require organization admin approval before they work on org repositories. Classic tokens are recommended.

2. AI Provider & API Key

Pick a provider from the list and paste its API key. Every provider keeps its own key and model; the one marked Active is used by the GitHub buttons — click Use this provider to switch.

Provider Where to get a key
Claude (Anthropic) console.anthropic.com
GPT (OpenAI) platform.openai.com
Gemini (Google) aistudio.google.com

Models are scanned automatically once a key is entered. Click Fast, Balanced or Best to take the newest model in that tier, or pick or type any model name. Click Test Connection to confirm everything is working.

3. Output Preferences

Settings page — Output style, language, and custom instructions

Setting Options
Style PR Description · Per-commit
Language 16 languages (EN, 繁中, 简中, 日, 한, ES, PT, FR, DE, IT, RU, TH, VI, ID, TR, NL)
Custom Instructions Free-text; For Title and For Summary are prepended to their respective prompts

Click Save settings when done.


Usage

Generate Title and Generate Description buttons in the GitHub PR UI

Generate a PR Description

  1. Open a GitHub pull request.
  2. Click anywhere in a comment box — PR description, regular comments, or inline review comment threads.
  3. Click the Generate Description button that appears in the comment toolbar.
  4. Wait a few seconds — the AI-generated summary is inserted into the box.
  5. Edit as needed and submit.

Works on PR pages (/pull/*) and on compare pages (/compare/*) before a PR is opened.

Generate a PR Title

  1. Open a GitHub PR or compare page.
  2. Click Generate Title next to the PR title field.
  3. The AI suggests a concise, imperative-mood title based on commits and changed files.

Development

npm install          # Install dependencies
npm run dev          # Build with watch mode (auto-rebuilds on file changes)
npm run build        # Production build → dist/
npm run publish:ext  # Package and publish extension

Note: npm run dev uses vite build --watch instead of vite (Vite dev server). The @crxjs/vite-plugin v2 beta has compatibility issues with Vite 5's dev server — the generated service-worker-loader.js tries to connect to localhost:5173, which doesn't work for Chrome Extension service workers. Using build --watch produces correct output while still auto-rebuilding on every file change. After each rebuild, reload the extension in chrome://extensions to see your changes.

Stack: TypeScript · Vite · @crxjs/vite-plugin · Manifest V3


Privacy & Security

  • All tokens and API keys are stored in chrome.storage.sync (encrypted, synced to your signed-in Chrome profile) and are never sent anywhere except GitHub and your AI provider.
  • PR Commentor does not include any analytics, telemetry, or third-party tracking.
  • The extension only activates on github.com/*/pull/* and github.com/*/compare/* URLs.

License

MIT

About

Generate AI-powered PR summaries and titles directly inside GitHub comment boxes. Supports Claude and OpenAI.

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages