$npx -y skills add volcengine/OpenViking --skill githubInteract with GitHub using the gh CLI. Use gh issue, gh pr, gh run, and gh api for issues, PRs, CI runs, and advanced queries.
| 1 | # GitHub Skill |
| 2 | |
| 3 | Use the `gh` CLI to interact with GitHub. Always specify `--repo owner/repo` when not in a git directory, or use URLs directly. |
| 4 | |
| 5 | ## Pull Requests |
| 6 | |
| 7 | Check CI status on a PR: |
| 8 | ```bash |
| 9 | gh pr checks 55 --repo owner/repo |
| 10 | ``` |
| 11 | |
| 12 | List recent workflow runs: |
| 13 | ```bash |
| 14 | gh run list --repo owner/repo --limit 10 |
| 15 | ``` |
| 16 | |
| 17 | View a run and see which steps failed: |
| 18 | ```bash |
| 19 | gh run view <run-id> --repo owner/repo |
| 20 | ``` |
| 21 | |
| 22 | View logs for failed steps only: |
| 23 | ```bash |
| 24 | gh run view <run-id> --repo owner/repo --log-failed |
| 25 | ``` |
| 26 | |
| 27 | ## API for Advanced Queries |
| 28 | |
| 29 | The `gh api` command is useful for accessing data not available through other subcommands. |
| 30 | |
| 31 | Get PR with specific fields: |
| 32 | ```bash |
| 33 | gh api repos/owner/repo/pulls/55 --jq '.title, .state, .user.login' |
| 34 | ``` |
| 35 | |
| 36 | ## JSON Output |
| 37 | |
| 38 | Most commands support `--json` for structured output. You can use `--jq` to filter: |
| 39 | |
| 40 | ```bash |
| 41 | gh issue list --repo owner/repo --json number,title --jq '.[] | "\(.number): \(.title)"' |
| 42 | ``` |