Skip to main content

Export GitHub PR review comments to AI-friendly Markdown

Project description

pr-bridge

Version 1.0.0

Export GitHub PR review comments to an AI-friendly Markdown file — so your AI coding assistant gets the full context without you having to copy-paste anything.

The Problem

When working with an AI assistant (like GitHub Copilot) on a pull request, explaining reviewer feedback is tedious:

  • You copy-paste comments manually
  • The AI has no context about which line the comment refers to
  • You lose the diff context
  • Threading (replies) is invisible

pr-bridge solves this by fetching all PR review data via the GitHub CLI and formatting it into a structured Markdown file that any AI agent can read directly.

Requirements

  • GitHub CLI (gh) — installed and authenticated (gh auth login)
  • uv — modern Python package manager (only needed for installation from Github)*

Installation

From PyPI (recommended)

pip install pr-bridge

Or with uv:

uv tool install pr-bridge

From GitHub

# Install directly from GitHub
uv tool install git+https://github.com/filipembedded/pr-bridge.git

# Or install in editable mode from a local clone
git clone https://github.com/filipembedded/pr-bridge.git
cd pr-bridge
uv tool install -e .

Install uv if you don't have it yet:

curl -LsSf https://astral.sh/uv/install.sh | sh

Usage

# Fetch all review comments for a PR
pr-bridge fetch https://github.com/owner/repo/pull/123

# Fetch only unresolved (unanswered) threads
pr-bridge fetch https://github.com/owner/repo/pull/123 --filter unresolved

# Save output to a specific directory
pr-bridge fetch https://github.com/owner/repo/pull/123 --output ./reviews/

# Save to a specific file
pr-bridge fetch https://github.com/owner/repo/pull/123 --output my-review.md

# Exclude general (non-inline) comments
pr-bridge fetch https://github.com/owner/repo/pull/123 --no-general

The output file is saved as pr-<NUMBER>-<owner>-<repo>.md in the current directory (or the path you specify).

Output Format

The generated Markdown is structured for AI consumption:

# PR #123: Fix something important

- Repository: owner/repo
- Author: @someone
- State: open
- Branch: `fix/something` → `main`

## Review Summaries
- @reviewer — `CHANGES_REQUESTED` (2024-01-15)

## Inline Review Comments

---
## File: `src/main.c`

### Thread 1 — `src/main.c` (line 42) [**OPEN**]

**Diff context:**
\`\`\`diff
+int foo() {
+    return bar;
+}
\`\`\`

**@reviewer** (member) · 2024-01-15
[view on GitHub](https://github.com/...)

This function is never called. Consider removing it.

Options

Option Description
--filter all Show all threads (default)
--filter unresolved Show only threads with no replies
--output PATH Output directory or file (default: current directory)
--no-general Exclude general PR comments
--version Show version

How It Works

  1. Parses the GitHub PR URL to extract owner, repo, and PR number
  2. Uses gh api to fetch inline comments, general comments, and review summaries
  3. Groups inline comments into threads (root comment + replies)
  4. Renders everything as structured Markdown
  5. Saves the file locally for your AI assistant to read

Contributing

Contributions are welcome! Please open an issue or pull request on GitHub.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pr_bridge-1.0.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pr_bridge-1.0.0-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file pr_bridge-1.0.0.tar.gz.

File metadata

  • Download URL: pr_bridge-1.0.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.19

File hashes

Hashes for pr_bridge-1.0.0.tar.gz
Algorithm Hash digest
SHA256 352a3f991375fd7db52c6dd22370a6fe0b1e734acb13beb02d5cb4a4f983a3cc
MD5 4b72759a5ab39b38f1aa7b0e3aa69a2d
BLAKE2b-256 3da62081b68e25a4ecc3793fe76fd0fe3735b17e8bd8aba86e18828fd8a3b97e

See more details on using hashes here.

File details

Details for the file pr_bridge-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pr_bridge-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.19

File hashes

Hashes for pr_bridge-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 250c74962d78a79ef9a2dbfba8fe73583b604efaa1535971a70f46d1dba079ad
MD5 322c7355afc6172ed9df3015931d170f
BLAKE2b-256 d42f98d8fbf2b78c6599bb3241cb9895c329fe301cf07fc25df30b3e7776db4d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page