# Github

> Interact with GitHub using the gh CLI for issues, PRs, CI runs, releases, and API queries Use when this capability is needed.

- Skill: `tomevault-io/github-26` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/github-26`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/github-26/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/github-26

---


# GitHub CLI

## Overview

Use the `gh` CLI for all GitHub operations. Prefer `gh` over raw git commands for GitHub-specific features.

## Quick Reference

### Pull Requests
```bash
# List open PRs
gh pr list

# View PR details
gh pr view <number>

# View PR diff
gh pr diff <number>

# Check CI status
gh pr checks <number>

# Create PR
gh pr create --title "title" --body "description"

# Checkout PR locally
gh pr checkout <number>

# Review PR
gh pr review <number> --approve
gh pr review <number> --request-changes --body "feedback"

# Merge PR
gh pr merge <number> --squash --delete-branch
```

### Issues
```bash
# List issues
gh issue list
gh issue list --label "bug" --state open

# Create issue
gh issue create --title "Bug: ..." --body "description" --label "bug"

# View issue
gh issue view <number>

# Close issue
gh issue close <number>

# Add comment
gh issue comment <number> --body "comment"
```

### CI / Actions
```bash
# List recent workflow runs
gh run list --limit 10

# View run details
gh run view <run-id>

# View failed logs
gh run view <run-id> --log-failed

# Re-run failed jobs
gh run rerun <run-id> --failed

# Watch a running workflow
gh run watch <run-id>
```

### Releases
```bash
# List releases
gh release list

# Create release
gh release create v1.0.0 --title "v1.0.0" --notes "Release notes"

# Download release assets
gh release download v1.0.0
```

### API (advanced queries)
```bash
# Raw API call
gh api repos/{owner}/{repo}/pulls/<number> --jq '.title, .state'

# List PR comments
gh api repos/{owner}/{repo}/pulls/<number>/comments --jq '.[].body'

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

# Search issues
gh api search/issues --method GET -f q="repo:{owner}/{repo} is:issue is:open label:bug" --jq '.items[].title'
```

## Tips

- Use `--json` flag with `--jq` for structured output
- Use `--web` to open in browser: `gh pr view <number> --web`
- Set default repo: `gh repo set-default owner/repo`
- Use `--repo owner/repo` to target a specific repo without cd

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/phuetz) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-11 -->

