{"id":41374551,"url":"https://github.com/agynio/gh-pr-review","last_synced_at":"2026-02-20T14:03:27.331Z","repository":{"id":334040810,"uuid":"1111758752","full_name":"agynio/gh-pr-review","owner":"agynio","description":"GitHub CLI extension that adds full inline PR review comment support — view, navigate, reply to, and resolve review threads directly from the terminal. LLM-ready and ideal for automated PR review agents.","archived":false,"fork":false,"pushed_at":"2026-01-28T08:33:34.000Z","size":273,"stargazers_count":55,"open_issues_count":4,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-02T02:38:30.571Z","etag":null,"topics":["ai-agents","automation","code-review","command-line","developer-tools","devops","gh-extension","github","github-cli","go","inline-comments","llm-tools","pull-requests","review-threads","skill","terminal"],"latest_commit_sha":null,"homepage":"https://agyn.io","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agynio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"docs/AGENTS.md","dco":null,"cla":null}},"created_at":"2025-12-07T15:28:50.000Z","updated_at":"2026-02-01T16:51:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/agynio/gh-pr-review","commit_stats":null,"previous_names":["agynio/gh-pr-review"],"tags_count":34,"template":false,"template_full_name":null,"purl":"pkg:github/agynio/gh-pr-review","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agynio%2Fgh-pr-review","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agynio%2Fgh-pr-review/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agynio%2Fgh-pr-review/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agynio%2Fgh-pr-review/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agynio","download_url":"https://codeload.github.com/agynio/gh-pr-review/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agynio%2Fgh-pr-review/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29653477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T09:27:29.698Z","status":"ssl_error","status_checked_at":"2026-02-20T09:26:12.373Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agents","automation","code-review","command-line","developer-tools","devops","gh-extension","github","github-cli","go","inline-comments","llm-tools","pull-requests","review-threads","skill","terminal"],"created_at":"2026-01-23T10:00:30.291Z","updated_at":"2026-02-20T14:03:27.312Z","avatar_url":"https://github.com/agynio.png","language":"Go","funding_links":[],"categories":["Go","🧩 Categories","PR \u0026 Issues"],"sub_categories":["UI / Dashboard"],"readme":"# gh-pr-review\n[![Agyn badge](https://agyn.io/badges/badge_dark.svg)](http://agyn.io)\n\n`gh-pr-review` is a GitHub CLI extension that finally brings **inline PR review comments** to the terminal.  \nGitHub’s built-in `gh` tool does *not* show inline comments or review threads — but this extension does.\n\nWith `gh-pr-review`, you can:\n\n- View complete **inline review threads** with file and line context  \n- See **unresolved comments** during code review  \n- Reply to inline comments directly from the terminal  \n- Resolve review threads programmatically  \n- Export structured output ideal for **LLMs and automated PR review agents**\n\nDesigned for developers, DevOps teams, and AI systems that need **full pull request review context**, not just top-level comments.\n\n**Blog post:** [gh-pr-review: LLM-friendly PR review workflows in your CLI](https://agyn.io/blog/gh-pr-review-cli-agent-workflows) — explains the motivation, design principles, and CLI + JSON output examples.  \n\n- [Quickstart](#quickstart)\n- [Review view](#review-view)\n- [Backend policy](#backend-policy)\n- [Additional docs](#additional-docs)\n- [Design for LLMs \u0026 Automated Agents](#design-for-llms--automated-agents)\n- [Using as a Skill](#using-as-a-skill)\n\n\n\n\n## Quickstart\n\nThe quickest path from opening a pending review to resolving threads:\n\n1. **Install or upgrade the extension.**\n\n   ```sh\n   gh extension install agynio/gh-pr-review\n   # Update an existing installation\n   gh extension upgrade agynio/gh-pr-review\n   ```\n\n\n2. **Start a pending review (GraphQL).** Capture the returned `id` (GraphQL\n   node).\n\n   ```sh\n   gh pr-review review --start -R owner/repo 42\n\n   {\n     \"id\": \"PRR_kwDOAAABbcdEFG12\",\n     \"state\": \"PENDING\"\n   }\n   ```\n\n   Pending reviews omit `submitted_at`; the field appears after submission.\n\n3. **Add inline comments with the pending review ID (GraphQL).** The\n   `review --add-comment` command fails fast if you supply a numeric ID instead\n   of the required `PRR_…` GraphQL identifier.\n\n   ```sh\n   gh pr-review review --add-comment \\\n     --review-id PRR_kwDOAAABbcdEFG12 \\\n     --path internal/service.go \\\n     --line 42 \\\n     --body \"nit: use helper\" \\\n     -R owner/repo 42\n\n   {\n     \"id\": \"PRRT_kwDOAAABbcdEFG12\",\n     \"path\": \"internal/service.go\",\n     \"is_outdated\": false,\n     \"line\": 42\n   }\n   ```\n\n4. **Inspect review threads (GraphQL).** `review view` surfaces pending\n   review summaries, thread state, and inline comment metadata. Thread IDs are\n   always included; enable `--include-comment-node-id` when you also need the\n   individual comment node identifiers.\n\n   ```sh\n   gh pr-review review view --reviewer octocat -R owner/repo 42\n\n   {\n     \"reviews\": [\n       {\n         \"id\": \"PRR_kwDOAAABbcdEFG12\",\n         \"state\": \"COMMENTED\",\n         \"author_login\": \"octocat\",\n         \"comments\": [\n           {\n             \"thread_id\": \"PRRT_kwDOAAABbcdEFG12\",\n             \"path\": \"internal/service.go\",\n             \"author_login\": \"octocat\",\n             \"body\": \"nit: prefer helper\",\n             \"created_at\": \"2024-05-25T18:21:37Z\",\n             \"is_resolved\": false,\n             \"is_outdated\": false,\n             \"thread_comments\": []\n           }\n         ]\n       }\n     ]\n   }\n   ```\n\n   Use the `thread_id` values with `comments reply` to continue discussions. If\n   you are replying inside your own pending review, pass the associated\n   `PRR_…` identifier with `--review-id`.\n\n   ```sh\n   gh pr-review comments reply \\\n     --thread-id PRRT_kwDOAAABbcdEFG12 \\\n     --body \"Follow-up addressed in commit abc123\" \\\n     -R owner/repo 42\n   ```\n\n5. **Submit the review (GraphQL).** Reuse the pending review `PRR_…`\n   identifier when finalizing. Successful submissions emit a status-only\n   payload. GraphQL-level errors are returned as structured JSON for\n   troubleshooting.\n\n   ```sh\n   gh pr-review review --submit \\\n     --review-id PRR_kwDOAAABbcdEFG12 \\\n     --event REQUEST_CHANGES \\\n     --body \"Please add tests\" \\\n     -R owner/repo 42\n\n   {\n     \"status\": \"Review submitted successfully\"\n   }\n   ```\n\n   On GraphQL errors, the command exits non-zero after emitting:\n\n   ```json\n   {\n     \"status\": \"Review submission failed\",\n     \"errors\": [\n       { \"message\": \"mutation failed\", \"path\": [\"mutation\", \"submitPullRequestReview\"] }\n     ]\n   }\n   ```\n\n6. **Inspect and resolve threads (GraphQL).** Array responses are always `[]`\n   when no threads match.\n\n   ```sh\n   gh pr-review threads list --unresolved --mine -R owner/repo 42\n\n   [\n     {\n       \"threadId\": \"R_ywDoABC123\",\n       \"isResolved\": false,\n       \"path\": \"internal/service.go\",\n       \"line\": 42,\n       \"isOutdated\": false\n     }\n   ]\n   ```\n\n   ```sh\n   gh pr-review threads resolve --thread-id R_ywDoABC123 -R owner/repo 42\n   \n   {\n     \"thread_node_id\": \"R_ywDoABC123\",\n     \"is_resolved\": true\n   }\n   ```\n\n## Review view\n\n`gh pr-review review view` emits a GraphQL-only snapshot of pull request\ndiscussion. The response groups reviews → parent inline comments → thread\nreplies, omitting optional fields entirely instead of returning `null`.\n\nRun it with either a combined selector or explicit flags:\n\n```sh\ngh pr-review review view -R owner/repo --pr 3\n```\n\nInstall or upgrade to **v1.6.0 or newer** (GraphQL-only thread resolution and minimal comment replies):\n\n```sh\ngh extension install agynio/gh-pr-review\n# Update an existing installation\ngh extension upgrade agynio/gh-pr-review\n```\n\n### Command behavior\n\n- Single GraphQL operation per invocation (no REST mixing).\n- Includes all reviewers, review states, and threads by default.\n- Replies are sorted by `created_at` ascending.\n- Output exposes `author_login` only—no user objects or `html_url` fields.\n- Optional fields (`body`, `submitted_at`, `line`) are omitted when empty.\n- `comments` is omitted entirely when a review has no inline comments.\n- `thread_comments` is required for every inline comment and always present\n  (empty arrays indicate no replies).\n\nFor the full canonical response structure, see docs/SCHEMAS.md.\n\n### Filters\n\n| Flag | Purpose |\n| --- | --- |\n| `--reviewer \u003clogin\u003e` | Only include reviews authored by `\u003clogin\u003e` (case-insensitive). |\n| `--states \u003clist\u003e` | Comma-separated review states (`APPROVED`, `CHANGES_REQUESTED`, `COMMENTED`, `DISMISSED`). |\n| `--unresolved` | Keep only unresolved threads. |\n| `--not_outdated` | Exclude threads marked as outdated. |\n| `--tail \u003cn\u003e` | Retain only the last `n` replies per thread (0 = all). The parent inline comment is always kept; only replies are trimmed. |\n| `--include-comment-node-id` | Add GraphQL comment node identifiers to parent comments and replies. |\n\n### Examples\n\n```sh\n# Default: return all reviews, states, threads\ngh pr-review review view -R owner/repo --pr 3\n\n# Unresolved threads only\ngh pr-review review view -R owner/repo --pr 3 --unresolved\n\n# Focus changes requested from a single reviewer; keep only latest reply per thread\ngh pr-review review view -R owner/repo --pr 3 --reviewer alice --states CHANGES_REQUESTED --tail 1\n\n# Drop outdated threads and include comment node IDs\ngh pr-review review view -R owner/repo --pr 3 --not_outdated --include-comment-node-id\n```\n\n### Replying to threads\n\nUse the `thread_id` values surfaced in the report when replying.\n\n```sh\ngh pr-review comments reply 3 -R owner/repo \\\n  --thread-id PRRT_kwDOAAABbcdEFG12 \\\n  --body \"Follow-up addressed in commit abc123\"\n\n```\n\n## Backend policy\n\nEach command binds to a single GitHub backend—there are no runtime fallbacks.\n\n| Command | Backend | Notes |\n| --- | --- | --- |\n| `review --start` | GraphQL | Opens a pending review via `addPullRequestReview`. |\n| `review --add-comment` | GraphQL | Requires a `PRR_…` review node ID. |\n| `review view` | GraphQL | Aggregates reviews, inline comments, and replies (used for thread IDs). |\n| `review --submit` | GraphQL | Finalizes a pending review via `submitPullRequestReview` using the `PRR_…` review node ID (executed through the internal `gh api graphql` wrapper). |\n| `comments reply` | GraphQL | Replies via `addPullRequestReviewThreadReply`; supply `--review-id` when responding from a pending review. |\n| `threads list` | GraphQL | Enumerates review threads for the pull request. |\n| `threads resolve` / `unresolve` | GraphQL | Mutates thread resolution via `resolveReviewThread` / `unresolveReviewThread`; supply GraphQL thread node IDs (`PRRT_…`). |\n\n\n## Additional docs\n\n- [docs/USAGE.md](docs/USAGE.md) — Command-by-command inputs, outputs, and\n  examples for v1.6.0.\n- [docs/SCHEMAS.md](docs/SCHEMAS.md) — JSON schemas for each structured\n  response (optional fields omitted rather than set to null).\n- [docs/AGENTS.md](docs/AGENTS.md) — Agent-focused workflows, prompts, and\n  best practices.\n\n## Design for LLMs \u0026 Automated Agents\n\n`gh-pr-review` is designed to give LLMs and agents the **exact PR review context they need** — without the noisy, multi-step GitHub API workflow.\n\n### Why it's LLM-friendly\n\n- **Replaces multi-call API chains with one command**  \n  Instead of calling `list reviews → list thread comments → list comments`,  \n  a single `gh pr-review review view` command returns the entire, assembled review structure.\n\n- **Deterministic, stable output**  \n  Consistent formatting, stable ordering, and predictable field names make parsing reliable for agents.\n\n- **Compact, meaningful JSON**  \n  Only essential fields are returned. Low-signal metadata (URLs, hashes, unused fields) is stripped out to reduce token usage.\n\n- **Pre-joined review threads**  \n  Threads come fully reconstructed with inline context — no need for agents to merge comments manually.\n\n- **Server-side filters for token efficiency**  \n  Options like `--unresolved` and `--tail` help reduce payload size and keep inputs affordable for LLMs.\n\n\n\u003e \"A good tool definition should define a clear, narrow purpose, return exactly the meaningful context the agent needs, and avoid burdening the model with low-signal intermediate results.\"\n\n\n## Using as a Skill\n\n`gh-pr-review` can be used as a reusable skill for AI coding agents via [Vercel's add-skill package](https://github.com/vercel-labs/add-skill).\n\n### Installation as a Skill\n\nTo add gh-pr-review as a skill to your AI coding agent:\n\n```sh\nnpx @vercel/add-skill https://github.com/agynio/gh-pr-review\n```\n\nThis command will:\n- Install the gh-pr-review extension via `gh extension install`\n- Register the skill with your AI agent using the [SKILL.md](SKILL.md) definition\n- Make all gh-pr-review commands available as skill actions\n\n### What the Skill Provides\n\nOnce installed, your AI coding agent can:\n\n- **View PR reviews**: Get complete inline comment threads with file context\n- **Reply to comments**: Respond to review feedback programmatically\n- **Resolve threads**: Mark discussions as resolved after addressing feedback\n- **Create reviews**: Start pending reviews and add inline comments\n- **Filter intelligently**: Focus on unresolved, non-outdated comments by specific reviewers\n\nAll commands return structured JSON optimized for agent consumption with minimal tokens and maximum context.\n\n### Example Agent Workflow\n\n```\nUser: \"Show me unresolved comments on PR #42\"\nAgent: gh pr-review review view -R owner/repo --pr 42 --unresolved --not_outdated\nAgent: [Parses JSON, summarizes 3 unresolved threads]\n\nUser: \"Reply to the comment about error handling\"\nAgent: gh pr-review comments reply 42 -R owner/repo --thread-id PRRT_... --body \"Fixed in commit abc123\"\nAgent: gh pr-review threads resolve 42 -R owner/repo --thread-id PRRT_...\n```\n\n### Skill Documentation\n\nSee [SKILL.md](SKILL.md) for complete skill documentation including:\n- Core commands reference\n- JSON output schemas\n- Best practices for agents\n- Common workflow patterns\n\n## Development\n\nRun the test suite and linters locally with cgo disabled (matching the release build):\n\n```sh\nCGO_ENABLED=0 go test ./...\nCGO_ENABLED=0 golangci-lint run\n```\n\nReleases are built using the\n[`cli/gh-extension-precompile`](https://github.com/cli/gh-extension-precompile)\nworkflow to publish binaries for macOS, Linux, and Windows.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagynio%2Fgh-pr-review","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagynio%2Fgh-pr-review","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagynio%2Fgh-pr-review/lists"}