docs/cli/agent.md
openclaw agentRun an agent turn via the Gateway (use --local for embedded).
Use --agent <id> to target a configured agent directly.
Pass at least one session selector:
--to <dest>--session-id <id>--agent <id>Related:
-m, --message <text>: required message body-t, --to <dest>: recipient used to derive the session key--session-id <id>: explicit session id--agent <id>: agent id; overrides routing bindings--model <id>: model override for this run (provider/model or model id)--thinking <level>: agent thinking level (off, minimal, low, medium, high, plus provider-supported custom levels such as xhigh, adaptive, or max)--verbose <on|off>: persist verbose level for the session--channel <channel>: delivery channel; omit to use the main session channel--reply-to <target>: delivery target override--reply-channel <channel>: delivery channel override--reply-account <id>: delivery account override--local: run the embedded agent directly (after plugin registry preload)--deliver: send the reply back to the selected channel/target--timeout <seconds>: override agent timeout (default 600 or config value)--json: output JSONopenclaw agent --to +15555550123 --message "status update" --deliver
openclaw agent --agent ops --message "Summarize logs"
openclaw agent --agent ops --model openai/gpt-5.4 --message "Summarize logs"
openclaw agent --session-id 1234 --message "Summarize inbox" --thinking medium
openclaw agent --to +15555550123 --message "Trace logs" --verbose on --json
openclaw agent --agent ops --message "Generate report" --deliver --reply-channel slack --reply-to "#reports"
openclaw agent --agent ops --message "Run locally" --local
--local to force embedded execution up front.--local still preloads the plugin registry first, so plugin-provided providers, tools, and channels stay available during embedded runs.--local and embedded fallback runs are treated as one-shot runs. Bundled MCP loopback resources and warm Claude stdio sessions opened for that local process are retired after the reply, so scripted invocations do not keep local child processes alive.--channel, --reply-channel, and --reply-account affect reply delivery, not session routing.--json keeps stdout reserved for the JSON response. Gateway, plugin, and embedded-fallback diagnostics are routed to stderr so scripts can parse stdout directly.meta.transport: "embedded" and meta.fallbackFrom: "gateway" so scripts can distinguish fallback runs from Gateway runs.gateway-fallback-* session/run id and reports meta.fallbackReason: "gateway_timeout" plus the fallback session fields. This avoids racing the Gateway-owned transcript lock or silently replacing the original routed conversation session.models.json regeneration, SecretRef-managed provider credentials are persisted as non-secret markers (for example env var names, secretref-env:ENV_VAR_NAME, or secretref-managed), not resolved secret plaintext.