Agent
기준일: 2026-07-26
공식 기준: Agent
Agent 문서는 OpenClaw 공식 문서(cli/agent)를 한국어로 정리한 가이드입니다. CLI reference for openclaw agent (send one agent turn via the Gateway) 명령·설정 키·코드 예시는 공식 문서를 그대로 보존하며, 해석과 절차 안내는 한국어로 제공합니다. 최종 동작은 설치된 CLI 버전과 공식 원문을 확인하세요.
핵심 요약
CLI reference for openclaw agent (send one agent turn via the Gateway)
한국어 가이드 범위: cli/agent 경로의 설정·명령·제약·예시를 학습용으로 재구성합니다.
문서 구성
공식 문서의 주요 섹션은 다음과 같습니다.
- 옵션
- 예제
- 참고
- JSON 전달 상태
- 관련 문서
상세 내용
openclaw agent
Run one agent turn through the Gateway. The explicit --local flag is the only embedded execution path.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
옵션
주요 항목:
-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 this command's agent-turn deadline (default 600, oragents.defaults.timeoutSeconds);0disables the overall deadline. The 600-second fallback belongs to this CLI command, not ordinary Gateway turns, whose default is 48 hours.--json: output JSON
예제
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
참고
주요 항목:
- 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. Files larger than 4 MiB are rejected before dispatch. - 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). --localruns 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.- Standalone embedded execution with
--localrefuses to reuse an existing main session while restart recovery is pending. Run the turn through a healthy Gateway, or reset it there with/newor/reset; an independent embedded process cannot safely coordinate that recovery owner with the Gateway scanner. - With
--agent,--channeland--totogether, session routing follows the channel's canonical recipient andsession.dmScope. Channels with a stable outbound-only recipient identity use a provider-owned session isolated from the agent's main session.--reply-channeland--reply-accountaffect delivery only. --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--localdiagnostics go to stderr so scripts can parse stdout directly.- After transient handshake retries are exhausted, a Gateway timeout or closed connection fails the command; the CLI never silently reruns the turn embedded. Transport loss is ambiguous — the Gateway may have accepted and may still finish the turn — so the stderr hint says to check
openclaw gateway statusand the session transcript before retrying or rerunning with--local, to avoid executing the turn twice. SIGTERM/SIGINTinterrupt a waiting Gateway-backed request; if the Gateway already accepted the run, the CLI also sendschat.abortfor that run id before exiting.--localruns receive the same signal but do not sendchat.abort. A launcher child that terminates from the first forwardedSIGINTorSIGTERMexits with status 130 or 143, respectively. 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 전달 상태
With --json --deliver, the CLI JSON response includes top-level deliveryStatus so scripts can distinguish delivered, suppressed, partial, and failed sends:
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
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.
| 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. |
{
"payloads": [{ "text": "Report ready", "mediaUrl": null }],
"meta": { "durationMs": 1200 },
"deliveryStatus": {
"requested": true,
"attempted": true,
"status": "sent",
"succeeded": true,
"resultCount": 1
}
}
관련 문서
주요 항목:
- CLI reference
- Agent runtime
실습 체크리스트
- 공식 문서와 로컬 버전을 대조합니다:
https://docs.openclaw.ai/cli/agent - 관련 CLI는
openclaw --help및 하위 명령--help로 옵션을 확인합니다. - 설정 변경 시
openclaw config/openclaw doctor로 유효성을 검사합니다. - Gateway·채널·플러그인 변경 후에는 필요 시 Gateway를 재시작합니다.
자주 쓰는 명령·설정 예시
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
{
"payloads": [{ "text": "Report ready", "mediaUrl": null }],
"meta": { "durationMs": 1200 },
"deliveryStatus": {
"requested": true,
"attempted": true,
"status": "sent",
"succeeded": true,
"resultCount": 1
}
}
관련 링크
- 공식 원문: cli/agent
- OpenClaw 문서 홈
이 가이드는 공식 문서를 한국어 학습용으로 재구성한 것입니다. 옵션 기본값·플래그 이름은 설치 버전에 따라 달라질 수 있습니다.