






















@@ -0,0 +1,290 @@
1+---
2+summary: "CLI reference and security model for Crestodian, the configless-safe setup and repair helper"
3+read_when:
4+ - You run openclaw with no command and want to understand Crestodian
5+ - You need a configless-safe way to inspect or repair OpenClaw
6+ - You are designing or enabling message-channel rescue mode
7+title: "Crestodian"
8+---
9+10+# `openclaw crestodian`
11+12+Crestodian is OpenClaw's local setup, repair, and configuration helper. It is
13+designed to stay reachable when the normal agent path is broken.
14+15+Running `openclaw` with no command starts Crestodian in an interactive terminal.
16+Running `openclaw crestodian` starts the same helper explicitly.
17+18+## What Crestodian shows
19+20+On startup, Crestodian prints a compact system overview:
21+22+- config path and validity
23+- configured agents and the default agent
24+- default model
25+- local Codex and Claude Code CLI availability
26+- OpenAI and Anthropic API-key presence
27+- planner mode (`deterministic` or model-assisted through the configured model)
28+- local docs path or the public docs URL
29+- local source path for Git checkouts, otherwise the OpenClaw GitHub source URL
30+- gateway reachability
31+- the immediate recommended next step
32+33+It does not dump secrets or load plugin CLI commands just to start.
34+35+Crestodian uses the same OpenClaw reference discovery as regular agents. In a Git checkout,
36+it points itself at local `docs/` and the local source tree. In an npm package install, it
37+uses the bundled package docs and links to
38+[https://github.com/openclaw/openclaw](https://github.com/openclaw/openclaw), with explicit
39+guidance to review source whenever the docs are not enough.
40+41+## Examples
42+43+```bash
44+openclaw
45+openclaw crestodian
46+openclaw crestodian --json
47+openclaw crestodian --message "models"
48+openclaw crestodian --message "validate config"
49+openclaw crestodian --message "setup workspace ~/Projects/work model openai/gpt-5.5" --yes
50+openclaw crestodian --message "set default model openai/gpt-5.5" --yes
51+openclaw onboard --modern
52+```
53+54+Inside the interactive prompt:
55+56+```text
57+status
58+health
59+doctor
60+doctor fix
61+validate config
62+setup
63+setup workspace ~/Projects/work model openai/gpt-5.5
64+config set gateway.port 19001
65+config set-ref gateway.auth.token env OPENCLAW_GATEWAY_TOKEN
66+gateway status
67+restart gateway
68+agents
69+create agent work workspace ~/Projects/work
70+models
71+set default model openai/gpt-5.5
72+talk to work agent
73+talk to agent for ~/Projects/work
74+audit
75+quit
76+```
77+78+## Safe startup
79+80+Crestodian's startup path is deliberately small. It can run when:
81+82+- `openclaw.json` is missing
83+- `openclaw.json` is invalid
84+- the Gateway is down
85+- plugin command registration is unavailable
86+- no agent has been configured yet
87+88+`openclaw --help` and `openclaw --version` still use the normal fast paths.
89+Noninteractive `openclaw` exits with a short message instead of printing root
90+help, because the no-command product is Crestodian.
91+92+## Operations and approval
93+94+Crestodian uses typed operations instead of editing config ad hoc.
95+96+Read-only operations can run immediately:
97+98+- show overview
99+- list agents
100+- show model/backend status
101+- run status or health checks
102+- check Gateway reachability
103+- run doctor without interactive fixes
104+- validate config
105+- show the audit-log path
106+107+Persistent operations require conversational approval in interactive mode unless
108+you pass `--yes` for a one-shot command:
109+110+- write config
111+- run `config set`
112+- set supported SecretRef values through `config set-ref`
113+- run setup/onboarding bootstrap
114+- change the default model
115+- start, stop, or restart the Gateway
116+- create agents
117+- run doctor repairs that rewrite config or state
118+119+Applied writes are recorded in:
120+121+```text
122+~/.openclaw/audit/crestodian.jsonl
123+```
124+125+Discovery is not audited. Only applied operations and writes are logged.
126+127+`openclaw onboard --modern` starts Crestodian as the modern onboarding preview.
128+Plain `openclaw onboard` still runs classic onboarding.
129+130+## Setup Bootstrap
131+132+`setup` is the chat-first onboarding bootstrap. It writes only through typed
133+config operations and asks for approval first.
134+135+```text
136+setup
137+setup workspace ~/Projects/work
138+setup workspace ~/Projects/work model openai/gpt-5.5
139+```
140+141+When no model is configured, setup selects the first usable backend in this
142+order and tells you what it chose:
143+144+- existing explicit model, if already configured
145+- `OPENAI_API_KEY` -> `openai/gpt-5.5`
146+- `ANTHROPIC_API_KEY` -> `anthropic/claude-opus-4-7`
147+- Claude Code CLI -> `claude-cli/claude-opus-4-7`
148+- Codex CLI -> `codex-cli/gpt-5.5`
149+150+If none are available, setup still writes the default workspace and leaves the
151+model unset. Install or log into Codex/Claude Code, or expose
152+`OPENAI_API_KEY`/`ANTHROPIC_API_KEY`, then run setup again.
153+154+## Model-Assisted Planner
155+156+Crestodian always starts in deterministic mode. Once a valid OpenClaw model is
157+configured, local Crestodian can make one bounded model call for fuzzy commands
158+that the deterministic parser does not understand.
159+160+The model-assisted planner cannot mutate config directly. It must translate the
161+request into one of Crestodian's typed commands, then the normal approval and
162+audit rules apply. Crestodian prints the model it used and the interpreted
163+command before it runs anything.
164+165+Message-channel rescue mode does not use the model-assisted planner. Remote
166+rescue stays deterministic so a broken or compromised normal agent path cannot
167+be used as a config editor.
168+169+## Switching to an agent
170+171+Use a natural-language selector to leave Crestodian and open the normal TUI:
172+173+```text
174+talk to agent
175+talk to work agent
176+switch to main agent
177+```
178+179+`openclaw tui`, `openclaw chat`, and `openclaw terminal` still open the normal
180+agent TUI directly. They do not start Crestodian.
181+182+After switching into the normal TUI, use `/crestodian` to return to Crestodian.
183+You can include a follow-up request:
184+185+```text
186+/crestodian
187+/crestodian restart gateway
188+```
189+190+Agent switches inside the TUI leave a breadcrumb that `/crestodian` is available.
191+192+## Message rescue mode
193+194+Message rescue mode is the message-channel entrypoint for Crestodian. It is for
195+the case where your normal agent is dead, but a trusted channel such as WhatsApp
196+still receives commands.
197+198+Supported text command:
199+200+- `/crestodian <request>`
201+202+Operator flow:
203+204+```text
205+You, in a trusted owner DM: /crestodian status
206+OpenClaw: Crestodian rescue mode. Gateway reachable: no. Config valid: no.
207+You: /crestodian restart gateway
208+OpenClaw: Plan: restart the Gateway. Reply /crestodian yes to apply.
209+You: /crestodian yes
210+OpenClaw: Applied. Audit entry written.
211+```
212+213+Agent creation can also be queued from the local prompt or rescue mode:
214+215+```text
216+create agent work workspace ~/Projects/work model openai/gpt-5.5
217+/crestodian create agent work workspace ~/Projects/work
218+```
219+220+Remote rescue mode is an admin surface. It must be treated like remote config
221+repair, not like normal chat.
222+223+Security contract for remote rescue:
224+225+- Disabled when sandboxing is active. If an agent/session is sandboxed,
226+ Crestodian must refuse remote rescue and explain that local CLI repair is
227+ required.
228+- Default effective state is `auto`: allow remote rescue only in trusted YOLO
229+ operation, where the runtime already has unsandboxed local authority.
230+- Require an explicit owner identity. Rescue must not accept wildcard sender
231+ rules, open group policy, unauthenticated webhooks, or anonymous channels.
232+- Owner DMs only by default. Group/channel rescue requires explicit opt-in and
233+ should still route approval prompts to the owner DM.
234+- Remote rescue cannot open the local TUI or switch into an interactive agent
235+ session. Use local `openclaw` for agent handoff.
236+- Persistent writes still require approval, even in rescue mode.
237+- Audit every applied rescue operation, including channel, account, sender,
238+ session key, operation, config hash before, and config hash after.
239+- Never echo secrets. SecretRef inspection should report availability, not
240+ values.
241+- If the Gateway is alive, prefer Gateway typed operations. If the Gateway is
242+ dead, use only the minimal local repair surface that does not depend on the
243+ normal agent loop.
244+245+Config shape:
246+247+```jsonc
248+{
249+"crestodian": {
250+"rescue": {
251+"enabled": "auto",
252+"ownerDmOnly": true,
253+ },
254+ },
255+}
256+```
257+258+`enabled` should accept:
259+260+- `"auto"`: default. Allow only when the effective runtime is YOLO and
261+ sandboxing is off.
262+- `false`: never allow message-channel rescue.
263+- `true`: explicitly allow rescue when the owner/channel checks pass. This
264+ still must not bypass the sandboxing denial.
265+266+The default `"auto"` YOLO posture is:
267+268+- sandbox mode resolves to `off`
269+- `tools.exec.security` resolves to `full`
270+- `tools.exec.ask` resolves to `off`
271+272+Remote rescue is covered by the Docker lane:
273+274+```bash
275+pnpm test:docker:crestodian-rescue
276+```
277+278+Fresh configless setup through Crestodian is covered by:
279+280+```bash
281+pnpm test:docker:crestodian-first-run
282+```
283+284+## Related
285+286+- [CLI reference](/cli)
287+- [Doctor](/cli/doctor)
288+- [TUI](/cli/tui)
289+- [Sandbox](/cli/sandbox)
290+- [Security](/cli/security)
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。