Command Palette

Search for a command to run...

Back to skills
skill № 46552

mastering-github-cli

GitHub CLI (gh) command reference for repository search, code discovery, CI/CD monitoring, workflow authoring, and automation. Triggers on "gh" commands…

FreeRuns bundled scripts
SpillwaveSolutionsby SpillwaveSolutions★ 46 GitHub stars

Install mastering-github-cli in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

About this skill

Mastering GitHub CLI

Command-line interface for GitHub operations: search, monitoring, resource creation, workflow authoring, and automation.

Contents


Quick Start

Find repos with specific files/directories

gh search code "path:.skilz" --json repository --jq '.[].repository.fullName'
gh search code --filename SKILL.md
gh search code --filename Dockerfile --language python

Monitor CI/CD

gh run list --workflow=CI --status=failure --limit 10
gh run watch 12345 --exit-status      # Block until complete
gh run view 12345 --log-failed        # Failed logs only
gh pr checks 123 --watch              # PR CI status

Create resources

gh pr create --title "Feature" --body "Description" --reviewer @user
gh issue create --title "Bug" --label bug,urgent --assignee @me
gh repo fork owner/repo --clone

Trigger and monitor workflow

gh workflow run deploy.yml -f environment=staging
sleep 5
RUN_ID=$(gh run list --workflow=deploy.yml --limit 1 --json databaseId --jq '.[0].databaseId')
gh run watch "$RUN_ID" --exit-status

Command Reference

Task Command Reference
Find repos with file gh search code --filename FILE search.md
Find repos with directory gh search code "path:DIR" search.md
List failed runs gh run list --status=failure monitoring.md
Watch run gh run watch ID --exit-status monitoring.md
Download artifacts gh run download ID -n NAME monitoring.md
Create PR gh pr create --fill resources.md
Check PR CI gh pr checks --watch monitoring.md
Trigger workflow gh workflow run NAME.yml automation.md
Fork repo gh repo fork REPO --clone resources.md
REST/GraphQL API gh api repos/{owner}/{repo} api.md

JSON Output

gh pr list --json                              # Discover fields
gh pr list --json number,title,author,labels   # Select fields
gh run list --json status --jq '.[] | select(.status=="completed")'

Environment & Auth

Variable Purpose
GH_TOKEN Authentication token
GH_REPO Default owner/repo
GH_HOST GitHub Enterprise host
GH_PROMPT_DISABLED=1 Disable prompts (CI)

Rate Limits

Endpoint Limit Notes
REST API 5,000/hour Per authenticated user
Search API 30/minute All search endpoints
Code Search 10/minute More restrictive
Search results 1,000 max Use date partitioning for more

Workflow Authoring

GitHub Actions workflow YAML patterns for CI/CD pipelines.

Basic Structure

name: CI Pipeline
on:
  push:
    branches: [main]
  pull_request:
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: make build
      - run: make test

Caching Patterns

# Python/Poetry
- uses: actions/setup-python@v5
  with:
    python-version: '3.11'
- uses: actions/cache@v4
  with:
    path: .venv
    key: venv-${{ runner.os }}-${{ hashFiles('poetry.lock') }}

# Node.js
- uses: actions/setup-node@v4
  with:
    node-version: '20'
    cache: 'npm'

Matrix Builds

strategy:
  matrix:
    os: [ubuntu-latest, windows-latest]
    node: [18, 20]
  fail-fast: false

OIDC Authentication (AWS/GCP)

permissions:
  id-token: write
  contents: read

steps:
  - uses: aws-actions/configure-aws-credentials@v4
    with:
      role-to-assume: arn:aws:iam::123456789012:role/GitHubActionsRole
      aws-region: us-east-1

Full reference: references/workflow-authoring.md

Advanced Patterns

For enterprise CI/CD pipelines:

  • Ephemeral PR Environments - Auto-create/destroy per PR
  • Release Please - Automated semantic versioning
  • PR Cleanup - Resource cleanup on close
  • Testing Patterns - pytest, Gradle, Jest with coverage
  • Deployment Status Checks - Wait for stack readiness
  • Separate Build/Deploy Roles - Fine-grained OIDC permissions
  • Multi-Stack Ordering - Foundation → Schemas → Application

Additional References:

  • Workflow Summaries - Rich markdown output with $GITHUB_STEP_SUMMARY
  • Container Security - Multi-stage builds, Trivy scanning, image tagging
  • Security Scanning - CodeQL, Dependabot, IaC scanning (Checkov, tfsec)
  • Troubleshooting - Debug mode, flaky tests, common issue
Full SKILL.md on GitHub

Allowed tools

Tools this skill is permitted to call.

  1. 01Bash
  2. 02Read
  3. 03Write
  4. 04Glob
  5. 05Grep

Bundled files

  • .gitignore
  • .skilz-manifest.yaml
  • README.md
  • references/api.md
  • references/automation.md
  • references/monitoring.md
  • references/resources.md
  • references/search.md
  • references/workflow-authoring.md
  • scripts/batch-search.sh
  • scripts/find-repos-with-path.sh
  • scripts/wait-for-run.sh

FAQ

What does the mastering-github-cli skill do?

GitHub CLI (gh) command reference for repository search, code discovery, CI/CD monitoring, workflow authoring, and automation. Triggers on "gh" commands, "github cli", searching repos for files/directories (.skilz, .cursor, .codex, Dockerfile), monitoring GitHub Actions workflows, checking PR CI status, downloading artifacts, creating PRs/issues/repos from command line, triggering workflows, forking repos, batch operations, "write a workflow", "github actions", "CI/CD pipeline", "workflow yaml", and "matrix builds". Use for gh search, gh run, gh pr, gh issue, gh repo, gh workflow, gh api, workflow authoring, and automating GitHub operations.

How do I install the mastering-github-cli skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the mastering-github-cli skill run scripts?

Yes, this skill bundles executable scripts. Review the source before installing.

Related skills

Compare mastering-github-cli with