2026-02-21 04:07:06 +09:00
# CLI Reference
2026-01-09 02:24:43 +09:00
2026-05-08 16:14:30 +09:00
Complete reference for the published CLI package. During the rename transition, both package names work:
- `oh-my-openagent` (preferred package name)
- `oh-my-opencode` (compatibility package name)
Plugin registration inside `opencode.json` prefers `oh-my-openagent` .
2026-01-09 02:24:43 +09:00
2026-05-25 22:25:25 +09:00
## Bin Commands
All published packages expose the same compiled CLI with these bin entries:
- `oh-my-opencode` (legacy name, still primary)
- `oh-my-openagent` (renamed primary)
2026-05-27 18:48:33 +09:00
- `omo` (short alias, recommended in docs and prompts)
- `lazycodex` (Light edition shortcut; `lazycodex install` is equivalent to `omo install --platform=codex` unless `--platform` is explicitly overridden)
2026-05-25 22:25:25 +09:00
2026-02-21 04:07:06 +09:00
## Basic Usage
2026-01-09 02:24:43 +09:00
``` bash
2026-05-08 16:14:30 +09:00
# Display help (preferred package)
bunx oh-my-openagent
2026-01-09 02:24:43 +09:00
2026-05-08 16:14:30 +09:00
# Compatibility package
bunx oh-my-opencode
2026-01-09 02:24:43 +09:00
```
2026-02-21 04:07:06 +09:00
## Commands
2026-01-09 02:24:43 +09:00
2026-05-08 16:14:30 +09:00
| Command | Description |
| --- | --- |
| `install` | Interactive setup wizard |
| `doctor` | Installation health diagnostics |
| `run <message>` | Non-interactive OpenCode session runner with completion enforcement |
| `get-local-version` | Show current installed version and check for updates |
| `refresh-model-capabilities` | Refresh cached model capabilities snapshot from models.dev |
2026-05-14 13:05:15 +09:00
| `boulder` | Inspect Sisyphus boulder work-state (active plan, per-task timers, session lineage) |
2026-05-08 16:14:30 +09:00
| `version` | Show CLI version |
| `mcp oauth` | OAuth token management for MCP servers |
2026-01-09 02:24:43 +09:00
---
2026-02-21 04:07:06 +09:00
## install
2026-01-09 02:24:43 +09:00
2026-05-08 16:14:30 +09:00
Interactive installation tool for initial setup.
2026-01-09 02:24:43 +09:00
### Usage
``` bash
2026-05-08 16:14:30 +09:00
bunx oh-my-openagent install
2026-01-09 02:24:43 +09:00
```
### Options
2026-03-27 12:59:36 +09:00
| Option | Description |
2026-05-08 16:14:30 +09:00
| --- | --- |
| `--no-tui` | Run in non-interactive mode (requires all needed options) |
2026-05-27 18:48:33 +09:00
| `--platform <value>` | Install target edition: `opencode` (Ultimate, default), `codex` (Light), or `both` |
| `--claude <value>` | Claude subscription: `no` , `yes` , `max20` (Ultimate only) |
| `--openai <value>` | OpenAI/ChatGPT subscription: `no` , `yes` (Ultimate only) |
| `--gemini <value>` | Gemini integration: `no` , `yes` (Ultimate only) |
| `--copilot <value>` | GitHub Copilot subscription: `no` , `yes` (Ultimate only) |
| `--opencode-zen <value>` | OpenCode Zen access: `no` , `yes` (Ultimate only) |
| `--zai-coding-plan <value>` | Z.ai Coding Plan subscription: `no` , `yes` (Ultimate only) |
| `--kimi-for-coding <value>` | Kimi For Coding subscription: `no` , `yes` (Ultimate only) |
| `--opencode-go <value>` | OpenCode Go subscription: `no` , `yes` (Ultimate only) |
| `--vercel-ai-gateway <value>` | Vercel AI Gateway: `no` , `yes` (Ultimate only) |
2026-03-27 12:59:36 +09:00
| `--skip-auth` | Skip authentication setup hints |
2026-01-09 02:24:43 +09:00
2026-05-27 19:10:38 +09:00
When using the `lazycodex` bin alias, `install` defaults to `--platform=codex` . `lazycodex` is only the npm/bin alias and marketplace repository name. The Codex config uses marketplace `sisyphuslabs` and plugin `omo` , enabled as `omo@sisyphuslabs` , with the marketplace source set to `https://github.com/code-yeongyu/lazycodex.git` .
Subscription flags (`--claude` , `--openai` , etc.) only apply when `--platform` is `opencode` or `both` . They are rejected under `--platform=codex` because the Light edition does not write OpenCode model config.
2026-05-25 22:25:25 +09:00
### Telemetry and opt-out
2026-05-26 15:30:55 +09:00
Anonymous telemetry uses PostHog with a hashed installation identifier. Two streams exist:
- `omo_daily_active` : fired by the main plugin and `oh-my-openagent run` .
2026-05-27 18:48:33 +09:00
- `omo_codex_daily_active` : fired by `omo install --platform=codex` or `--platform=both` (`reason: "install_completed"` ) and by the Codex plugin's `SessionStart` hook on every Codex session (`reason: "session_start"` ). Both sources share the same UTC-day deduplication, so daily/weekly/monthly active counts reflect real Codex usage, not just install events.
2026-05-26 15:30:55 +09:00
Opt-out env vars:
2026-05-25 22:25:25 +09:00
- Global opt-out for oh-my-openagent and omo-codex: `OMO_SEND_ANONYMOUS_TELEMETRY=0` or `OMO_DISABLE_POSTHOG=1`
- Codex-only opt-out for `omo_codex_daily_active` : `OMO_CODEX_SEND_ANONYMOUS_TELEMETRY=0` or `OMO_CODEX_DISABLE_POSTHOG=1`
2026-04-11 14:14:45 +09:00
2026-01-09 02:24:43 +09:00
---
2026-02-21 04:07:06 +09:00
## doctor
2026-01-09 02:24:43 +09:00
2026-05-08 16:14:30 +09:00
Diagnoses your environment and configuration. Checks are grouped into four categories: **System ** , **Config ** , **Tools ** , and **Models ** .
2026-01-09 02:24:43 +09:00
### Usage
``` bash
2026-05-08 16:14:30 +09:00
bunx oh-my-openagent doctor
2026-01-09 02:24:43 +09:00
```
### Options
2026-05-08 16:14:30 +09:00
| Option | Description |
| --- | --- |
| `--status` | Show compact system dashboard |
| `--verbose` | Show detailed diagnostic information |
| `--json` | Output results in JSON format |
2026-01-09 02:24:43 +09:00
2026-05-08 16:14:30 +09:00
### Notes
2026-01-09 02:24:43 +09:00
2026-05-08 16:14:30 +09:00
- The current minimum OpenCode version check is `>= 1.4.0` .
- The doctor command warns when legacy plugin registration (`oh-my-opencode` ) is still present in `opencode.json` .
2026-01-09 02:24:43 +09:00
---
2026-02-21 04:07:06 +09:00
## run
2026-01-09 02:24:43 +09:00
2026-05-08 16:14:30 +09:00
Runs a non-interactive session and exits only when both conditions are true:
2026-03-27 12:59:36 +09:00
2026-05-08 16:14:30 +09:00
- all todos are completed or cancelled
- all background child sessions are idle
2026-03-27 12:59:36 +09:00
### Usage
``` bash
2026-05-08 16:14:30 +09:00
bunx oh-my-openagent run <message>
2026-03-27 12:59:36 +09:00
```
### Options
2026-05-08 16:14:30 +09:00
| Option | Description |
| --- | --- |
| `-a, --agent <name>` | Agent to use (default resolution chain applies) |
| `-m, --model <provider/model>` | Model override (example: `anthropic/claude-sonnet-4` ) |
| `-d, --directory <path>` | Working directory |
| `-p, --port <port>` | Server port (attaches if already in use) |
| `--attach <url>` | Attach to an existing OpenCode server URL |
| `--on-complete <command>` | Run shell command after completion |
| `--json` | Output structured JSON result |
| `--no-timestamp` | Disable timestamp prefix in output |
| `--verbose` | Show full event stream (default: messages/tools only) |
| `--session-id <id>` | Resume an existing session |
### Agent Resolution Order
1. `--agent`
2. `OPENCODE_DEFAULT_AGENT`
3. `default_run_agent` in plugin config
4. `Sisyphus`
2026-03-27 11:11:58 +08:00
2026-01-09 02:24:43 +09:00
---
2026-05-08 16:14:30 +09:00
## get-local-version
2026-01-29 19:48:36 +09:00
2026-05-08 16:14:30 +09:00
Shows local plugin version state and update status.
2026-01-29 19:48:36 +09:00
### Usage
``` bash
2026-05-08 16:14:30 +09:00
bunx oh-my-openagent get-local-version
2026-01-29 19:48:36 +09:00
```
### Options
2026-05-08 16:14:30 +09:00
| Option | Description |
| --- | --- |
| `-d, --directory <path>` | Working directory used for plugin/config detection |
| `--json` | Output JSON for scripting |
2026-03-27 12:20:40 +09:00
2026-01-09 02:24:43 +09:00
---
2026-03-27 12:59:36 +09:00
## refresh-model-capabilities
2026-05-08 16:14:30 +09:00
Refreshes the cached model capabilities snapshot from models.dev.
2026-03-27 12:59:36 +09:00
### Usage
``` bash
2026-05-08 16:14:30 +09:00
bunx oh-my-openagent refresh-model-capabilities
2026-03-27 12:59:36 +09:00
```
### Options
2026-05-08 16:14:30 +09:00
| Option | Description |
| --- | --- |
| `-d, --directory <path>` | Working directory used to read plugin config |
| `--source-url <url>` | Override models.dev source URL |
| `--json` | Output refresh summary as JSON |
2026-03-27 12:59:36 +09:00
### Configuration
``` jsonc
{
"model_capabilities" : {
"enabled" : true ,
"auto_refresh_on_start" : true ,
"refresh_timeout_ms" : 5000 ,
"source_url" : "https://models.dev/api.json"
}
}
```
---
2026-05-08 16:14:30 +09:00
## version
2026-01-09 02:24:43 +09:00
2026-05-08 16:14:30 +09:00
Shows CLI package version.
2026-01-09 02:24:43 +09:00
2026-05-08 16:14:30 +09:00
### Usage
2026-01-09 02:24:43 +09:00
2026-05-08 16:14:30 +09:00
``` bash
bunx oh-my-openagent version
2026-01-09 02:24:43 +09:00
```
---
2026-05-08 16:14:30 +09:00
## mcp oauth
2026-01-09 02:24:43 +09:00
2026-05-08 16:14:30 +09:00
OAuth token management for MCP servers (Tier-3 MCP OAuth flow, including PKCE and dynamic client registration when supported by the server).
2026-01-09 02:24:43 +09:00
2026-05-08 16:14:30 +09:00
### Usage
2026-01-09 02:24:43 +09:00
2026-05-08 16:14:30 +09:00
``` bash
# Authenticate
bunx oh-my-openagent mcp oauth login <server-name> --server-url https://api.example.com
2026-01-09 02:24:43 +09:00
2026-05-08 16:14:30 +09:00
# Authenticate with explicit client ID and scopes
bunx oh-my-openagent mcp oauth login <server-name> --server-url https://api.example.com --client-id my-client --scopes read write
2026-01-09 02:24:43 +09:00
2026-05-08 16:14:30 +09:00
# Remove stored tokens
bunx oh-my-openagent mcp oauth logout <server-name> --server-url https://api.example.com
2026-02-21 04:07:06 +09:00
2026-05-08 16:14:30 +09:00
# Show token status
bunx oh-my-openagent mcp oauth status [ server-name]
2026-01-09 02:24:43 +09:00
```
2026-05-08 16:14:30 +09:00
### Options
2026-01-09 02:24:43 +09:00
2026-05-08 16:14:30 +09:00
| Option | Description |
| --- | --- |
| `--server-url <url>` | OAuth server URL (required by `login` , and required by `logout` ) |
| `--client-id <id>` | OAuth client ID (optional if server supports DCR) |
| `--scopes <scopes...>` | OAuth scopes as variadic values |
---
## Exit Codes
- `0` on success
- `1` on failure
`run` , `install` , `doctor` , `get-local-version` , `refresh-model-capabilities` , and `mcp oauth` subcommands return explicit numeric exit codes.