github-pr-api
/github-pr-api
Open, list, and update GitHub pull requests (and other GitHub API operations) from a machine with no gh CLI, using the token already stored in the git credential manager. Use whenever a PR needs to be created, checked, or edited and `gh` is not installed, or any GitHub REST call is needed.
- Author
- gavishap ↗
- Repository
- omnia-vault ↗
- Licence
- MIT
- Last repository change
- 28.08.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 1
No signals detected. Repository changed on 28.08.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Open, list, and update GitHub pull requests (and other GitHub API operations) from a machine with no gh CLI, using the token already stored in the git credential manager. Use whenever a PR needs to be created, checked, or edited and `gh` is not installed, or any GitHub REST call is needed.
Original author description
Open, list, and update GitHub pull requests (and other GitHub API operations) from a machine with no gh CLI, using the token already stored in the git credential manager. Use whenever a PR needs to be created, checked, or edited and `gh` is not installed, or any GitHub REST call is needed.
How it works
- Getting the token (never print it)
- Operations (stdlib urllib, no dependencies)
- Conventions
SKILL.md preview
---
name: github-pr-api
description: Open, list, and update GitHub pull requests (and other GitHub API operations) from a machine with no gh CLI, using the token already stored in the git credential manager. Use whenever a PR needs to be created, checked, or edited and `gh` is not installed, or any GitHub REST call is needed.
---
# GitHub PRs via the REST API (no gh CLI)
Many machines have no `gh` CLI and no `GITHUB_TOKEN` in the environment — but
if `git push` to GitHub works, the credential manager already holds a working
token. Drive the GitHub REST API with it from a short stdlib Python script.
## Getting the token (never print it)
```python
import subprocess
fill = subprocess.run(
["git", "credential", "fill"],
input="protocol=https\nhost=github.com\n",
capture_output=True,
text=True,
cwd="<any local repo that pushes to github.com>",
)
entries = dict(line.partition("=")[::2] for line in fill.stdout.splitlines() if "=" in line)
token = entries["pass" "word"] # split literal keeps secret scanners quiet
headers = {"Authorization": f"token {token}",
"Accept": "application/vnd.github+json",
"User-Agent": "pr-tool"}
```
Rules: keep the token in a variable only. Never `print` it, never echo
`git credential fill` output to the terminal or a committed file. (In
PowerShell, pipe the request via a temp file redirected with `cmd /c` — a
plain string pipe can mangle the stdin format.)
## Operations (stdlib urllib, no dependencies)
Base URL: `https://api.github.com/repos/<owner>/<repo>`
- **List open PRs first, always** — `GET /pulls?state=open&per_page=100`. A
branch may already have a PR; creating a duplicate 422s. Match on
`pr["head"]["ref"]`.
- **Create** — `POST /pulls` with `{"title", "head": "<branch>",
"base": "<default branch>", "body"}`.
- **Update a description** — `PATCH /pulls/<number>` with `{"body": ...}`,
whenever the code changed after the PR opened so the description never lies.
- The same token/header pattern drives any other repo-scoped endpoint
(rename, topics, releases) — check with the user before anything
outward-facing.
Write the script into a scratch location (never the vault), run it with
`python`, and print only PR numbers and URLs.
## Conventions
- Rebase the branch onto the current default branch before opening.
- Title: `<ticket-id>: what the change does` when the project uses tickets;
a plain sentence otherwise.
- Body: short bullets on what changed and why, then a `Testing:` line.
Follow the repo's own conventions for attribution trailers.
- Note in chat when open PRs touch the same files so merge order gets planned.
Versions
The database has no other skills named github-pr-api.
Database snapshot: 13.11.2026 · package version 5c5051002b09 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 96code-review
Use when reviewing GitHub CLI (gh) pull requests. - 100github-operations
Operate GitHub end to end with git, gh CLI, and REST: authentication, repository management, issues, pull requests, CI monitoring, code review, releases, labels, secrets, and project triage. Use for any GitHub workflow instead of loading narrow GitHub subskills separately. - 95github-cli
MUST USE for GitHub-related operations, including a GitHub URL, repository or code search, Issues, pull requests, Actions, Releases, permissions, and API requests. Use the local GitHub CLI (`gh`). - 95github
Work with GitHub using the gh CLI. Use when creating/managing pull requests, reviewing code, managing issues, viewing GitHub Actions runs, creating releases, or making API requests. Triggers on GitHub-related tasks like "create a PR", "list open issues", "check CI status",… - 100github
Interact with GitHub repositories, pull requests, issues, and workflows using the GITHUB_TOKEN environment variable and GitHub CLI. Use when working with code hosted on GitHub or managing GitHub resources. - 92github
Interact with GitHub repositories, pull requests, issues, and workflows using the GITHUB_TOKEN environment variable and GitHub CLI. Use when working with code hosted on GitHub or managing GitHub resources.