gh-pr-comments

Fetch GitHub pull request comments via gh CLI and jq.

Updated Dec 4, 2025
One-click install
npx skills add https://github.com/HaywardMorihara/toolbox --skill gh-pr-comments-haywardmorihara
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gh-pr-comments
Source: https://github.com/HaywardMorihara/toolbox/tree/main/ai/skills/gh-pr-comments
Command: npx skills add https://github.com/HaywardMorihara/toolbox --skill gh-pr-comments-haywardmorihara

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams capture and review all feedback on a GitHub pull request by aggregating general comments and inline code comments via the gh CLI.

Core Features & Use Cases

  • View PR summary including general comments to understand overall discussions.
  • Retrieve inline code comments on specific lines to ensure no feedback is missed.
  • Consolidate PR feedback across multiple reviewers to streamline merging decisions.

Quick Start

Install the gh CLI and jq if they are not already available. Then view a PR with: gh pr view <number> --repo owner/repo To retrieve inline comments, run: gh api repos/owner/repo/pulls/<number>/comments | jq '.[] | {user: .user.login, path: .path, line: .line, body: .body}'

Frequently Asked Questions about gh-pr-comments

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query all pull request comments including inline code review feedback via the GitHub CLI?

To query pull request comments, view general discussions using gh pr view and retrieve inline code review comments via gh api endpoints. Appending jq formats the API output to extract user, file path, line number, and comment body for comprehensive review aggregation.

Does fetching inline PR comments require jq in addition to the gh CLI?

Fetching inline PR comments requires jq alongside the gh CLI. While gh pr view retrieves general discussions, fetching inline code comments uses gh api endpoints, and jq parses and formats the JSON response to extract specific fields like user, path, line, and body.

What's the best way to consolidate feedback from multiple reviewers on a GitHub pull request?

Consolidating feedback from multiple reviewers involves querying general and inline PR comments via gh CLI. Aggregating outputs from gh pr view and gh api endpoints ensures no code review feedback is missed, streamlining merging decisions across repositories.

Can I retrieve inline code comments on specific lines of a pull request using gh api?

You can retrieve inline code comments on specific lines using gh api. Querying the repos/owner/repo/pulls/number/comments endpoint returns inline feedback, which jq formats to display the user login, file path, line number, and comment body.

Why does my gh CLI pull request view not show inline code review comments?

The gh pr view command shows general PR discussions and summaries but does not fetch inline code review comments. To get inline feedback, query the gh api repos/owner/repo/pulls/number/comments endpoint and format the JSON output with jq.

How do I aggregate GitHub PR comments across multiple repositories for code review?

Aggregating GitHub PR comments across repositories involves running gh pr view and gh api commands for each target repository. This workflow captures both general discussions and inline code review feedback, enabling comprehensive consolidation of reviewer comments before merging.