GitHub

GitHub operations via gh CLI: issues, PRs, CI runs, code review, and API queries.

The GitHub skill is OpenClaw's interface to the world's largest code hosting platform, powered by the official `gh` CLI. It wraps common GitHub operations — issues, pull requests, CI runs, code review, and API queries — into a structured skill that your AI assistant can use fluently. Unlike the gh-issues skill (which is an autonomous issue-to-PR pipeline), this skill is the general-purpose GitHub toolkit. Need to check if CI is passing on a PR? `gh pr checks 55`. Want to list open issues with a specific label? `gh issue list --label bug`. Need to re-run a failed workflow? `gh run rerun <id> --failed`. It covers the full GitHub workflow surface area. The gh CLI is remarkably powerful for scripting. Every command supports `--json` output with `--jq` filtering, making it trivial to extract specific fields for automation. Combined with `gh api` for raw REST/GraphQL queries, you can do virtually anything the GitHub web UI can do — and script it. For OpenClaw users, this skill is foundational. It's what enables your AI assistant to interact with your repositories: checking PR status during conversations, creating issues from chat, reviewing CI logs when builds fail, and querying repository metadata. It pairs naturally with the coding-agent and gh-issues skills for a complete development workflow. The gh CLI handles authentication automatically once configured (`gh auth login`). It supports multiple accounts, SSH key management, and GitHub Enterprise. JSON output with jq filtering makes it the perfect tool for AI agents — structured data in, structured data out. Best suited for: any OpenClaw user working with GitHub repositories, developers who want AI-assisted GitHub operations, teams automating PR reviews and issue management, anyone who prefers CLI over the GitHub web UI.

Tags: github, git, development, ci-cd, pr

Category: Development

Use Cases

  • Check PR status and CI results during conversations
  • Create issues from chat discussions
  • Review and merge PRs from the terminal
  • Monitor workflow runs and re-run failed jobs
  • Query repository metadata and statistics
  • Automate release management with gh release create
  • Search code across repositories with gh search

Tips

  • Always use `--json` with `--jq` for scriptable output: `gh pr list --json number,title --jq '.[] | .number'`
  • Use `gh api` for anything the CLI doesn't cover natively — full REST and GraphQL access
  • Check CI without opening a browser: `gh pr checks <number>` shows all status checks
  • Use `gh run view <id> --log-failed` to see only the failed step logs — saves scrolling
  • Create aliases for common operations: `gh alias set prs 'pr list --author @me'`
  • Multi-account support: `gh auth login --hostname github.example.com` for GitHub Enterprise
  • Pipe JSON output to jq for complex filtering: `gh issue list --json labels --jq '.[].labels[].name' | sort -u`

Known Issues & Gotchas

  • Requires `gh auth login` before first use — interactive browser flow needed
  • Don't use for local git operations (commit, push, pull) — use `git` directly
  • Some commands behave differently in CI vs local (`gh pr list` pagination differs)
  • `gh pr create --reviewer` can be slow in repos with many collaborators
  • GitHub CLI still cannot show inline PR review comments in the terminal (long-standing limitation)
  • Rate limits: 5,000 API requests/hour for authenticated users
  • GraphQL queries via `gh api graphql` have a separate rate limit of 5,000 points/hour
  • Don't confuse with the gh-issues skill — this is general-purpose, that's an autonomous pipeline

Alternatives

  • GitHub Web UI
  • GitKraken CLI
  • hub (legacy)
  • GitHub REST API (curl)

Community Feedback

Do you consider the Github CLI tools essential? Absolutely. gh pr create, gh pr merge, gh run view — I can't imagine going back to the web UI for these.

— Reddit r/github

The github CLI saved me a lot of times. Being able to check CI status, view PRs, and manage issues without leaving the terminal is a game changer.

— Reddit r/ProgrammerHumor

Github CLI Skill — having Claude manage my GitHub workflow through gh commands has been transformative. PR reviews, issue triage, CI monitoring.

— Reddit r/ClaudeAI

gh is the official CLI for GitHub. It brings pull requests, issues, and other GitHub concepts to the terminal, making it easy to script and automate workflows.

— Graphite Guide

Configuration Examples

Initial setup

# Authenticate with GitHub
gh auth login

# Verify auth
gh auth status

# Check token scopes
gh auth token | gh api user -H 'Authorization: token $(cat -)'

PR workflow

# List your open PRs
gh pr list --author @me

# Check CI on a specific PR
gh pr checks 55

# View PR with diff stats
gh pr view 55

# Merge when ready
gh pr merge 55 --squash --delete-branch

Issue management

# List bugs
gh issue list --label bug --state open

# Create an issue
gh issue create --title 'Fix: login timeout' --body 'Steps to reproduce...' --label bug

# Close with comment
gh issue close 42 --comment 'Fixed in #55'

API queries with jq

# Get repo stats
gh api repos/owner/repo --jq '{stars: .stargazers_count, forks: .forks_count, issues: .open_issues_count}'

# List all unique labels
gh api repos/owner/repo/labels --jq '.[].name' | sort

# Get PR review comments
gh api repos/owner/repo/pulls/55/reviews --jq '.[].body'

Installation

brew install gh

Source: bundled