Skip to main content

CLI Commands

After installing globally (bun install --global oh-my-agent), use oma or oh-my-agent. For one-time use without installing, run npx oh-my-agent.

The environment variable OH_MY_AG_OUTPUT_FORMAT can be set to json to force machine-readable output on commands that support it. This is equivalent to passing --json to each command.


Setup & Installation

oma (install)

The default command with no arguments launches the interactive installer.

oma

What it does:

  1. Checks for legacy .agent/ directory and migrates to .agents/ if found.
  2. Detects and offers to remove competing tools.
  3. Prompts for project type (All, Fullstack, Frontend, Backend, Mobile, DevOps, Custom).
  4. If backend is selected, prompts for language variant (Python, Node.js, Rust, Other).
  5. Asks about GitHub Copilot symlinks.
  6. Downloads the latest tarball from the registry.
  7. Installs shared resources, workflows, configs, and selected skills.
  8. Installs vendor adaptations for all 4 vendors (Claude, Codex, Gemini, Qwen).
  9. Applies recommended Claude Code settings (~/.claude/settings.json) when Claude Code is detected.
  10. Creates CLI symlinks.
  11. Offers to enable git rerere.
  12. Offers to configure MCP for Antigravity IDE and Gemini CLI.
  13. Prompts for GitHub star if gh is authenticated.

Example:

cd /path/to/my-project
oma
# Follow the interactive prompts

doctor

Health check for CLI installations, MCP configs, and skill status.

oma doctor [--json] [--output <format>] [--profile]

Options:

FlagDescription
--jsonOutput as JSON
--output <format>Output format (text or json)
--profileShow profile health matrix — displays the resolved model slug, CLI, and auth status per agent from the active model_preset and agents: overrides. See Per-Agent Models.

What it checks:

  • CLI installations: gemini, claude, codex, qwen (version and path).
  • Authentication status for each CLI.
  • MCP configuration: ~/.gemini/settings.json, ~/.claude.json, ~/.codex/config.toml.
  • Installed skills: which skills are present and their status.
  • Serena memory directory: .serena/memories/ existence and file count.
  • Global workflows: checks ~/.gemini/antigravity/global_workflows/ installation status.
  • Git rerere: whether rerere.enabled is configured globally.
  • Claude Code recommended settings: checks ~/.claude/settings.json for optimal configuration:
  • cleanupPeriodDays >= 180 (preserve conversation history)
  • CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS >= 100000
  • CLAUDE_AUTOCOMPACT_PCT_OVERRIDE >= 80
  • DISABLE_TELEMETRY, DISABLE_ERROR_REPORTING, CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY set to "1"
  • Attribution strings for commits and PRs
  • User-level CLAUDE.md: checks ~/.claude/CLAUDE.md contains the OMA integration block (<!-- OMA:START).

Auto-repair: If missing skills or settings are detected, doctor offers to install them interactively. For Claude Code settings, it can apply recommended values automatically.

Examples:

# Interactive text output
oma doctor

# JSON output for CI pipelines
oma doctor --json

# Pipe to jq for specific checks
oma doctor --json | jq '.clis[] | select(.installed == false)'

# Inspect the profile resolution matrix
oma doctor --profile

update

Update skills to the latest version from the registry.

oma update [-f | --force] [--ci]

Options:

FlagDescription
-f, --forceOverwrite user-customized config files (oma-config.yaml, mcp.json, stack/ directories)
--ciRun in non-interactive CI mode (skip prompts, plain text output)

What it does:

  1. Fetches prompt-manifest.json from the registry to check the latest version.
  2. Compares with the local version in .agents/skills/_version.json.
  3. If already up to date, exits.
  4. Downloads and extracts the latest tarball.
  5. Preserves user-customized files (unless --force).
  6. Copies new files over .agents/.
  7. Restores preserved files.
  8. Updates vendor adaptations and refreshes symlinks.

Examples:

# Standard update (preserves config)
oma update

# Force update (resets all config to defaults)
oma update --force

# CI mode (no prompts, no spinners)
oma update --ci

# CI mode with force
oma update --ci --force

Regenerate vendor-native files from the .agents/ source of truth without reinstalling.

oma link [vendors...]

Examples:

# Regenerate all configured vendors
oma link

