github-cli
Interact with GitHub using `gh` for issues, pull requests, runs, releases, and API queries from inside an agent or shell.
- License 许可
- MIT
- 最近更新
- 2026-11-09
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- github-cli
- risk
- medium
- source
- openclawskills.net
- aliases
- [ "gh", "github", "pr", "issue", "gh-cli" ]
- enabled
- true
- version
- 1.0.0
- category
- coding_and_devops
- keywords
- [ "github", "gh", "pr", "pull", "request", "issue", "ci", "workflow", "release", "api" ]
- metadata
- { "openclaw": { "requires": { "env": [], "bins": [] }, "primaryEnv": null } }
- triggers
- [ "Open a PR", "List my issues", "Check the CI run", "Create a release", "Use the GitHub API" ]
- description
- Interact with GitHub using `gh` for issues, pull requests, runs, releases, and API queries from inside an agent or shell.
- required_tools
- [ "gh", "git" ]
03 SKILL.md 正文
GitHub CLI Workflows
Purpose
Run common GitHub operations through the gh CLI in a way that is safe, scriptable,
and ergonomic for an agent. The skill wraps gh issue, gh pr, gh run, gh release,
and gh api into named, audited operations.
When to Use
- The user wants to read, create, or update an issue, PR, or release
- The user wants CI status, logs, or rerun
- A scripted workflow needs to query or mutate GitHub state
When NOT to Use
- The user is not authenticated (
gh auth statuswill fail) - The action requires admin rights the user does not have
- The user wants GUI review (route to the browser)
Capabilities
- Issues: list, view, create, edit, close, comment, label, assign
- Pull Requests: list, view, create, checkout, review, merge, close, comment, diff
- Runs / Workflows: list, view, watch, rerun, download logs, cancel
- Releases: list, view, create, upload, delete (with confirmation)
- API: arbitrary
gh apicall with auto-pagination, header capture, JSON pretty-print - Repo: clone, fork, view, set default
Inputs
- A subcommand and its arguments (e.g.
pr list --author @me --state open) - Optional:
--repo owner/nameto override the current repo - Optional:
--json field1,field2to project specific fields
Workflow
- Verify auth with
gh auth status(cached result for 5 min). - Resolve the target repo (
--repoflag or currentgh repo view). - Build the
ghinvocation with safe defaults:- Use
--jsoninstead of text when downstream parsing is needed - Use
--templateto project fields - Always pass
--paginatefor list commands
- Use
- Run the command, capture stdout, stderr, exit code.
- Format the result for chat (table, list, or JSON, depending on call).
- On error: classify (auth, not-found, permission, rate-limit) and explain.
Tools
ghCLI (required, ≥ 2.40)git(forgh pr checkoutflows)jq(recommended for API JSON shaping)
Examples
User: "List my open PRs."
Response: gh pr list --author @me --state open --json number,title,headRefName,url
User: "Rerun the failed CI job."
Response: gh run rerun <run-id> --failed
User: "Create an issue from this error."
Response: gh issue create --title "..." --body "..." --label bug --assignee @me
Safety
- Never force-push or force-merge without explicit confirmation
- Never delete a release or branch without an explicit
--confirm-destructive - Surface rate-limit headers and warn on remaining quota
- Redact tokens / cookies from any
gh apiresponse before display
Source
Auto-generated from openclawskills.net description.
Pairs Well With
git-workflow(local commit / branch / push)autoreview(review a PR before merge)security-scanner(pre-merge gate)
04 同仓库更多 Skills
dei-assessment
Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.
dei-action-plan
Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.
culture-fit-assessment
Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.
cowork-to-code-bridge
Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.
counter-offer-response
Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.
continuous-feedback-system
Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.