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
- Parses the GitHub PR URL to extract owner, repo, and PR number
- Uses
gh apito fetch inline comments, general comments, and review summaries - Groups inline comments into threads (root comment + replies)
- Renders everything as structured Markdown
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
352a3f991375fd7db52c6dd22370a6fe0b1e734acb13beb02d5cb4a4f983a3cc
|
|
| MD5 |
4b72759a5ab39b38f1aa7b0e3aa69a2d
|
|
| BLAKE2b-256 |
3da62081b68e25a4ecc3793fe76fd0fe3735b17e8bd8aba86e18828fd8a3b97e
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
250c74962d78a79ef9a2dbfba8fe73583b604efaa1535971a70f46d1dba079ad
|
|
| MD5 |
322c7355afc6172ed9df3015931d170f
|
|
| BLAKE2b-256 |
d42f98d8fbf2b78c6599bb3241cb9895c329fe301cf07fc25df30b3e7776db4d
|