# Regenerate only Claude and Codex files
oma link claude codex

What it does:

  1. Rebuilds vendor-native agent files from .agents/agents/
  2. Refreshes hooks and local settings for the selected vendors
  3. Regenerates CLAUDE.md, GEMINI.md, or AGENTS.md integration blocks
  4. Refreshes Cursor MCP linkage and CLI skill symlinks when relevant

Use this after editing .agents/agents/, .agents/workflows/, .agents/rules/, or hook definitions.

Model behavior:

  • Same-vendor native dispatch uses the model defined in the generated vendor agent file.
  • External fallback dispatch uses each vendor's default_model from .agents/skills/oma-orchestrator/config/cli-config.yaml.

Dispatch behavior:

  • If the target vendor matches the current runtime and that runtime supports native role agents, OMA uses native dispatch.
  • Otherwise OMA falls back to oma agent:spawn.

setup (workflow)

The /setup workflow (invoked inside an agent session) provides interactive configuration of language, CLI installations, MCP connections, and agent-CLI mapping. This is different from oma (the installer) — /setup configures an already-installed instance.

Monitoring & Metrics

dashboard

Start the terminal dashboard for real-time agent monitoring.

oma dashboard

No options. Watches .serena/memories/ in the current directory. Renders a box-drawing UI with session status, agent table, and activity feed. Updates on every file change. Press Ctrl+C to exit.

The memories directory can be overridden with the MEMORIES_DIR environment variable.

Example:

# Standard usage
oma dashboard

# Custom memories directory
MEMORIES_DIR=/path/to/.serena/memories oma dashboard

dashboard:web

Start the web dashboard.

oma dashboard:web

Starts an HTTP server on http://localhost:9847 with a WebSocket connection for live updates. Open the URL in a browser to see the dashboard.

Environment variables:

VariableDefaultDescription
DASHBOARD_PORT9847Port for the HTTP/WebSocket server
MEMORIES_DIR{cwd}/.serena/memoriesPath to the memories directory

Example:

# Standard usage
oma dashboard:web

# Custom port
DASHBOARD_PORT=8080 oma dashboard:web

stats

View productivity metrics.

oma stats [--json] [--output <format>] [--reset]

Options:

FlagDescription
--jsonOutput as JSON
--output <format>Output format (text or json)
--resetReset all metrics data

Metrics tracked:

  • Session count
  • Skills used (with frequency)
  • Tasks completed
  • Total session time
  • Files changed, lines added, lines removed
  • Last updated timestamp

Metrics are stored in .serena/metrics.json. Data is collected from git stats and memory files.

Examples:

# View current metrics
oma stats

# JSON output
oma stats --json

# Reset all metrics
oma stats --reset

recap

Recap AI tool conversation history across Claude, Codex, Gemini, Qwen, and Cursor sessions.

oma recap [--window <period>] [--date <date>] [--tool <tools>] [--top <n>] [--sort <metric>] [--mermaid] [--graph] [--json] [--output <format>]

Options:

FlagDescriptionDefault
--window <period>Time window: 1d, 3d, 7d, 2w, 30d1d
--date <date>Specific date (YYYY-MM-DD); takes precedence over --window
--tool <tools>Comma-separated filter: claude,codex,gemini,qwen,cursorall
--top <n>Show top N projects/topics
--sort <metric>Sort by count or durationcount
--mermaidOutput as Mermaid Gantt chart
--graphOpen interactive graph in the browser
--json / --output <format>Machine-readable outputtext

Examples:

oma recap # Today (1d)
oma recap --window 7d # Last week
oma recap --date 2026-04-20 --tool claude,codex
oma recap --window 7d --mermaid > week.mmd
oma recap --window 30d --graph # Interactive browser graph

retro

Engineering retrospective with metrics and trends.

oma retro [window] [--json] [--output <format>] [--interactive] [--compare]

Arguments:

ArgumentDescriptionDefault
windowTime window for analysis (e.g., 7d, 2w, 1m)Last 7 days

Options:

FlagDescription
--jsonOutput as JSON
--output <format>Output format (text or json)
--interactiveInteractive mode with manual entry
--compareCompare current window vs prior same-length window

What it shows:

  • Tweetable summary (one-line metrics)
  • Summary table (commits, files changed, lines added/removed, contributors)
  • Trends vs last retro (if previous snapshot exists)
  • Contributor leaderboard
  • Commit time distribution (hourly histogram)
  • Work sessions
  • Commit types breakdown (feat, fix, chore, etc.)
  • Hotspots (most-changed files)

Examples:

# Last 7 days (default)
oma retro

# Last 30 days
oma retro 30d

# Last 2 weeks
oma retro 2w

# Compare with previous period
oma retro 7d --compare

# Interactive mode
oma retro --interactive

# JSON for automation
oma retro 7d --json

Agent Management

agent:spawn

Spawn a subagent process.

oma agent:spawn <agent-id> <prompt> <session-id> [-m <vendor>] [-w <workspace>]

Arguments:

ArgumentRequiredDescription
agent-idYesAgent type. One of: backend, frontend, mobile, qa, debug, pm
promptYesTask description. Can be inline text or a path to a file.
session-idYesSession identifier (format: session-YYYYMMDD-HHMMSS)

Options:

FlagDescription
-m, --model <vendor>CLI vendor override: gemini, claude, codex, qwen
-w, --workspace <path>Working directory for the agent. Auto-detected from monorepo config if omitted.

Vendor resolution order: --model flag > agents: override in oma-config.yaml > active model_preset agent defaults.

Prompt resolution: If the prompt argument is a path to an existing file, the file contents are used as the prompt. Otherwise, the argument is used as inline text. Vendor-specific execution protocols are appended automatically.

Examples:

# Inline prompt, auto-detect workspace
oma agent:spawn backend "Implement /api/users CRUD endpoint" session-20260324-143000

# Prompt from file, explicit workspace
oma agent:spawn frontend ./prompts/dashboard.md session-20260324-143000 -w ./apps/web

# Override vendor to Claude
oma agent:spawn backend "Implement auth" session-20260324-143000 -m claude -w ./api

# Mobile agent with auto-detected workspace
oma agent:spawn mobile "Add biometric login" session-20260324-143000

agent:status

Check the status of one or more subagents.

oma agent:status <session-id> [agent-ids...] [-r <root>]

Arguments:

ArgumentRequiredDescription
session-idYesThe session ID to check
agent-idsNoSpace-separated list of agent IDs. If omitted, no output.

Options:

FlagDescriptionDefault
-r, --root <path>Root path for memory checksCurrent directory

Status values:

  • completed — Result file exists (with optional status header).
  • running — PID file exists and process is alive.
  • crashed — PID file exists but process is dead, or no PID/result file found.

Output format: One line per agent: {agent-id}:{status}

Examples:

# Check specific agents
oma agent:status session-20260324-143000 backend frontend

# Output:
# backend:running
# frontend:completed

# Check with custom root
oma agent:status session-20260324-143000 qa -r /path/to/project

agent:parallel

Run multiple subagents in parallel.

oma agent:parallel [tasks...] [-m <vendor>] [-i | --inline] [--no-wait]

Arguments:

ArgumentRequiredDescription
tasksYesEither a YAML tasks file path, or (with --inline) inline task specs

Options:

FlagDescription
-m, --model <vendor>CLI vendor override for all agents
-i, --inlineInline mode: specify tasks as agent:task[:workspace] arguments
--no-waitBackground mode — start agents and return immediately

YAML tasks file format:

tasks:
- agent: backend
task: "Implement user API"
workspace: ./api # optional, auto-detected if omitted
- agent: frontend
task: "Build user dashboard"
workspace: ./web

Inline task format: agent:task or agent:task:workspace (workspace must start with ./ or /).

Results directory: .agents/results/parallel-{timestamp}/ contains log files for each agent.

Examples:

# From YAML file
oma agent:parallel tasks.yaml

# Inline mode
oma agent:parallel --inline "backend:Implement auth API:./api" "frontend:Build login:./web"

# Background mode (no wait)
oma agent:parallel tasks.yaml --no-wait

# Override vendor for all agents
oma agent:parallel tasks.yaml -m claude

agent:review

Run a code review using an external AI CLI (codex, claude, gemini, or qwen).

oma agent:review [-m <vendor>] [-p <prompt>] [-w <path>] [--no-uncommitted]

Options:

FlagDescription
-m, --model <vendor>CLI vendor to use: codex, claude, gemini, qwen. Defaults to resolved vendor from config.
-p, --prompt <prompt>Custom review prompt. If omitted, a default code review prompt is used.
-w, --workspace <path>Path to review. Defaults to the current working directory.
--no-uncommittedSkip uncommitted changes review. When set, only committed changes in the session are reviewed.

What it does:

  • Detects the current session ID automatically from the environment or recent git activity.
  • For codex: uses the native codex review subcommand.
  • For claude, gemini, qwen: constructs a prompt-based review request and invokes the CLI with the review prompt.
  • By default, reviews uncommitted changes in the working directory.
  • With --no-uncommitted, restricts review to changes committed within the current session.

Examples:

# Review uncommitted changes with default vendor
oma agent:review

# Review with codex (uses native codex review command)
oma agent:review -m codex

# Review with claude using a custom prompt
oma agent:review -m claude -p "Focus on security vulnerabilities and input validation"

# Review a specific path
oma agent:review -w ./apps/api

# Review only committed changes (skip working tree)
oma agent:review --no-uncommitted

# Review committed changes in a specific workspace with gemini
oma agent:review -m gemini -w ./apps/web --no-uncommitted

Memory Management

memory:init

Initialize the Serena memory schema.

oma memory:init [--json] [--output <format>] [--force]

Options:

FlagDescription
--jsonOutput as JSON
--output <format>Output format (text or json)
--forceOverwrite empty or existing schema files

What it does: Creates the .serena/memories/ directory structure with initial schema files that the MCP memory tools use for reading and writing agent state.

Examples:

# Initialize memory
oma memory:init

# Force overwrite existing schema
oma memory:init --force

Integration & Utilities

auth:status

Check authentication status of all supported CLIs.

oma auth:status [--json] [--output <format>]

Options:

FlagDescription
--jsonOutput as JSON
--output <format>Output format (text or json)

Checks: GitHub CLI (gh), Gemini CLI, Claude CLI, Codex CLI, Qwen CLI.

Examples:

oma auth:status
oma auth:status --json

bridge

Bridge MCP stdio to Streamable HTTP transport.

oma bridge [url]

Arguments:

