Documentation
¶
Overview ¶
Command ghpr performs the pull-request writes that ghissue and ghmerge do not: edit the title or body, close, reopen, mark ready for review, update the branch from its base, and submit a review. It shows the pull request first.
It exists because sessions typed these by hand (`gh pr edit` 437 times, `gh pr close` 188, `gh pr update-branch` 45, `gh pr ready` 32, `gh pr review` 13, plus `gh api -X PATCH .../pulls/N -F body=@f`) and the fleet's guard now refuses those forms and names this program. A rule with a hole in its toolbox is followed until the hole is reached.
Same handling as ghissue: the token is read from a 0600 file and sent only in the Authorization header, over https, redirects refused; prose comes from a file, never argv (the title is the one-line exception).
References (read 2026-11-08):
https://docs.github.com/en/rest/pulls/pulls PATCH /repos/{o}/{r}/pulls/{n}: "title", "body", "state" (open|closed), 200
PUT .../pulls/{n}/update-branch: "expected_head_sha" (422 when it differs from the head), 202 with "message"
GET .../pulls/{n}: "number", "state", "draft", "title", "html_url", "node_id", "merged", head/base "ref" and "sha"
https://docs.github.com/en/rest/pulls/reviews POST .../pulls/{n}/reviews: "event" (APPROVE|REQUEST_CHANGES|COMMENT), "body" (required for the last two), "commit_id"; 200
https://docs.github.com/en/graphql/reference/pulls markPullRequestReadyForReview(input: {pullRequestId}) -> pullRequest; REST has no endpoint for it
https://docs.github.com/en/graphql/reference/mutations#convertpullrequesttodraft convertPullRequestToDraft(input: {pullRequestId}) -> pullRequest; the counterpart of ready (read 2026-11-26)