Using GitHub CLI (gh)

Automate GitHub issue, PR, and repository management with gh CLI.

7|Updated Oct 10, 2025
One-click install
npx skills add https://github.com/WarrenZhu050413/Warren-Claude-Code-Plugin-Marketplace --skill using-github-cli-gh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Using GitHub CLI (gh)
Source: https://github.com/WarrenZhu050413/Warren-Claude-Code-Plugin-Marketplace/tree/main/claude-context-orchestrator/snippets/local/documentation/using-github-cli
Command: npx skills add https://github.com/WarrenZhu050413/Warren-Claude-Code-Plugin-Marketplace --skill using-github-cli-gh

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires gh, jq, and includes scripts (resource) components.

What problem does it solve?

This Skill eliminates the complexity and time-consuming manual work of managing GitHub issues, repositories, and searches through the web interface.

Core Features & Use Cases

  • Issue Management: Automate creating, reading, and searching GitHub issues with proper formatting and duplicate prevention.
  • Repository Operations: Quickly access repo metadata, labels, and recent activity across multiple projects.
  • Use Case: Imagine you need to create a bug report. Use this Skill to automatically search for duplicates, analyze the repository's issue style, and create a properly formatted issue that respects maintainers' time.

Quick Start

Use the GitHub CLI skill to search for open issues assigned to me across all repositories and show their current status.

Frequently Asked Questions about Using GitHub CLI (gh)

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

FAQPage Schema
How do I automate GitHub issue creation and searching with the command line?

Automate GitHub issue creation and searching using the GitHub CLI (gh) with commands like `gh issue create` and `gh issue list`. The CLI handles authentication, repository context, and output formatting, eliminating manual web interface work and enabling scripted workflows for duplicate detection and bulk operations.

Can I search and filter GitHub issues across multiple repositories at once?

Yes, use `gh issue list` with search flags across repositories. Combine with `jq` to filter and format results by status, assignee, labels, or custom criteria, enabling cross-repository issue tracking and automation without writing custom API clients.

What do I need to set up before automating GitHub workflows with CLI scripts?

Install the GitHub CLI (gh) and authenticate with `gh auth login` to set token scopes. Ensure your environment has correct repository context and jq installed for data parsing. Verify token permissions support the operations—issue creation, PR management, or repository queries—you plan to automate.

How do I extract and format GitHub data from CLI commands for downstream processing?

Use `gh` output flags like `--json` to specify fields, then pipe to `jq` for filtering, transformation, and export. This produces structured data for reporting, notifications, or integration with other tools, avoiding manual parsing and ensuring reliable field selection.

What are common gotchas when automating GitHub operations through scripts?

Common issues include incorrect repository context, insufficient token scopes, and unspecified output fields causing silent failures. The Skill covers environment-aware scripting, explicit field selection, and token validation to ensure reusable, reliable automation across different machines and CI/CD contexts.

Can GitHub CLI replace manual repository management for labels, metadata, and recent activity?

Yes, `gh` automates querying repository metadata, labels, and activity logs programmatically. Replace repetitive web browsing with scripted commands to access and update repository state, enabling efficient bulk operations and integration into larger automation workflows.