gh
Scannednpx machina-cli add skill bendrucker/claude/gh --openclawgh CLI
Use gh for all GitHub interactions. It handles authentication automatically and works with private repositories.
Common Commands
gh repo view— view repository README and metadatagh issue view <number>— view issue detailsgh pr view <number>— view pull request detailsgh run view <run_id>— view workflow run statusgh run view --job <job_id> --log— view job logs
API Access
Use gh api for operations not covered by built-in commands:
gh api repos/{owner}/{repo}/contents/{path} # fetch file contents
gh api repos/{owner}/{repo}/pulls/{number}/comments # PR review comments
Reference Files
- reviews.md: Pull request review patterns
Workflows
Pull Request
- You must
git pusha branch before creating a pull request withgh pr create.
Source
git clone https://github.com/bendrucker/claude/blob/main/plugins/github/skills/gh/SKILL.mdView on GitHub Overview
gh lets you interact with GitHub from the command line, covering repositories, issues, PRs, and workflow runs. It handles authentication automatically and works with private repositories, making routine GitHub tasks faster.
How This Skill Works
You run gh commands like gh repo view, gh issue view, gh pr view, and gh run view to fetch metadata and status. For tasks not covered by built-in commands, use gh api with REST endpoints (e.g., repos/{owner}/{repo}/contents/{path}). Authentication is managed by gh. When creating a PR, push your feature branch first, then use gh pr create.
When to Use It
- View a repository's README and metadata with gh repo view
- Inspect a specific issue or pull request with gh issue view or gh pr view
- Monitor CI by checking workflow runs and job logs via gh run view
- Fetch file contents or other API data using gh api (e.g., contents, PR comments)
- Prepare and open a pull request after pushing a feature branch (gh pr create)
Quick Start
- Step 1: Install gh and ensure authentication (usually automatic for your repo).
- Step 2: gh repo view owner/repo to inspect repository README/metadata.
- Step 3: gh pr view 123 or gh run view 456 to inspect PRs or workflow runs; use gh api for advanced data like contents.
Best Practices
- Always confirm repo context before running commands (gh repo view helps)
- Use gh pr view to verify PR details before merging
- Track CI status with gh run view and fetch logs with --log when debugging
- Switch to gh api for data not exposed by built-in commands
- Push your branch before gh pr create to follow the standard workflow
Example Use Cases
- gh repo view owner/repo to see README and metadata
- gh issue view 123 to inspect an issue
- gh pr view 456 to review a pull request
- gh api repos/owner/repo/contents/path to fetch a file's contents
- gh run view 789 to check a workflow run status