agentsclimarketplace

Gh cli search

Skill cxcscmu/SkillLearnBench/skills/b1-one-shot-claude-opus-4-6/github-repo-analytics/gh-cli-search

Using the gh CLI to search and list GitHub issues and pull requests with date filters and label queries.From its SKILL.md

Install
npx -y skills add cxcscmu/SkillLearnBench --skill gh-cli-search

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

1.9 KB, 507 tokens by cl100k_base, as published. Nobody here has run it

GitHub CLI: Searching Issues and Pull Requests

Overview

The gh CLI provides powerful commands for listing and searching issues and PRs in any public repository. Key subcommands: gh pr list, gh issue list, and gh search variants.

Listing PRs by Date Range

# List PRs created in a date range (returns up to --limit items)
gh pr list --repo owner/repo --state all --search "created:2024-12-01..2024-12-31" --limit 500 --json number,state,author,createdAt,mergedAt,closedAt

Key flags:

  • --state all includes open, closed, and merged PRs
  • --search accepts GitHub search qualifiers like created:YYYY-MM-DD..YYYY-MM-DD
  • --json selects fields; available fields include: number, state, author, createdAt, mergedAt, closedAt, title, labels
  • --limit N controls max results (default 30)

Listing Issues by Date Range

# List issues created in a date range
gh issue list --repo owner/repo --state all --search "created:2024-12-01..2024-12-31" --limit 500 --json number,state,labels,createdAt,closedAt

Note: gh issue list excludes pull requests by default.

Searching with Labels

# Search for issues with a label containing "bug"
gh issue list --repo owner/repo --state all --search "created:2024-12-01..2024-12-31 label:bug" --limit 500 --json number,state,labels,closedAt

For labels with spaces or special characters, quote them: label:"type: bug".

Pagination / Limits

  • The --limit flag can go up to 1000 per call.
  • For very large result sets, paginate using gh api with --paginate.

Using gh api for More Control

# Direct API call with search endpoint
gh api search/issues --method GET \
  -f q='repo:owner/repo is:pr created:2024-12-01..2024-12-31' \
  -f per_page=100 \
  --paginate

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.