ArgumentRequiredDescription
urlNoThe Streamable HTTP endpoint URL (e.g., http://localhost:12341/mcp)

What it does: Acts as a protocol bridge between MCP stdio transport (used by Antigravity IDE) and Streamable HTTP transport (used by Serena MCP server). This is required because Antigravity IDE does not support HTTP/SSE transports directly.

Architecture:

Antigravity IDE <-- stdio --> oma bridge <-- HTTP --> Serena Server

Example:

# Bridge to local Serena server
oma bridge http://localhost:12341/mcp

verify

Verify subagent output against expected criteria.

oma verify <agent-type> [-w <workspace>] [--json] [--output <format>]

Arguments:

ArgumentRequiredDescription
agent-typeYesOne of: backend, frontend, mobile, qa, debug, pm

Options:

FlagDescriptionDefault
-w, --workspace <path>Workspace path to verifyCurrent directory
--jsonOutput as JSON
--output <format>Output format (text or json)

What it does: Runs the verification script for the specified agent type, checking build success, test results, and scope compliance.

Common checks (all agent types):

  • Scope Check: Reads .agents/results/plan-{sessionId}.json task scopes. Compares git diff changed files against defined scope patterns. Fails if files are modified outside the agent's assigned scope.
  • Charter Preflight: Verifies result-{agent}.md contains a properly filled CHARTER_CHECK: block with no unfilled placeholders.
  • Hardcoded Secrets: Scans .py, .ts, .tsx, .js, .dart files for patterns like password = "...", api_key = "..." (excludes test/example files).
  • TODO/FIXME Comments: Counts TODO, FIXME, HACK, XXX comments (warns if any found).

Agent-specific checks:

Agent TypeAdditional Checks
backendPython syntax validation (py_compile), SQL injection detection (f-string + SQL keywords), Python test execution (pytest)
frontendTypeScript compilation (tsc --noEmit), inline style detection (style={{), any type usage (fails if > 3), frontend tests (vitest)
mobileFlutter/Dart analysis (flutter analyze or dart analyze), Flutter tests (flutter test)
qaSelf-check verification
debugRuns Python tests or frontend tests based on detected project type
pmValidates .agents/results/plan-{sessionId}.json exists and is valid JSON

Output format: Each check reports PASS, FAIL, WARN, or SKIP with a detail message. Overall result is ok: true only if zero checks fail.

Examples:

# Verify backend output in default workspace
oma verify backend

# Verify frontend in specific workspace
oma verify frontend -w ./apps/web

# JSON output for CI
oma verify backend --json

cleanup

Clean up orphaned subagent processes and temp files.

oma cleanup [--dry-run] [-y | --yes] [--json] [--output <format>]

Options:

FlagDescription
--dry-runShow what would be cleaned without making changes
-y, --yesSkip confirmation prompts and clean everything
--jsonOutput as JSON
--output <format>Output format (text or json)

What it cleans:

  • Orphaned PID files in the system temp directory (/tmp/subagent-*.pid).
  • Orphaned log files (/tmp/subagent-*.log).
  • Gemini Antigravity directories (brain, implicit, knowledge) under .gemini/antigravity/.

Examples:

# Preview what would be cleaned
oma cleanup --dry-run

# Clean with confirmation prompts
oma cleanup

# Clean everything without prompts
oma cleanup --yes

# JSON output for automation
oma cleanup --json

visualize

Visualize project structure as a dependency graph.

oma visualize [--json] [--output <format>]
oma viz [--json] [--output <format>]

viz is a built-in alias for visualize.

Options:

FlagDescription
--jsonOutput as JSON
--output <format>Output format (text or json)

What it does: Analyzes the project structure and generates a dependency graph showing relationships between skills, agents, workflows, and shared resources.

Examples:

oma visualize
oma viz --json

export

Export skills for external IDEs that consume their own rules format (e.g. Cursor).

oma export <format> [-d <path>] [--json] [--output <format>]

Arguments:

ArgumentRequiredDescription
formatYesTarget format. Currently supports: cursor

Options:

FlagShortDescriptionDefault
--dir <path>-dTarget directory to write the exported rules into.Current working directory
--json / --output <format>Machine-readable outputtext

Examples:

# Export to ./.cursor/rules in the current project
oma export cursor

# Export to a sibling project's directory
oma export cursor -d ../another-project

Mechanical search primitives — fetch, metadata, RSS, media, code, and trust scoring. Aliased as oma s. All subcommands output JSON to stdout (one object per line, or pretty-printed with --pretty).

oma search <subcommand> ...
oma s <subcommand> ...

Subcommands:

SubcommandPurpose
fetch <url>Fetch URL via auto-escalating strategy pipeline (api → probe → impersonate → browser → archive)
api <url>Fetch via matched platform API handler (Phase 0)
api:search <query>Fan-out keyword search across platforms that support it (--platforms <list>)
meta <url>Extract OGP / JSON-LD / Schema.org metadata
rss <url>Discover and parse RSS / Atom feed
rss:google <query>Build a Google News RSS URL for a query
media <url>Extract media metadata via yt-dlp (1858 sites)
archive <url>Fetch via AMP / archive.today / Wayback fallback
trust <domain>Resolve trust level / score for a domain
code <query>Search code via gh (GitHub) or glab (GitLab)
doctorCheck dependencies (Chrome, python3 + curl_cffi, yt-dlp, gh)

Common options on URL/query subcommands:

FlagDescriptionDefault
--timeout <seconds>Per-strategy timeout15 (30 for media)
--locale <value>Accept-Language headeren-US,en;q=0.9
--prettyPretty-print JSON outputfalse

fetch extras:

FlagDescription
--only <strategies>Comma-separated strategies to run (api,probe,impersonate,browser,archive)
--skip <strategies>Comma-separated strategies to skip
--include-archiveAppend archive strategy as a last fallback

media extras:

FlagDescription
--subsWrite subtitles
--sub-lang <list>Subtitle languages, comma-separated (default: en)
--format <spec>yt-dlp format spec

code extras:

FlagDescriptionDefault
--host <github|gitlab>Hostgithub
--language <lang>Language filter
--repo <owner/repo>Scope to a repo
--limit <n>Max results20

Exit codes: 0 ok, 1 error, 2 blocked, 3 not-found, 4 invalid-input, 5 auth-required, 6 timeout.

Examples:

# Auto-escalating fetch
oma search fetch https://example.com/article --pretty

# Force a single strategy
oma search fetch https://example.com --only browser

# Cross-platform keyword search via API handlers
oma search api:search "RAG patterns" --platforms hackernews,reddit

# Find a repo's trust score
oma search trust github.com

# Code search (defaults to GitHub)
oma search code "useEffect cleanup" --language ts --limit 10

# Verify your local dependencies
oma search doctor

image

Multi-vendor AI image generation with authentication-aware parallel dispatch. Aliased as oma img.

oma image <subcommand> ...
oma img <subcommand> ...

Subcommands:

SubcommandPurpose
generate <prompt...>Generate images via pollinations (flux/zimage, free), codex (gpt-image-2 via ChatGPT OAuth), or gemini (needs API key + billing, disabled by default)
doctorCheck authentication and install status per vendor
list-vendorsList registered vendors and supported models

image generate options:

FlagDescriptionDefault
--vendor <name>auto | pollinations | codex | gemini | allauto
--size <size>1024x1024 | 1024x1536 | 1536x1024 | autovendor default
--quality <level>low | medium | high | autovendor default
-n, --count <n>Number of images (1..5)1
--out <dir>Output directory.agents/results/images/{timestamp}/
--allow-external-outAllow --out paths outside $PWDfalse
--model <name>Vendor-specific model override
--strategy <list>Gemini fallback order, comma-separated (mcp,stream,api)
--timeout <seconds>Per-image timeoutvendor default
-r, --reference <path>Reference image(s); repeatable (-r a.png -r b.png) or comma-separated. Supported on codex and gemini; rejected on pollinations. Each ≤5MB PNG/JPEG/GIF/WebP (magic-byte validated), max 10.
-y, --yesSkip cost confirmationfalse
--no-prompt-in-manifestStore SHA256 of prompt instead of raw textfalse
--dry-runPrint plan and cost estimate; do not executefalse
--format <format>CLI output format: text | jsontext

Each run writes a manifest.json next to the generated images recording vendor, model, prompt (or hash), size, quality, and cost.

Examples:

# Free, no-config generation
oma image generate "minimalist sunrise over mountains"

# Specific vendor + size + count, skip cost prompt
oma image generate "logo concept" --vendor codex --size 1024x1024 -n 3 -y

# All vendors in parallel for comparison
oma image generate "cat astronaut" --vendor all

# Cost estimate without spending
oma image generate "test prompt" --dry-run

# Use a reference image to guide style / subject (codex or gemini)
oma image generate "same otter in dramatic lighting" --vendor codex -r ~/Downloads/otter.jpeg

# Multiple references (repeatable or comma-separated)
oma image generate "blend these styles" --vendor gemini -r a.png -r b.png
oma image generate "blend these styles" --vendor gemini -r a.png,b.png

# Per-vendor doctor check
oma image doctor --format json

star

Star oh-my-agent on GitHub.

oma star

No options. Requires gh CLI to be installed and authenticated. Stars the first-fluke/oh-my-agent repository.

Example:

oma star

describe

Describe CLI commands as JSON for runtime introspection.

oma describe [command-path]

Arguments:

ArgumentRequiredDescription
command-pathNoThe command to describe. If omitted, describes the root program.

What it does: Outputs a JSON object with the command's name, description, arguments, options, and subcommands. Used by AI agents to understand available CLI capabilities.

Examples:

# Describe all commands
oma describe

# Describe a specific command
oma describe agent:spawn

# Describe a subcommand
oma describe "agent:parallel"

help

Show help information.

oma help

Displays the full help text with all available commands.

version

Show the version number.

oma version

Outputs the current CLI version and exits.


Environment Variables

VariableDescriptionUsed By
OH_MY_AG_OUTPUT_FORMATSet to json to force JSON output on all commands that support itAll commands with --json flag
DASHBOARD_PORTPort for the web dashboarddashboard:web
MEMORIES_DIROverride the memories directory pathdashboard, dashboard:web

Aliases

AliasFull Command
vizvisualize