mcpField
G
gh-search-repos

gh-search-repos

github.com/aaddrick開発959 回インストール50 週間前に更新
リポジトリ

gh-search-repos について

gh-search-reposは、GitHub CLIでGitHub上のリポジトリを検索するためのスキルです。属性、人気度、Issue、日付、検索範囲による絞り込みと、除外検索の構文を説明します。

主な機能

  1. 01言語、トピック、ライセンス、所有者で絞り込み
  2. 02スター数、フォーク数、Issue数の条件指定
  3. 03日付やアーカイブ状態による絞り込み
  4. 04結果の並べ替えと出力フィールドの選択
  5. 05クエリ構文による検索結果の除外

活用シーン

  1. 01特定言語の人気リポジトリを検索
  2. 02good first issue付きのプロジェクトを探す
  3. 03トピックやライセンスからリポジトリを検索
  4. 04アーカイブ済みや特定言語のリポジトリを除外

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/aaddrick/gh-cli-search --skill gh-search-repos

インストール後、Claude Code で/gh-search-reposを入力して読み込まれたか確認します。

詳細

GitHub CLI:リポジトリを検索する

概要

gh search repos を使って GitHub 全体からリポジトリを検索します。スター数、フォーク数、言語、トピック、ライセンスなどで絞り込めます。

このスキルを使う場面

GitHub 全体からリポジトリを検索する際に、このスキルを使います:

  • 人気度(スター数/フォーク数)でリポジトリを探す
  • プログラミング言語やトピックで検索する
  • 初心者向けの課題があるリポジトリを探す
  • ライセンスやアーカイブ済みかどうかで絞り込む
  • 特定の組織内、または所有者で検索する
  • 特定の検索結果を除外する(-- フラグが必要)

構文

gh search repos [<query>] [flags]

主なフラグの一覧

リポジトリの属性
フラグ用途例
--language <string>プログラミング言語--language python
--topic <strings>リポジトリのトピック--topic machine-learning
--license <strings>ライセンスの種類--license mit
--archived {true|false}アーカイブ状態--archived false
--owner <strings>リポジトリの所有者--owner github
--visibility <string>公開範囲:public、private、internal--visibility public
人気度の指標
フラグ用途例
--stars <number>スター数--stars ">1000"
--forks <number>フォーク数--forks ">100"
--followers <number>フォロワー数--followers ">50"
--size <string>サイズ(KB)--size "100..1000"
課題の数
フラグ用途例
--good-first-issues <number>「Good first issue」ラベルの数--good-first-issues ">=5"
--help-wanted-issues <number>「Help wanted」ラベルの数--help-wanted-issues ">=3"
日付による絞り込み
フラグ用途例
--created <date>作成日--created ">2024-01-01"
--updated <date>最終更新日--updated ">2024-06-01"
検索範囲
フラグ用途例
--match <strings>検索対象:名前、説明、README--match name
--include-forks {false|true|only}フォークを含める/除外する--include-forks false
出力と並べ替え
フラグ用途例
-L, --limit <int>結果の最大数(既定値:30)--limit 100
--sort <string>並べ替え基準:スター数、フォーク数、更新日時など--sort stars
--order <string>並べ替え順:asc または desc--order desc
--json <fields>JSON 出力--json name,stargazersCount,language
-w, --webブラウザーで開く-w

JSON 出力フィールド

createdAt、defaultBranch、description、forksCount、fullName、hasDownloads、hasIssues、hasPages、hasProjects、hasWiki、homepage、id、isArchived、isDisabled、isFork、isPrivate、language、license、name、openIssuesCount、owner、pushedAt、size、stargazersCount、updatedAt、url、visibility、watchersCount

除外構文(重要!)

インラインクエリで除外(- を使った否定)する場合は、必ず -- 区切りを使ってください。

✅ 正しい例:gh search repos -- "search-terms -qualifier:value" ❌ 誤った例:gh search repos "search-terms" --flag=-value ❌ 誤った例:gh search repos "search-terms" --flag=!value ❌ 誤った例:gh search repos --language=-Go

例:

  • gh search repos -- "cli -language:go"(言語を除外)
  • gh search repos -- "starter -archived:true"(アーカイブ済みのリポジトリを除外)
  • gh search repos -- "web -topic:deprecated"(トピックを除外)
  • gh search repos -- "library -license:gpl-3.0"(ライセンスを除外)

-- 区切りが必要な理由: -- は、シェルにフラグの解析を終了し、それ以降をすべて引数として扱うよう指示します。これがないと、引用符内の -qualifier:value が誤って解釈される場合があります。

重要な構文ルール

フラグ構文とクエリ構文の使い分け

判断ツリー:

Does your search include:
  - Any exclusions (NOT, minus, without, except)?  → Use Query Syntax with `--`
  - Complex boolean logic (OR, AND)?              → Use Query Syntax with `--`

Otherwise:
  - Simple positive filters only?                  → Use Flag Syntax

フラグ構文(肯定的なフィルターに使用):

gh search repos "cli" --language go --stars ">100"

-- を使うクエリ構文(除外に必須):

gh search repos -- "cli -language:javascript -archived:true"

⚠️ 1つのコマンドで両方の構文を混在させないでください!

