Some checks failed
ClawSweeper Dispatch / dispatch (push) Has been cancelled
CodeQL / Security High (actions) (push) Has been cancelled
CodeQL / Security High (channel-runtime-boundary) (push) Has been cancelled
CodeQL / Security High (core-auth-secrets) (push) Has been cancelled
CodeQL / Security High (mcp-process-tool-boundary) (push) Has been cancelled
CodeQL / Security High (network-ssrf-boundary) (push) Has been cancelled
CodeQL / Security High (plugin-trust-boundary) (push) Has been cancelled
CodeQL / Security High (process-exec-boundary) (push) Has been cancelled
Docs Sync Publish Repo / sync-publish-repo (push) Has been cancelled
Docs / docs (push) Has been cancelled
OpenClaw Stable Main Closeout / Resolve stable release closeout inputs (push) Has been cancelled
OpenClaw Stable Main Closeout / Verify stable main closeout (push) Has been cancelled
Workflow Sanity / no-tabs (push) Has been cancelled
Workflow Sanity / actionlint (push) Has been cancelled
Workflow Sanity / generated-doc-baselines (push) Has been cancelled
CI / runner-admission (push) Has been cancelled
CI / preflight (push) Has been cancelled
CI / security-fast (push) Has been cancelled
CI / pnpm-store-warmup (push) Has been cancelled
CI / build-artifacts (push) Has been cancelled
CI / native-i18n (push) Has been cancelled
CI / ${{ matrix.check_name }} (push) Has been cancelled
CI / ${{ matrix.checkName }} (push) Has been cancelled
CI / checks-node-compat-node22 (push) Has been cancelled
CI / check-bundled-channel-config-metadata (push) Has been cancelled
CI / check-dependencies (push) Has been cancelled
CI / check-guards (push) Has been cancelled
CI / check-lint (push) Has been cancelled
CI / check-prod-types (push) Has been cancelled
CI / check-shrinkwrap (push) Has been cancelled
CI / check-test-types (push) Has been cancelled
CI / check-additional-boundaries-a (push) Has been cancelled
CI / check-additional-boundaries-bcd (push) Has been cancelled
CI / check-additional-extension-bundled (push) Has been cancelled
CI / check-additional-extension-channels (push) Has been cancelled
CI / check-additional-extension-package-boundary (push) Has been cancelled
CI / check-additional-runtime-topology-architecture (push) Has been cancelled
CI / check-session-accessor-boundary (push) Has been cancelled
CI / check-session-transcript-reader-boundary (push) Has been cancelled
CI / check-docs (push) Has been cancelled
CI / skills-python (push) Has been cancelled
CI / macos-swift (push) Has been cancelled
CI / ios-build (push) Has been cancelled
CI / ci-timings-summary (push) Has been cancelled
Native App Locale Refresh / Refresh native fa (push) Has been cancelled
Native App Locale Refresh / Refresh native fr (push) Has been cancelled
Native App Locale Refresh / Refresh native hi (push) Has been cancelled
Native App Locale Refresh / Refresh native id (push) Has been cancelled
Native App Locale Refresh / Refresh native it (push) Has been cancelled
Native App Locale Refresh / Refresh native ja-JP (push) Has been cancelled
Control UI Locale Refresh / plan (push) Has been cancelled
Control UI Locale Refresh / Refresh ${{ matrix.locale }} (push) Has been cancelled
Control UI Locale Refresh / Commit control UI locale refresh (push) Has been cancelled
Live Media Runner Image / Build live media runner image (push) Has been cancelled
Native App Locale Refresh / Refresh native ar (push) Has been cancelled
Native App Locale Refresh / Refresh native de (push) Has been cancelled
Native App Locale Refresh / Refresh native es (push) Has been cancelled
Native App Locale Refresh / Refresh native ko (push) Has been cancelled
Native App Locale Refresh / Refresh native nl (push) Has been cancelled
Native App Locale Refresh / Refresh native pl (push) Has been cancelled
Native App Locale Refresh / Refresh native pt-BR (push) Has been cancelled
Native App Locale Refresh / Refresh native ru (push) Has been cancelled
Native App Locale Refresh / Refresh native sv (push) Has been cancelled
Native App Locale Refresh / Refresh native th (push) Has been cancelled
Native App Locale Refresh / Refresh native tr (push) Has been cancelled
Native App Locale Refresh / Refresh native uk (push) Has been cancelled
Native App Locale Refresh / Refresh native vi (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-CN (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-TW (push) Has been cancelled
Native App Locale Refresh / Commit native locale refresh (push) Has been cancelled
Plugin Init Scaffold Validation / Validate provider scaffold (push) Has been cancelled
Plugin NPM Release / preview_plugins_npm (push) Has been cancelled
Plugin NPM Release / Validate release publish approval (push) Has been cancelled
Plugin NPM Release / preview_plugin_pack (push) Has been cancelled
Plugin NPM Release / publish_plugins_npm (push) Has been cancelled
Sandbox Common Smoke / sandbox-common-smoke (push) Has been cancelled
Website Installer Sync / static (push) Has been cancelled
Website Installer Sync / linux-docker (push) Has been cancelled
Website Installer Sync / macos-installer (push) Has been cancelled
Website Installer Sync / windows-installer (push) Has been cancelled
Website Installer Sync / sync-website (push) Has been cancelled
Adolf is a fork/vendored clone of github.com/openclaw/openclaw (v2026.6.11), free to diverge. Tree copied sans upstream .git; upstream remote added for future syncs. Node pinned to 24 (.nvmrc); engines already require >=22.19. Preserves docs/ARCHITECTURE.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LeqyaxJF2nbRXJtae2kNB2
8.0 KiB
8.0 KiB
summary, read_when, title
| summary | read_when | title | |
|---|---|---|---|
| CLI reference for `openclaw agent` (send one agent turn via the Gateway) |
|
Agent |
openclaw agent
Run one agent turn through the Gateway. Falls back to the embedded agent if the Gateway request fails; pass --local to force embedded execution up front.
Pass at least one session selector: --to, --session-key, --session-id, or --agent.
Related: Agent send tool
Options
-m, --message <text>: message body--message-file <path>: read the message body from a UTF-8 file-t, --to <dest>: recipient used to derive the session key--session-key <key>: explicit session key to use for routing--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, oragents.defaults.timeoutSeconds);0disables the timeout--json: output JSON
Examples
openclaw agent --to +15555550123 --message "status update" --deliver
openclaw agent --agent ops --message "Summarize logs"
openclaw agent --agent ops --message-file ./task.md
openclaw agent --agent ops --model openai/gpt-5.4 --message "Summarize logs"
openclaw agent --session-key agent:ops:incident-42 --message "Summarize status"
openclaw agent --agent ops --session-key incident-42 --message "Summarize status"
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
Notes
- Pass exactly one of
--messageor--message-file.--message-filestrips a leading UTF-8 BOM and preserves multiline content; it rejects files that are not valid UTF-8. - Slash commands (for example
/compact) cannot run through--message. The CLI rejects them and points you at the first-class command instead (openclaw sessions compact <key>for compaction). --localand embedded fallback runs are one-shot: bundled MCP loopback resources and warm Claude stdio sessions opened for the run are retired after the reply, so scripted invocations do not leave local child processes running. Gateway-backed runs keep Gateway-owned MCP loopback resources under the running Gateway process instead.--channel,--reply-channel, and--reply-accountaffect reply delivery, not session routing.--session-keyselects an explicit session key. Agent-prefixed keys must useagent:<agent-id>:<session-key>, and--agentmust match the key's agent id when both are given. Bare non-sentinel keys scope to--agentwhen supplied, or to the configured default agent otherwise; for example--agent ops --session-key incident-42routes toagent:ops:incident-42. The literal keysglobalandunknownstay unscoped only when no--agentis supplied.--jsonreserves stdout for the JSON response; Gateway, plugin, and embedded-fallback diagnostics go to stderr so scripts can parse stdout directly.- Embedded fallback JSON includes
meta.transport: "embedded"andmeta.fallbackFrom: "gateway"so scripts can detect a fallback run. - If the Gateway accepts a run but the CLI times out waiting for the final reply, embedded fallback uses a fresh
gateway-fallback-*session/run id and reportsmeta.fallbackReason: "gateway_timeout"plus the fallback session fields, instead of racing the Gateway-owned transcript or silently replacing the original session. SIGTERM/SIGINTinterrupt a waiting Gateway-backed request; if the Gateway already accepted the run, the CLI also sendschat.abortfor that run id before exiting.--localand embedded fallback runs receive the same signal but do not sendchat.abort. If the internal run-dedup key already has an active run for this session, the response reportsstatus: "in_flight"and the non-JSON CLI prints a stderr diagnostic instead of an empty reply. For external cron/systemd wrappers, keep a hard-kill backstop such astimeout -k 60 600 openclaw agent ...so the supervisor can reap the process if shutdown cannot drain.- 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), never resolved secret plaintext. Marker writes come from the active source config snapshot, not from resolved runtime secret values.
JSON delivery status
With --json --deliver, the CLI JSON response includes top-level deliveryStatus so scripts can distinguish delivered, suppressed, partial, and failed sends:
{
"payloads": [{ "text": "Report ready", "mediaUrl": null }],
"meta": { "durationMs": 1200 },
"deliveryStatus": {
"requested": true,
"attempted": true,
"status": "sent",
"succeeded": true,
"resultCount": 1
}
}
Gateway-backed CLI responses also preserve the raw Gateway result shape at result.deliveryStatus.
deliveryStatus.status is one of:
| Status | Meaning |
|---|---|
sent |
Delivery completed. |
suppressed |
Delivery was intentionally not sent (for example a message-sending hook cancelled it, or there was no visible result). Terminal, no retry. |
partial_failed |
At least one payload sent before a later payload failed. |
failed |
No durable send completed, or delivery preflight failed. |
Common fields:
requested: alwaystruewhen the object is present.attempted:trueonce the durable send path ran;falsefor preflight failures or no visible payloads.succeeded:true,false, or"partial";"partial"pairs withstatus: "partial_failed".reason: lowercase snake-case reason from durable delivery or preflight validation. Known values includecancelled_by_message_sending_hook,no_visible_payload,no_visible_result,channel_resolved_to_internal,unknown_channel,invalid_delivery_target, andno_delivery_target; failed durable sends may also report the failed stage. Treat unknown values as opaque since the set can expand.resultCount: number of channel send results, when available.sentBeforeError:truewhen a partial failure sent at least one payload before erroring.error:truefor failed or partial-failed sends.errorMessage: present only when an underlying delivery error message was captured. Preflight failures carryerror/reasonbut noerrorMessage.payloadOutcomes: optional per-payload results withindex,status,reason,resultCount,error,stage,sentBeforeError, or hook metadata when available.