github について
github は orbit CLI で GitHub を管理するスキルです。GitHub.com または GitHub Enterprise を使う開発者向けで、リポジトリ操作や Actions の管理、REST API へのアクセスに対応し、複数プロファイルを扱えます。
主な機能
- 01リポジトリ、Issue、プルリクエストの管理
- 02Actions の実行状況の確認と管理
- 03ブランチ、タグ、コミット、リリースの管理
- 04クライアント側で暗号化したシークレット設定
- 05REST API によるエンドポイント操作
- 06複数プロファイルと JSON 出力
活用シーン
- 01プルリクエストの確認とコメント
- 02失敗した CI のステップとログの調査
- 03ワークフローの起動や実行状況の監視
- 04リポジトリのシークレットとリリースの管理
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ jorgemuza/ orbit --skill githubインストール後、Claude Code で/githubを入力して読み込まれたか確認します。
同梱ファイルreferences/commands.md
詳細
orbit CLI で GitHub を操作
orbit CLI を通じて、GitHub のリポジトリ、プルリクエスト、イシュー、リリース、ブランチ、タグ、コミット、ワークフロー実行、シークレット、ユーザーを管理します。REST API を使用し、GitHub.com と GitHub Enterprise の両方に対応しています。また、複数プロファイルのサポートと 1Password のシークレット解決にも対応しています。
前提条件
orbitCLI がインストールされていること —which orbitが失敗する場合は、次の方法でインストールしてください:- macOS/Linux(Homebrew):
brew install jorgemuza/tap/orbit - macOS/Linux(スクリプト):
curl -sSfL https://raw.githubusercontent.com/jorgemuza/orbit/main/install.sh | sh - Windows(Scoop):
scoop bucket add jorgemuza https://github.com/jorgemuza/scoop-bucket && scoop install orbit
- macOS/Linux(Homebrew):
~/.config/orbit/config.yamlでgithubサービスを設定したプロファイル- 有効な認証情報(Personal Access Token)。1Password(
op://)または Infisical(infisical://)の参照として保存できます
クイックリファレンス
すべてのコマンドは次の形式です:orbit -p <profile> github <command> [flags]
エイリアス:orbit -p <profile> gh <command> [flags]
すべてのコマンドで JSON 出力の -o json を使用できます。コマンドの詳細とすべてのフラグについては、references/commands.md を参照してください。
リポジトリの指定
リポジトリは常に owner/repo の形式で指定します:
orbit -p myprofile gh repo octocat/hello-worldorbit -p myprofile gh repo kubernetes/kubernetes
主なワークフロー
リポジトリの確認
# View repo details
orbit -p myprofile gh repo octocat/hello-world
# List your repos (sorted by most recently pushed)
orbit -p myprofile gh repos
# List repos in an organization
orbit -p myprofile gh repos --org kubernetes
# List repos with limit
orbit -p myprofile gh repos --limit 10
# Edit repo settings
orbit -p myprofile gh repo edit Paybook/ai --description "Updated"
# Archive a repo
orbit -p myprofile gh repo edit Paybook/ai --archived
# List collaborators
orbit -p myprofile gh repo collab list Paybook/ai
# Add collaborator
orbit -p myprofile gh repo collab add Paybook/ai jorgemuza --permission admin
# Remove collaborator
orbit -p myprofile gh repo collab remove Paybook/ai jorgemuza
プルリクエストの操作
# List open PRs
orbit -p myprofile gh pr list octocat/hello-world
# List closed PRs
orbit -p myprofile gh pr list octocat/hello-world --state closed
# View PR details (shows head/base branch, labels, comments)
orbit -p myprofile gh pr view octocat/hello-world 42
# Create a PR
orbit -p myprofile gh pr create octocat/hello-world \
--head feature/login --base main --title "Add login page"
# Merge a PR (with optional method: merge, squash, rebase)
orbit -p myprofile gh pr merge octocat/hello-world 42 --method squash
# Add a comment
orbit -p myprofile gh pr comment octocat/hello-world 42 --body "LGTM!"
# List comments
orbit -p myprofile gh pr comments octocat/hello-world 42
GitHub Actions のワークフロー実行
# List recent workflow runs
orbit -p myprofile gh run list octocat/hello-world
# Filter by branch and status
orbit -p myprofile gh run list octocat/hello-world --branch main --status completed
# View workflow run details, including every job and its steps
orbit -p myprofile gh run view octocat/hello-world 12345
# Why did it fail? Print the log output of the failed step(s) only
orbit -p myprofile gh run view octocat/hello-world 12345 --log-failed
# List the jobs of a run (ID, status, conclusion, elapsed, name)
orbit -p myprofile gh run jobs octocat/hello-world 12345
# Full logs: the whole run, or a single job
orbit -p myprofile gh run log octocat/hello-world 12345
orbit -p myprofile gh run log octocat/hello-world 12345 --job 67890
orbit -p myprofile gh run log octocat/hello-world 12345 --failed
# View one job of a run, or a specific attempt
orbit -p myprofile gh run view octocat/hello-world 12345 --job 67890
orbit -p myprofile gh run view octocat/hello-world 12345 --attempt 2
# Non-zero exit when the run did not succeed (for scripts and CI gates)
orbit -p myprofile gh run view octocat/hello-world 12345 --exit-status
# Watch a run in real-time (polls and shows job/step progress until completion)
orbit -p myprofile gh run watch octocat/hello-world
orbit -p myprofile gh run watch octocat/hello-world 12345 --interval 10
# Cancel a running workflow
orbit -p myprofile gh run cancel octocat/hello-world 12345
# Re-run a workflow
orbit -p myprofile gh run rerun octocat/hello-world 12345
実行エイリアス:run、actions — そのため、orbit gh actions list octocat/hello-world も使用できます。
watch コマンドでは、実行 ID が指定されていない場合、進行中の最新の実行を自動検出します。経過時間とともに、ジョブとステップのステータスをリアルタイムで表示し、実行が失敗するとエラーで終了します。
ログの取得(--log、--log-failed、run log)では、GitHub から署名付きストレージ URL へのリダイレクトをたどります。サービスにプロキシが設定されている場合、環境プロキシが適用される場合、または tls_skip_verify が設定されている場合、orbit はリダイレクトをたどりません。リクエストの送信先を検証できず、代わりに内部サービスから気付かないままログを取得してしまう可能性があるためです。現在、企業プロキシの背後にいるユーザーはログを取得できません。 エラーには、適用された条件と変更方法が示されます。それ以外の run コマンドは通常どおり動作し、run view はブラウザーでログを読むための実行 URL を表示します。
失敗した実行をデバッグするには、まず run view <repo> <run-id> を実行します。すべてのジョブとステップが一覧表示されるため、失敗したステップをすぐに確認できます。次に run view <repo> <run-id> --log-failed を実行すると、実行全体のログを出力するのではなく、失敗したステップに絞って、そのログ出力を 1 つのコマンドで表示できます。ログの該当箇所とステップの対応付けはベストエフォートで行われ、各ログのまとまりには、matched_by に特定方法が示されます。step order は信頼性の高い方法です。error marker は適切なセクションを見つけていますが、どのステップに属するかは推定しています。step order (unconfirmed) は対応付けを裏付ける情報がなく、表示された箇所が失敗したステップのものとは限らないことを示します。独自の出力を生成しなかったステップについては、その旨が示され、隣接するステップのログが代わりに表示されることはありません。ステップを網羅していないログには切り詰められていることが示され、絞り込みできないログは、失敗したステップ名を明記したうえで全体が表示されます。ログ取得に関する注意点を参照してください。--log-failed は --job と組み合わせて単一のジョブに絞ることもでき、すべてのログコマンドで -o json を使用できます。
ワークフローの管理
# List workflows (get the numeric workflow ID)
orbit -p myprofile gh workflow list octocat/hello-world
# Trigger a workflow dispatch (--ref is required)
orbit -p myprofile gh workflow run octocat/hello-world 245836153 --ref main
# Trigger with inputs
orbit -p myprofile gh workflow run octocat/hello-world 245836153 --ref main --input env=staging
# Enable/disable a workflow
orbit -p myprofile gh workflow enable octocat/hello-world 245836153
orbit -p myprofile gh workflow disable octocat/hello-world 245836153
重要: workflow run には、ファイル名ではなく数値のワークフロー ID(workflow list で確認できます)が必要です。--ref フラグは必須です。
GitHub Actions のシークレット
# List repository secrets
orbit -p myprofile gh secret list octocat/hello-world
# Create or update a secret
orbit -p myprofile gh secret set octocat/hello-world MY_SECRET "secret-value"
# Delete a secret
orbit -p myprofile gh secret delete octocat/hello-world MY_SECRET
API に送信する前に、リポジトリの公開鍵を使用してクライアント側でシークレットを暗号化します。
ブランチとタグ
# List branches
orbit -p myprofile gh branch list octocat/hello-world
# View branch details (includes latest commit)
orbit -p myprofile gh branch view octocat/hello-world main
# List tags
orbit -p myprofile gh tag list octocat/hello-world
コミット
# List recent commits (default branch)
orbit -p myprofile gh commit list octocat/hello-world
# List commits on a specific branch
orbit -p myprofile gh commit list octocat/hello-world --ref feature/login
# View commit details
orbit -p myprofile gh commit view octocat/hello-world abc1234
イシュー
# List open issues
orbit -p myprofile gh issue list octocat/hello-world --state open
# Filter by labels
orbit -p myprofile gh issue list octocat/hello-world --labels bug,urgent
# View issue details
orbit -p myprofile gh issue view octocat/hello-world 1
# Create an issue
orbit -p myprofile gh issue create octocat/hello-world --title "Fix login bug" --labels bug,urgent
# Close an issue
orbit -p myprofile gh issue close octocat/hello-world 1
# Add a comment to an issue
orbit -p myprofile gh issue comment octocat/hello-world 1 --body "Working on this"
リリース
# List releases
orbit -p myprofile gh release list octocat/hello-world
# View a specific release
orbit -p myprofile gh release view octocat/hello-world 12345
# View the latest release
orbit -p myprofile gh release latest octocat/hello-world
ユーザー
# Show current authenticated user
orbit -p myprofile gh user me
# View a user profile
orbit -p myprofile gh user view octocat
Raw API アクセス
上記のコマンドで対応していない操作はすべて、プロファイルの認証情報を使って任意の GitHub REST エンドポイントにアクセスできる gh api から利用できます。エンドポイントは設定済みのベース URL からの相対パスです(先頭のスラッシュは省略可能)。そのため、GitHub Enterprise でもそのまま動作します。
# Any GET endpoint, pretty-printed
orbit -p myprofile gh api /repos/cli/cli
orbit -p myprofile gh api /repos/cli/cli/community/profile
# Every page of a collection (GET only)
orbit -p myprofile gh api /repos/cli/cli/issues --paginate -F per_page=100
# Status line and headers, e.g. to read rate limits
orbit -p myprofile gh api /rate_limit -i
# Write requests: the method defaults to POST once fields are supplied
orbit -p myprofile gh api /repos/octocat/hello-world/issues \
-f title="Bug report" -F [email protected]
# Array fields: repeat key[] to build a JSON array
orbit -p myprofile gh api /repos/octocat/hello-world/issues \
-f title="Bug report" -F 'labels[]=bug' -F 'labels[]=priority-1'
# Explicit method
orbit -p myprofile gh api /repos/octocat/hello-world/issues/1 -X PATCH -F state=closed
# Hand-written body from a file (or '-' for stdin)
orbit -p myprofile gh api /repos/octocat/hello-world/issues --input payload.json
# Request a specific media type
orbit -p myprofile gh api /repos/cli/cli/pulls/1 -H "Accept: application/vnd.github.diff"
-F は型を推論します(42 → 数値、true/false → ブール値、null → JSON の null、@file → ファイルの内容)。-f は常に文字列として送信します。GET/HEAD では、フィールドは本文ではなくクエリパラメーターになります。
どちらのフィールドフラグでも、key[]=value の配列形式を指定できます。繰り返し指定すると JSON 配列が作成されます(-F 'labels[]=bug' -F 'labels[]=p1' → {"labels":["bug","p1"]})。要素はスカラー値と同じルールで型変換され、1 回だけ指定しても配列になり、値なしの key[] を指定すると空の配列が送信されます。
このコマンドが通信するのは、プロファイルの接続先ホストだけです。トークンが送信されるリクエストになるため、別のホストを指す完全な URL、ページネーションリンク、リダイレクトは追跡せず、拒否します。
よくあるパターン
スクリプト用の JSON を取得する:
すべてのコマンドで -o json を指定すると、機械可読な出力を取得できます。
orbit -p myprofile gh pr list octocat/hello-world -o json | jq '.[].title'
ブランチの CI ステータスを確認する:
orbit -p myprofile gh run list octocat/hello-world --branch main --limit 1
リリースパイプラインを監視する:
orbit -p myprofile gh run watch octocat/hello-world
CI が失敗した理由を調べる:
# Most recent failure on main
orbit -p myprofile gh run list octocat/hello-world --branch main --status failure --limit 1
# Which step failed, and what it printed
orbit -p myprofile gh run view octocat/hello-world 12345 --log-failed
デプロイ用シークレットを設定する:
orbit -p myprofile gh secret set octocat/hello-world DEPLOY_TOKEN "ghp_xxxxx"
PR を最初から最後までレビューする:
# View PR details
orbit -p myprofile gh pr view octocat/hello-world 42
# Check its workflow runs
orbit -p myprofile gh run list octocat/hello-world --branch feature/login --limit 1
# Read discussion
orbit -p myprofile gh pr comments octocat/hello-world 42
# Approve with comment
orbit -p myprofile gh pr comment octocat/hello-world 42 --body "Approved, looks good"
重要な注意事項
- プロファイルが必須 — GitHub 接続を選択するには、必ず
-p <profile>を指定してください。プロファイルには、githubタイプのサービスが設定されている必要があります。 - サービスフラグ — プロファイルに複数の GitHub サービスがある場合は、
--service <name>を使って区別してください。 - クラウド版と Enterprise 版 — どちらでも動作します。GitHub.com の場合、
base_urlのデフォルト値はhttps://api.github.comです。GitHub Enterprise の場合は、プロファイル設定でbase_urlを設定してください。 - シークレット参照 - 設定内の認証情報では、1Password(
op://vault/item/field)または Infisical(infisical://<env>/<path>/<KEY>)の参照を使用でき、実行時に解決されます。orbit authを 1 回実行すると、すべてのシークレットが解決され、キャッシュされます(1Password の生体認証プロンプトは 1 回だけです)。キャッシュを消去するにはorbit auth clearを実行してください。シークレットを参照してください。 - ページネーション - ほとんどのリストコマンドでは、デフォルトで 20~50 件の結果が返されます。件数を調整するには
--limit Nを使ってください。gh api --paginateはLink rel="next"をたどってすべてのページを取得するため、大きなper_pageと組み合わせてください。 - Raw API -
gh api <endpoint>を使うと、型付きコマンドで対応していない任意の REST エンドポイントにアクセスできます。書き込みも可能なため、メソッドを必ず再確認してください。-Xを別途指定しない限り、-f/-F/--inputを指定すると POST になります。