05 · CLI and MCP
The onreel commands and the MCP server for the coordinator and agents.
5.1 · The onreel command
onreel is the command-line client of the host. Usage: onreel [global flags] <group> <command> [flags]. Help for any command is onreel <group> <command> --help; the full list is onreel --help.
Command groups:
init,doctor— the data directory and an environment check;host,ptyd— starting and stopping local processes;project,profile,workflow,settings,quota— projects, distribution profiles, workflows, settings and provider limits;run,thread,worktree,session,agent— work in a project: Runs, threads, worktrees, manual sessions and agents;orch— orchestration: Runs, tasks, attempts, messages, questions and worker reports;team— members of a Run's team;tracker,issue,forge,pr,ci,queue— the tracker, git hosting, PRs, CI and the merge queue;access,account— phone access and the onreel.dev account;cap— the capabilities contract.
5.2 · Global flags and the host address
--json— one JSON envelope on stdout:{ok, requestId?, duplicate?, result | error}. Convenient for scripts.--data-dir <directory>— the host data directory; by defaultONREEL_DATA_DIRor~/.onreel.--request-id <id>— an idempotency key: a repeat with the same id returns the result of the first execution without performing the action again.--version— the onreel version; no host is needed.
The host address and token are taken as follows: with --data-dir, from that directory's host.json with the owner token; otherwise from ONREEL_HOST_URL and ONREEL_TOKEN (this is how an agent process works); otherwise from the host.json of ONREEL_DATA_DIR or ~/.onreel.
5.3 · Exit codes
0— success, including a repeat (duplicate: true) and an expired wait (timedOut: true);1— an unexpected CLI failure;2— a call error: command, flag or value; the request was not sent;3— the host is unavailable: nohost.json, no connection, or the host did not start;4— a token refusal:unauthorizedorpermission_denied;5— the host refused with another contract error (not_found,lifecycle_conflictand so on);130— interrupted with SIGINT.
Errors print a code, a message and "what to do" steps.
5.4 · The orch commands
onreel orch is the set of commands used by the coordinator and workers, and by the owner for a manual Run.
onreel orch run create --project <projectId> --objective "What to do"
onreel orch task create --run <runId> --title "Title" --target "Where to change" --change "What to do"
onreel orch worktree create --task <taskId>
onreel orch dispatch start --run <runId> --task <taskId> --agent claude
onreel orch check --run <runId> --wait --types worker_done,question --timeout 5m
onreel orch ack --delivery <deliveryId>
onreel orch run show --run <runId>
onreel orch worker_done --outcome succeeded --body "Summary"orch check returns a batch of messages and, with --wait, waits for new ones; an expired wait is not an error, so repeat the command. A batch that has been read is acknowledged with orch ack; otherwise it comes again. orch preamble prints the instructions of a coordinator or a worker.
5.5 · The MCP server
onreel orch mcp is an MCP server on stdio. Its tools are built from the same commands and take the same arguments: orch_*, plus the issue, forge (PRs and CI) and queue tables. A tool's result is the same envelope as with --json. The --tools orch,issue,forge,queue flag selects the tables; all of them are on by default.
The rights of a call are the rights of the environment the server received: the owner token from host.json or an agent token from the ONREEL_* variables. An agent never gets more rights than the token of its attempt. The server writes who is calling to stderr at startup and into the instructions for the model.
5.6 · Connecting MCP to a client
For attempt agents and team members the host connects MCP itself: the manifest passes the CLI a server config with the names of the ONREEL_* variables and no values. An attempt can be launched without MCP with --no-mcp. If an agent's manifest does not describe MCP delivery, the attempt runs without the tools, which is reported by an event in the Run journal and the mcpNotDelivered field (Agents and manifests).
For a coordinator and your own agents the MCP client starts the server itself. Clients often start it with a trimmed environment, so pass the variables explicitly: ONREEL_HOST_URL, ONREEL_TOKEN, ONREEL_RUN_ID, ONREEL_TASK_ID, ONREEL_DISPATCH_ID. An example for Claude Code, the .mcp.json file:
{"mcpServers":{"onreel":{"command":"onreel","args":["orch","mcp"],"env":{"ONREEL_HOST_URL":"${ONREEL_HOST_URL:-}","ONREEL_TOKEN":"${ONREEL_TOKEN:-}","ONREEL_RUN_ID":"${ONREEL_RUN_ID:-}","ONREEL_TASK_ID":"${ONREEL_TASK_ID:-}","ONREEL_DISPATCH_ID":"${ONREEL_DISPATCH_ID:-}"}}}}For Codex it is the [mcp_servers.onreel] section of config.toml with command = "onreel", args = ["orch","mcp"], an env_vars list and tool_timeout_sec = 600; for opencode it is the mcp section with type: "local" and command: ["onreel","orch","mcp"].
Agents without automatic delivery connect the server through their CLI's own settings: for kimi — the launch directory's .kimi-code/mcp.json file (or ~/.kimi-code/mcp.json) without variable references — {"mcpServers":{"onreel":{"command":"onreel","args":["orch","mcp"]}}}; for grok — run grok mcp add once with the onreel orch mcp stdio command (by default ~/.grok/config.toml, --scope project writes ./.grok/config.toml), passing the attempt secrets as ${ONREEL_HOST_URL} and the other ONREEL_* references, because the GROK_CONFIG/GROK_CONFIG_PATH overlay does not accept the mcp_servers table; for antigravity — the /mcp panel or a settings file; cursor-agent has no documented MCP mechanism.
If the server is started inside an agent process without the ONREEL_* variables, every call returns unauthorized: it does not work as the owner there.
orch_check and orch_ask wait for a long time. Give them a timeout shorter than your client's call timeout, for example 5m; an interrupted call is safe to repeat.