gitlab について
`orbit` コマンドラインで GitLab を管理するスキルです。GitLab Cloud とセルフホスト環境に対応し、プロジェクトやマージリクエスト、CI/CD などを扱います。プロファイル管理とシークレット解決も利用できます。
主な機能
- 01プロジェクト、グループ、メンバーの管理
- 02マージリクエストとイシューの操作
- 03パイプラインとスケジュールの確認
- 04ブランチ、タグ、コミットの管理
- 05プロファイル選択とシークレット解決
活用シーン
- 01マージリクエストとパイプラインをレビュー
- 02イシューやプロジェクトメンバーを検索
- 03パイプラインスケジュールを作成または実行
- 04`orbit` でセルフホスト GitLab を利用
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ jorgemuza/ orbit --skill gitlabインストール後、Claude Code で/gitlabを入力して読み込まれたか確認します。
同梱ファイルreferences/commands.md
詳細
orbit CLI を使用した GitLab
orbit CLI を通じて、GitLab のプロジェクト、マージリクエスト、パイプライン、パイプラインスケジュール、イシュー、ブランチ、タグ、コミット、メンバー、ユーザーを管理します。REST API v4 を使用し、GitLab Cloud とセルフホスト型インスタンスの両方に対応します。複数プロファイルのサポートと、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でgitlabサービスが設定されたプロファイル- 有効な認証情報(Personal Access Token または Bearer token)。1Password(
op://)または Infisical(infisical://)の参照として保存できます。
クイックリファレンス
すべてのコマンドは次の形式です。orbit -p <profile> gitlab <command> [flags]
エイリアス:orbit -p <profile> gl <command> [flags]
すべてのコマンドは、JSON 出力用の -o json に対応しています。コマンドの詳細とすべてのフラグについては、references/commands.md を参照してください。
自己署名証明書を使用するセルフホスト型インスタンスでは、サービス設定に tls_skip_verify: true を追加します。プロキシ経由で接続する場合は、proxy: socks5://host:port を追加します(http:// と https:// にも対応しています)。
プロジェクトの指定
プロジェクトは数値 ID またはフルパスで指定できます。
orbit -p myprofile gl project 595orbit -p myprofile gl project schools/frontend/my-app
グループも ID またはフルパスで指定できます。schools/frontend
主なワークフロー
プロジェクトとグループを確認する
# View project details
orbit -p myprofile gl project schools/frontend/my-app
# List your projects (membership-based)
orbit -p myprofile gl project list --search frontend
# Edit project settings (default branch, visibility, description)
orbit -p myprofile gl project edit 595 --default-branch main
orbit -p myprofile gl project edit 595 --visibility private
orbit -p myprofile gl project edit 595 --archived
# List all projects in a group (includes subgroups)
orbit -p myprofile gl project list --group schools/frontend
# Projects with activity today (shows branches)
orbit -p myprofile gl project activity
# Activity in the last 7 days, filtered by branch
orbit -p myprofile gl project activity --days 7 --branch development,master
# View group info
orbit -p myprofile gl group view schools/frontend
# List subgroups
orbit -p myprofile gl group subgroups schools
マージリクエストを操作する
GitLab では「マージリクエスト」(MR)と呼ばれ、GitHub の「プルリクエスト」(PR)に相当します。
# List open MRs
orbit -p myprofile gl mr list 595
# List merged MRs
orbit -p myprofile gl mr list 595 --state merged
# View MR details (shows source/target branch, conflicts, review status)
orbit -p myprofile gl mr view 595 42
# Create an MR
orbit -p myprofile gl mr create 595 \
--source feature/login --target main --title "Add login page"
# Merge an MR (with optional squash)
orbit -p myprofile gl mr merge 595 42 --squash
# Approve / unapprove
orbit -p myprofile gl mr approve 595 42
orbit -p myprofile gl mr unapprove 595 42
# Check approval status
orbit -p myprofile gl mr approvals 595 42
# Rebase onto target branch
orbit -p myprofile gl mr rebase 595 42
# Close / reopen
orbit -p myprofile gl mr close 595 42
orbit -p myprofile gl mr reopen 595 42
# Edit MR (title, description, assignee, labels, draft)
orbit -p myprofile gl mr edit 595 42 --title "Updated title"
orbit -p myprofile gl mr edit 595 42 --assignee 15 --labels "bug,urgent"
# Add a comment
orbit -p myprofile gl mr comment 595 42 --body "LGTM!"
# List discussion comments (excludes system notes)
orbit -p myprofile gl mr notes 595 42
CI/CD パイプライン
# List recent pipelines
orbit -p myprofile gl pipeline list 595
# Filter by branch and status
orbit -p myprofile gl pipeline list 595 --ref main --status failed
# View pipeline details
orbit -p myprofile gl pipeline view 595 12345
# List jobs in a pipeline (shows stage, status, duration)
orbit -p myprofile gl pipeline jobs 595 12345
# Retry a failed pipeline
orbit -p myprofile gl pipeline retry 595 12345
# Cancel a running pipeline
orbit -p myprofile gl pipeline cancel 595 12345
パイプラインのエイリアスは pipeline、pipe、ci です。そのため、orbit gl ci list 595 も使用できます。
パイプラインスケジュールを一覧表示
orbit -p myprofile gl schedule list 595
毎晩のスケジュールを作成
orbit -p myprofile gl schedule create 595 --desc "Nightly build" --ref main --cron "0 2 * * *"
スケジュールをすぐに実行
orbit -p myprofile gl schedule run 595 42
スケジュールの cron を更新、または無効化
orbit -p myprofile gl schedule update 595 42 --cron "0 3 * * *" orbit -p myprofile gl schedule update 595 42 --active=false
スケジュール変数を追加・削除
orbit -p myprofile gl schedule var 595 42 DEPLOY_ENV production orbit -p myprofile gl schedule var-delete 595 42 DEPLOY_ENV
スケジュールを削除
orbit -p myprofile gl schedule delete 595 42
スケジュールのエイリアスは schedule、sched です。
ブランチとタグ
# List branches
orbit -p myprofile gl branch list 595 --search feature
# View branch details (includes latest commit)
orbit -p myprofile gl branch view 595 main
# Create a branch from a ref
orbit -p myprofile gl branch create 595 feature/new-thing main
# Delete a branch
orbit -p myprofile gl branch delete 595 feature/old-thing
# Protect a branch (only maintainers can merge, no direct push)
orbit -p myprofile gl branch protect 650 main --push no-access --merge maintainer
# List protected branches
orbit -p myprofile gl branch protections 650
# Remove protection
orbit -p myprofile gl branch unprotect 650 main
# List tags
orbit -p myprofile gl tag list 595
# Create an annotated tag
orbit -p myprofile gl tag create 595 v1.0.0 main -m "Release v1.0.0"
コミット
# List recent commits (default branch)
orbit -p myprofile gl commit list 595
# List commits on a specific branch
orbit -p myprofile gl commit list 595 --ref feature/login
# View commit details
orbit -p myprofile gl commit view 595 abc1234
イシュー
# List open issues
orbit -p myprofile gl issue list 595 --state opened
# Filter by labels
orbit -p myprofile gl issue list 595 --labels bug,urgent
# View issue details
orbit -p myprofile gl issue view 595 1
# Create an issue
orbit -p myprofile gl issue create 595 --title "Fix login bug" --labels bug,urgent
# Close an issue
orbit -p myprofile gl issue close 595 1
メンバーとユーザー
# List project members (shows access level: Guest/Reporter/Developer/Maintainer/Owner)
orbit -p myprofile gl member list 595
# Show current authenticated user
orbit -p myprofile gl user me
# Search users
orbit -p myprofile gl user list --search john
よく使うパターン
スクリプト用に JSON を取得する:
すべてのコマンドで、機械可読な出力を得るために -o json を使用できます。
orbit -p myprofile gl mr list 595 -o json | jq '.[].title'
ブランチの CI ステータスを確認する:
orbit -p myprofile gl pipeline list 595 --ref main --limit 1
プロジェクトで作業しているユーザーを調べる:
orbit -p myprofile gl member list 595
MR を最初から最後までレビューする:
# View MR details
orbit -p myprofile gl mr view 595 42
# Check its pipeline
orbit -p myprofile gl pipeline list 595 --ref feature/login --limit 1
# Read discussion
orbit -p myprofile gl mr notes 595 42
# Approve with comment
orbit -p myprofile gl mr comment 595 42 --body "Approved, looks good"
重要な注意事項
- プロファイルが必須です — GitLab 接続を選択するには、必ず
-p <profile>を指定します。プロファイルには、タイプがgitlabのサービスを設定しておく必要があります。 - サービスフラグ — プロファイルに複数の GitLab サービスがある場合は、
--service <name>を使用して対象を指定します。 - Cloud とセルフホスト型 — どちらにも対応しています。プロファイル設定のベース URL によって GitLab インスタンスが決まります。
- シークレット参照 — 設定内の認証情報には、1Password(
op://vault/item/field)または Infisical(infisical://<env>/<path>/<KEY>)の参照を使用でき、実行時に解決されます。orbit authを一度実行すると、すべてのシークレットが解決され、キャッシュされます(1Password では生体認証プロンプトが一度だけ表示されます)。キャッシュを消去するにはorbit auth clearを使用します。シークレットを参照してください。 - MR = PR — GitLab の文脈でユーザーが「プルリクエスト」または「PR」と言った場合は、マージリクエストを意味します。
- ページネーション — ほとんどの一覧コマンドでは、結果の既定件数は 20~50 件です。
--limit Nで調整できます。