ghpr

command
v0.103.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2026 License: BSD-3-Clause Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL