What problem does it solve?
This Skill enables you to respond to PR feedback by posting replies to a specific comment thread using GitHub CLI.
Core Features & Use Cases
- Reply to a specific PR comment thread using gh
- Support both line comments and review comments
- Improve collaboration by quickly acknowledging feedback and clarifying changes
Quick Start
Use the GitHub CLI to reply to a PR comment.
Step 1: Get Repository Name
Command: gh repo view --json nameWithOwner --jq '.nameWithOwner'
Example output: gmliao/swift-state-tree
Step 2: Get PR Number
Command: gh pr view --json number --jq '.number'
Example output: 24
Step 3: Find Comment ID
Option A: View Line Comments
Command: gh api repos/$REPO/pulls/$PR_NUMBER/comments --jq '.[] | {id: .id, path: .path, line: .line, body: (.body | split("\n")[0:2] | join("\n"))}'
Option B: View Review Comments
Command: gh pr view 24 --json reviews --jq '.reviews[].comments[] | {id: .id, author: .author.login, body: (.body | split("\n")[0:2] | join("\n"))}'
Output format (example):
{
"id": 2700778279,
"path": "Sources/SwiftStateTree/Sync/SyncEngine.swift",
"line": 123,
"body": "This could be optimized..."
}
Step 4: Reply to Comment
Command: gh api --method POST repos/$REPO/pulls/$PR_NUMBER/comments/$COMMENT_ID/replies -f body="Your reply text"
Example:
gh api --method POST repos/$REPO/pulls/$PR_NUMBER/comments/$COMMENT_ID/replies -f body="Thanks for the review! I've addressed this in the latest commit."