スキル一覧に戻る
aaddrick

gh-search

by aaddrick

A comprehensive Claude Code plugin providing skills and commands for using GitHub CLI (gh) search effectively

3🍴 0📅 2025年12月31日
GitHubで見るManusで実行

SKILL.md


name: gh-search description: Use when searching GitHub via CLI for issues, PRs, repos, code, or commits - provides correct syntax for exclusions, qualifiers, quoting, and platform-specific handling to avoid command failures

GitHub CLI Search

Overview

Search GitHub from the command line using gh search subcommands. The key principle: Always use -- before queries with exclusions to prevent shell interpretation of - prefixes.

When to Use

Use this skill when:

  • Searching GitHub via gh CLI for issues, PRs, repos, code, or commits
  • User requests searches with exclusions (NOT, minus prefix)
  • Constructing complex queries with multiple qualifiers
  • Queries contain spaces or special characters

Subcommands Quick Reference

SubcommandUse ForCommon Flags
gh search issuesIssues (add --include-prs for PRs too)--label, --state, --author, --assignee
gh search prsPull requests only--label, --state, --author, --draft, --merged
gh search reposRepositories--language, --stars, --topic, --owner
gh search codeCode within files--repo, --language, --filename
gh search commitsCommit messages--repo, --author, --committer

Critical Syntax Rules

1. Exclusions Require -- Flag

Unix/Linux/Mac:

gh search issues -- "bug -label:duplicate"

PowerShell:

gh --% search issues -- "bug -label:duplicate"

Why: The - prefix gets interpreted as a command flag without --. PowerShell needs --% to stop parsing.

2. Quoting Rules

Multi-word queries need quotes:

gh search issues "memory leak"

Entire query with spaces should be quoted:

gh search issues "bug label:urgent created:>2024-01-01"

Qualifier values with spaces need inner quotes:

gh search prs -- 'security label:"bug fix"'

3. Qualifier Syntax

Inline qualifiers (use within search query):

gh search repos "react stars:>1000 language:typescript"

Flag-based (use as separate flags):

gh search repos "react" --language typescript --stars ">1000"

Can mix both:

gh search issues "crash" --label bug created:>2024-01-01

Common Qualifiers

Comparison Operators

  • >, >=, <, <= - Numeric: stars:>100, comments:>=5
  • .. - Ranges: stars:10..50, created:2024-01-01..2024-12-31

Special Values

  • @me - Current user: author:@me, assignee:@me, owner:@me
  • Dates use ISO8601: created:>2024-01-01 or created:2024-01-01..2024-12-31
  • in:title - Search in title only
  • in:body - Search in body only
  • in:comments - Search in comments only

Exclusions

  • -qualifier:value - Exclude: -label:bug, -language:javascript
  • NOT keyword - For words only: "hello NOT world"

Examples

Find your open issues without bug label:

gh search issues -- "is:open author:@me -label:bug"

Find popular Python ML repos updated recently:

gh search repos "machine learning" --language python --stars ">1000" --updated ">2024-01-01"

Find PRs with specific label and text:

gh search prs -- 'security label:"bug fix" created:>2024-01-01'

Search code in organization repos:

gh search code "TODO" --owner myorg --language javascript

Common Mistakes

MistakeProblemFix
gh search issues -label:bug-label interpreted as flagAdd --: gh search issues -- "-label:bug"
gh search repos machine learningSearches "machine" OR "learning"Quote it: "machine learning"
in:title outside quotesShell interprets : oddlyInclude in query: "crash in:title"
Mixing @ with valueInvalid syntaxUse @me or username, not both: author:@me ✓, author:@username ✗ (drop @)
PowerShell without --%Parsing breaks with exclusionsAdd gh --% before command

Output Options

All subcommands support:

  • --limit <n> - Max results (default: 30, max: 1000)
  • --json <fields> - JSON output for scripting
  • --web - Open results in browser
  • --sort <field> - Sort by: comments, created, reactions, updated, stars, etc.
  • --order asc|desc - Sort direction (default: desc)

Real-World Impact

Correct syntax prevents:

  • Command failures from misinterpreted flags
  • Missing results from incorrect exclusions
  • Errors from unquoted spaces
  • Platform-specific parsing issues

スコア

総合スコア

70/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です