GitHub CLI skills

GitHub CLI skills (gh, gh-skill)

Official GitHub CLI skills: how an agent should call gh correctly and how to manage skills with gh skill

SkillEditors’ pickMedium risk

cli/cli

Install

gh skill install cli/cli gh --scope user

Update after a gh release: gh skill update gh.

This is third-party code. Review the repository files before installing.

What it does

The gh skill explains how an agent should use GitHub CLI without common mistakes: get structured output with --json and --jq, respect list limits and pagination, target repositories explicitly and fall back to gh api when a regular command is not enough. It covers how gh behaves outside a terminal so the agent does not add useless flags. The second skill, gh-skill, teaches the agent to search, preview, install, update and publish skills with the built-in gh skill command. GitHub CLI itself gives the agent access to issues, pull requests, releases and Actions.

Who it is for. For developers whose agents work with GitHub through the command line.

Good fit when

  • The agent handles issues and pull requests via gh and trips over the output
  • You want the agent to get complete lists rather than silently truncated ones
  • You want to install and update skills from GitHub repositories with gh skill

Not a fit when

  • Code lives on GitLab or another host rather than GitHub
  • The agent already uses a GitHub MCP server and does not call gh

Example request

Use gh to find all open pull requests labeled bug with no review and show them as a table

Limitations

Requires GitHub CLI installed and authorized with gh auth login; gh skill exists only in recent versions. The skill covers usage patterns; access rights come from the user's token.

How to disable. Remove the gh skill folder from the user skills directory.

Security check

  • The agent runs gh commands as the user and can change issues, pull requests and releases

README in short

GitHub CLI is GitHub's official tool for working with repositories, issues, pull requests and Actions from the terminal. The README has an agent skills section: the skill for driving gh is installed and updated with the built-in gh skill command. The other skills under .github/skills serve the CLI's own maintainers. MIT licensed.

SKILL.md

---
name: gh
description: Patterns for invoking the GitHub CLI (gh) from agents. Covers structured output, pagination, repo targeting, search vs list, gh api fallback.
---

# Reference

## Interactivity policy

`gh` already does the right thing in non-TTY contexts: it skips the pager,
strips ANSI color, and errors out fast with a helpful message instead of
prompting (e.g. `must provide --title and --body when not running interactively`).
You don't need to defensively set `GH_PAGER` or pass `--no-pager` (no such
flag exists).

## Parsing JSON

Human output from `gh` is column-formatted. If you want structured data:

- Add `--json field1,field2,...` for structured output.
- Run a command with `--json` and **no field list** to print the full set of
  available fields, then pick what you need.
- Use `--jq '<expr>'` for filtering without piping through a separate `jq`.
- Use `--template '<go-template>'` (alongside `--json`) when you want shaped
  text output. Note that `--template`/`-T` collides with a body-template flag
  on a few commands (e.g. `gh pr create -T`, `gh issue create -T`); always
  check `--help` before assuming which one you're hitting.

## Pagination and silent truncation

List commands cap results.

- `gh issue list`, `gh pr list`, `gh search ...`: pass `-L N` (`--limit N`).
  The default is usually 30.

FAQ

Where does gh skill come from?

It is built into GitHub CLI; upgrade gh to a current version.

Why update the skill?

The skill tracks gh features, so the authors recommend updating it after each CLI release.

Editors’ pick

A skills library that gives coding agents a development process: brainstorming, planning, TDD, subagents and code review

PluginMedium risk286.6K
Editors’ pick

Small composable skills for engineering with agents: plan grilling, TDD, bug diagnosis, code review and architecture

SkillLow risk262K
Editors’ pick

GitHub toolkit for spec-driven development: the specify CLI adds agent commands and skills to a project, from principles to implementation

CLIMedium risk136.8K

Reference MCP servers

Model Context Protocol servers

Editors’ pick

Official reference MCP servers: Filesystem, Fetch, Git, Memory, Sequential Thinking, Time and Everything

MCP serverMedium risk90.3K