メインコンテンツまでスキップ

CLIオプション

グローバルオプション

フラグ説明
-V, --versionバージョン番号を出力して終了
-h, --helpコマンドのヘルプを表示

すべてのサブコマンドも-h, --helpで固有のヘルプテキストを表示。


出力オプション

1. --jsonフラグ

oma stats --json
oma doctor --json

対応コマンド:doctorstatsretrocleanupauth:statusmemory:initverifyvisualize

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.yamlmcp.jsonstack/が対象。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 / -mCLIベンダーオーバーライド。geminiclaudecodexqwen設定から解決
--workspace / -wエージェントの作業ディレクトリ。省略時はモノレポ設定から自動検出。自動検出または.

バリデーション: agent-idbackend/frontend/mobile/qa/debug/pmのいずれか。session-id..?#%、制御文字は使用不可。

ベンダー固有の動作:

ベンダーコマンド自動承認フラグプロンプトフラグ
geminigemini--approval-mode=yolo-p
claudeclaude(なし)-p
codexcodex--full-auto(位置引数)
qwenqwen--yolo-p

agent:status

フラグ説明
--root / -rメモリファイルとPIDファイルのルートパス

ステータス判定:result-{agent}.md存在→completed、PIDファイル存在+プロセス生存→running、それ以外→crashed

agent:parallel

フラグ説明
--model / -m全エージェントに適用するベンダーオーバーライド
--inline / -iagent:task[:workspace]形式のインラインタスク指定
--no-waitバックグラウンドモード

インラインタスク形式:backend:Implement auth API:./api(最後のコロン区切りが.//.で始まればワークスペース)。

memory:init

フラグ説明
--force既存スキーマファイルを上書き

verify

フラグ説明
--workspace / -w検証するワークスペースディレクトリ

エージェントタイプ:backendfrontendmobileqadebugpm


実践例

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}'