Documentation Index
Fetch the complete documentation index at: https://docs.openclaw.ai/llms.txt
Use this file to discover all available pages before exploring further.
openclaw agent
Run 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>
- Agent send tool: Agent send
Options
-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/modelor model id)--thinking <level>: agent thinking level (off,minimal,low,medium,high, plus provider-supported custom levels such asxhigh,adaptive, ormax)--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 JSON
Examples
Notes
- Gateway mode falls back to the embedded agent when the Gateway request fails. Use
--localto force embedded execution up front. --localstill preloads the plugin registry first, so plugin-provided providers, tools, and channels stay available during embedded runs.--localand 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.- Gateway-backed runs leave Gateway-owned MCP loopback resources under the running Gateway process; older clients may still send the historical cleanup flag, but the Gateway accepts it as a compatibility no-op.
--channel,--reply-channel, and--reply-accountaffect reply delivery, not session routing.--jsonkeeps stdout reserved for the JSON response. Gateway, plugin, and embedded-fallback diagnostics are routed to stderr so scripts can parse stdout directly.- Embedded fallback JSON includes
meta.transport: "embedded"andmeta.fallbackFrom: "gateway"so scripts can distinguish fallback runs from Gateway runs. - When this command triggers
models.jsonregeneration, SecretRef-managed provider credentials are persisted as non-secret markers (for example env var names,secretref-env:ENV_VAR_NAME, orsecretref-managed), not resolved secret plaintext. - Marker writes are source-authoritative: OpenClaw persists markers from the active source config snapshot, not from resolved runtime secret values.