コマンドラインからGitHub issueの本文やコメントを読み取り専用で確認し、URLや番号から対象リポジトリを指定する手順を案内します。
- issueの本文とコメントを読みたいとき
- URLからissueの内容を確認したいとき
- 別リポジトリのissueを参照したいとき
`gh`でGitHubのIssue、プルリクエスト、リポジトリを読み取り専用で検索・確認し、必要な情報を絞り込む方法を案内します。
Instructions for using the `gh` command to query and inspect GitHub state safely.
実行スコア 未検証
インストール方法を見るghを使ってGitHub上のIssueやプルリクエスト、リポジトリ、コードを検索・確認する手順を案内します。IssueやPRの一覧、個別の内容や差分、状態の確認に加え、検索語を指定した調査にも使えます。通常のコマンドで取得できない情報は、gh apiからREST APIまたはGraphQLを読み取り専用で呼び出して調べます。ページ分割された結果の取得や、--json、--jq、--templateによる絞り込み・整形の例も含まれています。
変更を加える前に、既存のIssueやPR、リポジトリの状態を確かめたいときに向いています。GitHub上の情報をコマンドで探したい人や、APIから必要な項目だけ取得したい人にも役立ちます。
ghによるGitHubの状態変更は禁止されており、apiもGETリクエストに限られます。ghコマンドを使える環境が必要です。既定リポジトリの設定変更は人が行います。
この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。
SKILL.md の記述から、注意が要る操作と導入の前提を AI が確認しました。点数は実際に動かした結果(実行検証)だけで付けています。
点数には入れていません。 2026年10月26日 時点で AI(OpenAI Codex)が判定しました。目安なので、入れる前に原文も確認してください。
インストールする前に、エージェントに与えられる指示の中身を確認できます。
This skill provides instructions for using the GitHub CLI (gh) to query,
inspect, and search GitHub state (issues, pull requests, repositories) for the
Carbon project.
[!IMPORTANT] AI assistants MUST NOT use the
ghtool to modify any GitHub project state. Do NOT run commands that create, edit, delete, label, comment on, or merge issues, pull requests, releases, or any other resources.
listviewsearchstatusapi (Only with GET requests)createeditdeletemergereopenclosecommentlabelThe gh tool interacts with a default repository when run within a local check
out. For this project, the default repository is expected to be
carbon-language/carbon-lang.
To verify the current default repository configuration:
gh repo view
The output should indicate the repository is carbon-language/carbon-lang.
If the default repository is misconfigured (for example, pointing to a personal fork or a different repository), the human operator must correct it.
[!IMPORTANT] AI Assistants MUST NOT attempt to mutate
ghconfiguration or run commands that change the default repository (such asgh repository set-default).
Instruct the human operator to run the following command to select the correct default repository:
gh repo set-default
The operator will be prompted to select the correct repository (e.g.,
carbon-language/carbon-lang) from the available remotes.
gh issue listgh issue view <number>gh issue search "<query>"
gh issue search "crash" --state opengh pr listgh pr view <number>gh pr diff <number>gh pr statusgh search code "<query>"gh search repos "<query>"For queries that are not supported by standard gh commands, you can use the
gh api command to query the GitHub REST or GraphQL APIs.
Query the REST API using paths relative to the API root.
List contributors:
gh api repos/carbon-language/carbon-lang/contributors
List issue comments:
gh api repos/carbon-language/carbon-lang/issues/<issue_number>/comments
For complex queries, use GraphQL to fetch exactly the data needed.
Get repository information:
gh api graphql -f query='
query {
repository(owner: "carbon-language", name: "carbon-lang") {
description
stargazerCount
}
}
'
Use the --paginate flag to automatically fetch all pages of results.
gh api --paginate repos/carbon-language/carbon-lang/issues
Use --json to request JSON output, and --jq or --template to filter or
format the results.
List PR titles and authors:
gh pr list --json title,author --jq '.[] | "\(.title) by \(.author.login)"'
Format with Go templates:
gh issue list --template '{{range .}}{{.number}} - {{.title}}{{"\n"}}{{end}}'
まだレビューはありません。使ってみた感想をお寄せください。
ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。
まだコメントはありません。最初のコメントを書いてみませんか。
コマンドラインからGitHub issueの本文やコメントを読み取り専用で確認し、URLや番号から対象リポジトリを指定する手順を案内します。
AIアシスタントがCarbonのコードベースを扱う際に、専用ツールでファイルを閲覧・検索・編集し、一時ファイルを管理するためのルールを示します。
Bazeliskを使ったCarbonプロジェクトのビルド、テスト、実行、デバッグの基本手順を確認し、対象を絞った検証やASanの利用方法も把握できます。
Carbonコンパイラに組み込み関数を追加する際の登録、型シグネチャ検証、定数評価、LLVMコード生成、テスト方法を案内します。
Carbonツールチェーンのコードを書く際に、言語ごとの整形方法やコメント、命名、ドキュメント、コミットメッセージの基準を確認できます。
Carbonコンパイラのエラーや警告を定義し、書式やソース位置のラベルを整え、テストで網羅性を確かめる方法を案内します。