ghpr-py: GitHub PR/Issue Management
raw JSON → 0.1.9 verified Sat May 09 auth: no python
Manage GitHub PR and Issue descriptions and comments locally: clone, edit, and push bidirectional changes with gist mirroring. Current version 0.1.9, requires Python >=3.10. Active development.
pip install ghpr-py Common errors
error TypeError: clone_command() missing 2 required positional arguments: 'owner' and 'repo' ↓
cause Incorrect number of arguments passed to clone command.
fix
Use:
ghpr clone owner/repo PR_NUMBER (e.g., ghpr clone user/repo 1) error ghpr: error: argument owner/repo: expected one argument ↓
cause Missing or malformed owner/repo argument.
fix
Provide as 'owner/repo' single argument (e.g., 'runsascoded/ghpr-py')
Warnings
breaking In v0.1.4 the clone command argument order changed; scripts using positional args may break. ↓
fix Update to v0.1.4+ and use new argument order (owner/repo first).
gotcha GitHub strips trailing newlines from PR descriptions; `write_description_with_link_ref` may cause diff thrashing on subsequent pulls. ↓
fix Upgrade to v0.1.7+ for fix.
gotcha `ghpr push` will not push comments authored by others unless explicitly forced; dry-run (-n) shows warnings. ↓
fix Use `ghpr push --force` to override, but note you'll overwrite other authors' comments.
deprecated Old shell integration (ghprc without GHPR_DIR) may not cd into cloned directory; fixed in v0.1.6. ↓
fix Upgrade to v0.1.6+ and source the updated shell integration files.
Imports
- main
from ghpr import main - clone_command
from ghpr.commands.clone import clone_command - push_command
from ghpr.commands.push import push_command
Quickstart
from ghpr import main
import os
# ghpr clone expects GITHUB_TOKEN or interactive auth
if 'GITHUB_TOKEN' in os.environ:
main(['clone', 'runsascoded/ghpr-py', '1'])