Skip to main content

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.

ghpr-py

  • Sometimes PR and issue descriptions/comments warrant more complex editing than GitHub's web UI comfortably allows.
  • ghpr lets 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.
  • ghpr also mirrors PR/issue content to Gists, for version control and easy sharing / backing up / syncing across machines.

Examples:

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*.md files, 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:

  1. Post new*.md files as comments to GitHub
  2. Create a commit renaming them to z{comment_id}-{author}.md
  3. 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: ![screenshot.png](https://gist.githubusercontent.com/...)

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ghpr_py-0.1.9.tar.gz (54.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ghpr_py-0.1.9-py3-none-any.whl (51.8 kB view details)

Uploaded Python 3

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

Hashes for ghpr_py-0.1.9.tar.gz
Algorithm Hash digest
SHA256 4bdcc8b053d18013448750cf79ccd96acd80033db0ed1585c413e72477ce94fa
MD5 904b808f5db0cbd875ad1aa1432cdd7c
BLAKE2b-256 bdb6aec71ddaf965345b0130ef6a24d5f619cefade0928ecc1ea75a9bcdf596d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghpr_py-0.1.9.tar.gz:

Publisher: release.yml on runsascoded/ghpr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for ghpr_py-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 b286754029e56f481587a5bedcdb8bf623dd1c20e39e21d0d7bdb4cdebb7a98d
MD5 6bb21dfb2b557b89651746a0fc9d42e8
BLAKE2b-256 064c04ec0f444b52fba57fa63cd917f5cf4ca1f13912b59d318716dfcd71d50a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ghpr_py-0.1.9-py3-none-any.whl:

Publisher: release.yml on runsascoded/ghpr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page