gh-cli

Automates GitHub issues, pull requests, and workflow runs using the GitHub CLI.

1|Updated Aug 24, 2026
One-click install
npx skills add https://github.com/yamcodes/the-hat --skill gh-cli-yamcodes
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gh-cli
Source: https://github.com/yamcodes/the-hat/tree/main/skills/gh-cli
Command: npx skills add https://github.com/yamcodes/the-hat --skill gh-cli-yamcodes

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Managing GitHub repositories through the web UI is slow and hard to script. This Skill provides structured guidance for performing GitHub operations directly from the terminal with the GitHub CLI (gh). ## Core Features & Use Cases - Actions & Runs Management: List, view, watch, and rerun GitHub Actions workflow runs, including fetching job logs for debugging. - Pull Request & Issue Workflows: Create, view, merge, and check the status of pull requests and issues without leaving the command line. - Repository & Secrets Configuration: Clone, fork, and view repositories, plus manage secrets and variables for CI/CD pipelines. - Use Case: A CI pipeline fails overnight. Use this Skill to list recent runs, view the failing job's logs, and rerun only the failed jobs, all via gh commands. ## Quick Start Use the gh CLI to list recent workflow runs and show the logs of the failed job in this repository.

Frequently Asked Questions about gh-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I view GitHub Actions logs from the command line?▼

Use gh run view <run-id> --job <job-id> --log to print the logs of a specific job. You can find run IDs with gh run list and filter by workflow using --workflow.

How to create and merge a pull request with gh CLI?▼

Run gh pr create --title "..." --body "..." to open a pull request from your current branch. Merge it with gh pr merge <pr-number> using --merge, --squash, or --rebase.

Can I use gh CLI outside a git repository?▼

Yes, pass the --repo <owner>/<repo> flag to any gh command to target a repository explicitly. This is useful in multi-repo contexts or scripts running outside a cloned repo.

How do I rerun only failed GitHub Actions jobs?▼

Use gh run rerun <run-id> --failed to re-execute only the jobs that failed in a workflow run. This avoids rerunning the entire pipeline and saves CI minutes.

How to get scriptable JSON output from gh commands?▼

Most gh commands support --json with a list of fields, combined with -q to apply a jq filter. For example, gh pr list --json number,title -q '.[].title' prints only PR titles.