1. 除外と否定

重要: 結果を除外する場合は、必ず -- 区切り文字を使ったクエリ構文を使用してください。

除外構文のルール:
  1. クエリの前に -- 区切り文字を使用します
  2. -qualifier:value 形式(否定を示すダッシュを先頭に付ける)を使用します
  3. クエリ文字列全体を引用符で囲みます
例:

1つの項目を除外:

# Exclude specific language
gh search repos -- "web framework -language:javascript"

# Exclude archived repos
gh search repos -- "cli tool -archived:true"

複数の項目を除外:

# Exclude multiple languages
gh search repos -- "game engine -language:javascript -language:python"

# Exclude archived and small repos
gh search repos -- "starter -archived:true -stars:<10"

フラグを使った肯定的なフィルターとの組み合わせ:

# Wrong - mixing syntaxes:
gh search repos "cli" --language go -archived:true  # ❌

# Correct - use query syntax for everything when excluding:
gh search repos -- "cli language:go -archived:true"  # ✅

PowerShellでの除外:

# Use --% to prevent PowerShell parsing
gh --% search repos -- "cli -language:javascript"
よく使われる除外パターン:
ユーザーのリクエストコマンド
「リポジトリを検索するが、アーカイブ済みのものは除外」gh search repos -- "starter -archived:true"
「特定の言語を除外したリポジトリ」gh search repos -- "web framework -language:php"
「特定のトピックに属さないリポジトリ」gh search repos -- "cli -topic:deprecated"
「複数の言語を除外したリポジトリ」gh search repos -- "game -language:javascript -language:css"
「フォークではないリポジトリ」gh search repos -- "template -is:fork"(または --include-forks false を使用)
「スター数が少ないリポジトリを除外」gh search repos -- "framework -stars:<100"
「特定のライセンスを除外したリポジトリ」gh search repos -- "library -license:gpl-3.0"
2. 特殊な値
  • 複数のトピック:--topic unix,terminal
  • ブール値フラグ:--archived false または --archived true
  • フォークの対象範囲:--include-forks false|true|only
3. 引用符のルール

複数語での検索:

gh search repos "machine learning"

比較演算子には引用符が必要です:

gh search repos "python" --stars ">1000"

範囲は引用符で囲みます:

gh search repos "cli" --stars "100..500"

よくある使用例

人気のある Python リポジトリを検索:

gh search repos "data science" --language python --stars ">5000"

初めての貢献に適した Issue があるリポジトリを検索:

gh search repos --language javascript --good-first-issues ">=10"

最近更新されたリポジトリを検索:

gh search repos "react" --updated ">2024-01-01" --stars ">100"

トピックからリポジトリを検索:

gh search repos --topic machine-learning --language python

ライセンスからリポジトリを検索:

gh search repos "web framework" --license mit,apache-2.0

アーカイブ済みのリポジトリを除外:

gh search repos "cli tool" --archived false

組織からリポジトリを検索:

gh search repos --owner microsoft --visibility public

フォークを除外:

gh search repos "starter" --include-forks false

フォークのみを検索:

gh search repos "template" --include-forks only

スター数の範囲を指定してリポジトリを検索:

gh search repos "game engine" --stars "100..1000"

特定の言語を除外:

gh search repos -- "cli -language:go"

名前のみを検索:

gh search repos "awesome" --match name

よくある間違い

間違い問題修正方法
--language="NOT javascript" または --archived=-trueフラグ構文では否定をサポートしていませんクエリを使用:-- "-language:javascript" または -- "-archived:true"
gh search repos cli -language:js-language がフラグとして解釈されます-- を使用:-- "cli -language:js"
"cli NOT language:js"NOT キーワードは機能しません- を使用:-- "cli -language:js"
構文の混在:--stars ">100" "cli -language:js"フラグとクエリの修飾子は混在できませんすべてクエリを使用:-- "cli stars:>100 -language:js"
比較演算子を引用符で囲まないシェルが > を解釈します引用符で囲む:--stars ">1000"
--archived archived無効な値ですブール値を使用:--archived true または false
複数語の検索を引用符で囲まない個別に検索されます引用符で囲む:"machine learning"
owner に @ を使用無効な構文です@ を外す:--owner github
PowerShell で --% を指定しない除外指定で問題が発生します追加:gh --%

インストールの確認

gh コマンドが見つからない場合:

# Check if gh is installed
which gh

# Install: https://cli.github.com/manual/installation

認証されていない場合:

# Authenticate with GitHub
gh auth login

比較演算子

  • > - より大きい
  • >= - 以上
  • < - より小さい
  • <= - 以下
  • .. - 範囲:100..1000 または 2024-01-01..2024-12-31

よく使われるライセンス

  • mit - MIT License
  • apache-2.0 - Apache License 2.0
  • gpl-3.0 - GNU GPL v3
  • bsd-2-clause - BSD 2-Clause
  • bsd-3-clause - BSD 3-Clause
  • mpl-2.0 - Mozilla Public License 2.0
  • isc - ISC License

検索対象フィールドのオプション

  • name - リポジトリ名のみを検索
  • description - 説明のみを検索
  • readme - README ファイルのみを検索

例:gh search repos "documentation" --match readme

関連項目

コメント