CLIオプション
グローバルオプション
| フラグ | 説明 |
|---|---|
-V, --version | バージョン番号を出力して終了 |
-h, --help | コマンドのヘルプを表示 |
すべてのサブコマンドも-h, --helpで固有のヘルプテキストを表示。
出力オプション
1. --jsonフラグ
oma stats --json
oma doctor --json
対応コマンド:doctor、stats、retro、cleanup、auth:status、memory:init、verify、visualize。
2. --outputフラグ
oma stats --output json
oma doctor --output text
textまたはjsonを受け付け。無効な値はInvalid output formatエラー。
3. OH_MY_AG_OUTPUT_FORMAT環境変数
export OH_MY_AG_OUTPUT_FORMAT=json
oma stats # JSON出力
解決順序: --json > --output > 環境変数 > text(デフォルト)。
コマンドごとのオプション
update
oma update [-f | --force] [--ci]
| フラグ | 説明 | デフォルト |
|---|---|---|
--force / -f | ユーザーカスタム設定を上書き。oma-config.yaml、mcp.json、stack/が対象。 | false |
--ci | 非インタラクティブCIモード。確認プロンプトスキップ、プレーンテキスト出力。 | false |
stats
| フラグ | 説明 |
|---|---|
--reset | メトリクスデータをリセット |
retro
| フラグ | 説明 |
|---|---|
--interactive | 手動データ入力モード |
--compare | 前期間との比較表示 |
ウィンドウ形式:7d(7日)、2w(2週間)、1m(1ヶ月)。
cleanup
| フラグ | 説明 |
|---|---|
--dry-run | プレビューのみ、変更なし |
--yes / -y | 確認プロンプトをスキップ |
クリーンアップ対象:孤立PIDファイル(/tmp/subagent-*.pid)、孤立ログファイル、Gemini Antigravityディレクトリ。
agent:spawn
| フラグ | 説明 | デフォルト |
|---|---|---|
--model / -m | CLIベンダーオーバーライド。gemini、claude、codex、qwen。 | 設定から解決 |
--workspace / -w | エージェントの作業ディレクトリ。省略時はモノレポ設定から自動検出。 | 自動検出または. |
バリデーション: agent-idはbackend/frontend/mobile/qa/debug/pmのいずれか。session-idに..、?、#、%、制御文字は使用不可。
ベンダー固有の動作:
| ベンダー | コマンド | 自動承認フラグ | プロンプトフラグ |
|---|---|---|---|
| gemini | gemini | --approval-mode=yolo | -p |
| claude | claude | (なし) | -p |
| codex | codex | --full-auto | (位置引数) |
| qwen | qwen | --yolo | -p |
agent:status
| フラグ | 説明 |
|---|---|
--root / -r | メモリファイルとPIDファイルのルートパス |
ステータス判定:result-{agent}.md存在→completed、PIDファイル存在+プロセス生存→running、それ以外→crashed。
agent:parallel
| フラグ | 説明 |
|---|---|
--model / -m | 全エージェントに適用するベンダーオーバーライド |
--inline / -i | agent:task[:workspace]形式のインラインタスク指定 |
--no-wait | バックグラウンドモード |
インラインタスク形式:backend:Implement auth API:./api(最後のコロン区切りが./、/、.で始まればワークスペース)。
memory:init
| フラグ | 説明 |
|---|---|
--force | 既存スキーマファイルを上書き |
verify
| フラグ | 説明 |
|---|---|
--workspace / -w | 検証するワークスペースディレクトリ |
エージェントタイプ:backend、frontend、mobile、qa、debug、pm。
実践例
CIパイプライン:更新と検証
oma update --ci
oma doctor --json | jq '.healthy'
自動メトリクス収集
export OH_MY_AG_OUTPUT_FORMAT=json
oma stats | curl -X POST -H "Content-Type: application/json" -d @- https://metrics.example.com/api/v1/push
バッチエージェント実行とステータスモニタリング
oma agent:parallel tasks.yaml --no-wait
SESSION_ID="session-$(date +%Y%m%d-%H%M%S)"
watch -n 5 "oma agent:status $SESSION_ID backend frontend mobile"
CI後のクリーンアップ
oma cleanup --yes --json
ワークスペース対応の検証
oma verify backend -w ./apps/api
oma verify frontend -w ./apps/web
oma verify mobile -w ./apps/mobile
スプリントレビュー向け比較振り返り
oma retro 2w --compare
oma retro 2w --json > sprint-retro-$(date +%Y%m%d).json
フルヘルスチェックスクリプト
#!/bin/bash
set -e
echo "=== oh-my-agent Health Check ==="
oma doctor --json | jq -r '.clis[] | "\(.name): \(if .installed then "OK (\(.version))" else "MISSING" end)"'
oma auth:status --json | jq -r '.[] | "\(.name): \(.status)"'
oma stats --json | jq -r '"Sessions: \(.sessions), Tasks: \(.tasksCompleted)"'
echo "=== Done ==="
エージェントイントロスペクション
oma describe | jq '.command.subcommands[] | {name, description}'
oma describe agent:spawn | jq '.command.options[] | {flags, description}'