GitHub PR/Issue management: clone, edit, and push PR/issue descriptions and comments, with gist mirroring
Project description
ghpr
"Clone" GitHub PRs/issues, locally edit title/description/comments, "push" back to GitHub, and mirror to Gists.
- Sometimes PR and issue descriptions/comments warrant more complex editing than GitHub's web UI comfortably allows.
ghprlets you "clone" PRs and issues locally as Markdown files (including titles and comments), so you can edit them with your favorite IDE, then "push" updates back to GitHub.ghpralso mirrors PR/issue content to Gists, for version control and easy sharing / backing up / syncing across machines.
Examples:
- marin#1773: issue with complex description and comments (e.g.); mirrored to this gist
- marin#1723: PR with complex description, mirrored to this gist
Features
- Clone PR/Issues locally with comments
- Sync bidirectionally between GitHub and local files
- Diff local changes vs remote (with ownership warnings for others' comments)
- Push updates back to GitHub
- Gist mirroring for version control and sharing
- Comment management - edit and sync PR/issue comments
- Draft comments - create
new*.mdfiles, push to post as comments - Shell integration - aliases and tab completion for subcommands, flags, and options
Installation
pip install ghpr-py
Usage
Basic Workflow
# Clone a PR or issue (to `gh/123` by default
ghpr clone https://github.com/owner/repo/pull/123
# or
ghpr clone owner/repo#123
# Make edits to:
# - Title / Description: `gh/123/repo#123.md`
# - Comment files: `zNNNNNN-<author>.md` (existing comments) or `new.md` (new comments)
# Show differences (between local "clone" and GitHub)
ghpr diff
# Push changes
ghpr push
Adding Comments
To add a new comment, create a file starting with new and ending in .md:
# Create a draft comment
echo "My comment text" > new.md
# Commit it
git add new.md
git commit -m "Draft comment"
# Push to GitHub (posts the comment and renames to z{id}-{author}.md)
ghpr push
The push command will:
- Post
new*.mdfiles as comments to GitHub - Create a commit renaming them to
z{comment_id}-{author}.md - Sync to the gist mirror
Uploading Images
# Upload image(s) to this issue or PR's Gist mirror, and get markdown URLs
ghpr upload screenshot.png
# Output: 
Note: GitHub serves gist raw files as application/octet-stream, so images render in markdown but videos won't preview inline. For videos, use GitHub's native drag-drop upload in the web UI instead.
Directory Structure
Cloned PRs and issues are stored as:
gh/123/
repo#123.md # Main description
z3404494861-user.md # Comments (ID-author format)
z3407382913-user.md
Since PRs are issues in GitHub's API, we use the same gh/{number}/ pattern for both.
Shell Integration (Optional)
For users who want shorter aliases, ghpr provides shell integration:
Bash/Zsh
Add to your ~/.bashrc or ~/.zshrc:
eval "$(ghpr shell-integration bash)"
Fish
Add to your ~/.config/fish/config.fish:
ghpr shell-integration fish | source
Available Aliases
After enabling shell integration, you get convenient shortcuts and tab completion for subcommands, flags, and options:
ghprc # ghpr clone (+ cd into directory)
ghpri # ghpr init (+ cd into gh/new)
ghprcr # ghpr create
ghprd # ghpr diff
ghprp # ghpr push
ghprl # ghpr pull
ghpro # ghpr open
ghprsh # ghpr show
ghpru # ghpr upload
ghia # ghpr ingest-attachments
# ... and more (-n, -g, -o variants)
See the full list with:
ghpr shell-integration bash
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ghpr_py-0.1.9.tar.gz.
File metadata
- Download URL: ghpr_py-0.1.9.tar.gz
- Upload date:
- Size: 54.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bdcc8b053d18013448750cf79ccd96acd80033db0ed1585c413e72477ce94fa
|
|
| MD5 |
904b808f5db0cbd875ad1aa1432cdd7c
|
|
| BLAKE2b-256 |
bdb6aec71ddaf965345b0130ef6a24d5f619cefade0928ecc1ea75a9bcdf596d
|
Provenance
The following attestation bundles were made for ghpr_py-0.1.9.tar.gz:
Publisher:
release.yml on runsascoded/ghpr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ghpr_py-0.1.9.tar.gz -
Subject digest:
4bdcc8b053d18013448750cf79ccd96acd80033db0ed1585c413e72477ce94fa - Sigstore transparency entry: 1181453981
- Sigstore integration time:
-
Permalink:
runsascoded/ghpr@f1c3bef1b74c5a4ab3ea90ac809e0c95067d0a39 -
Branch / Tag:
refs/tags/v0.1.9 - Owner: https://github.com/runsascoded
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f1c3bef1b74c5a4ab3ea90ac809e0c95067d0a39 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ghpr_py-0.1.9-py3-none-any.whl.
File metadata
- Download URL: ghpr_py-0.1.9-py3-none-any.whl
- Upload date:
- Size: 51.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b286754029e56f481587a5bedcdb8bf623dd1c20e39e21d0d7bdb4cdebb7a98d
|
|
| MD5 |
6bb21dfb2b557b89651746a0fc9d42e8
|
|
| BLAKE2b-256 |
064c04ec0f444b52fba57fa63cd917f5cf4ca1f13912b59d318716dfcd71d50a
|
Provenance
The following attestation bundles were made for ghpr_py-0.1.9-py3-none-any.whl:
Publisher:
release.yml on runsascoded/ghpr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ghpr_py-0.1.9-py3-none-any.whl -
Subject digest:
b286754029e56f481587a5bedcdb8bf623dd1c20e39e21d0d7bdb4cdebb7a98d - Sigstore transparency entry: 1181454022
- Sigstore integration time:
-
Permalink:
runsascoded/ghpr@f1c3bef1b74c5a4ab3ea90ac809e0c95067d0a39 -
Branch / Tag:
refs/tags/v0.1.9 - Owner: https://github.com/runsascoded
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f1c3bef1b74c5a4ab3ea90ac809e0c95067d0a39 -
Trigger Event:
push
-
Statement type: