vantuz 3.2.5 → 3.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3571 @@
1
+
2
+ #compdef openclaw
3
+
4
+ _openclaw_root_completion() {
5
+ local -a commands
6
+ local -a options
7
+
8
+ _arguments -C \
9
+ "(--version -V)"{--version,-V}"[output the version number]" \
10
+ "--dev[Dev profile: isolate state under ~/.openclaw-dev, default gateway port 19001, and shift derived ports (browser/canvas)]" \
11
+ "--profile[Use a named profile (isolates OPENCLAW_STATE_DIR/OPENCLAW_CONFIG_PATH under ~/.openclaw-<name>)]" \
12
+ "--no-color[Disable ANSI colors]" \
13
+ "1: :_values 'command' 'setup[Initialize ~/.openclaw/openclaw.json and the agent workspace]' 'onboard[Interactive wizard to set up the gateway, workspace, and skills]' 'configure[Interactive prompt to set up credentials, devices, and agent defaults]' 'config[Config helpers (get/set/unset). Run without subcommand for the wizard.]' 'doctor[Health checks + quick fixes for the gateway and channels]' 'dashboard[Open the Control UI with your current token]' 'reset[Reset local config/state (keeps the CLI installed)]' 'uninstall[Uninstall the gateway service + local data (CLI remains)]' 'message[Send messages and channel actions]' 'memory[Memory search tools]' 'agent[Run an agent turn via the Gateway (use --local for embedded)]' 'agents[Manage isolated agents (workspaces + auth + routing)]' 'status[Show channel health and recent session recipients]' 'health[Fetch health from the running gateway]' 'sessions[List stored conversation sessions]' 'browser[Manage OpenClaw'\''s dedicated browser (Chrome/Chromium)]' 'completion[Generate shell completion script]' 'acp[Run an ACP bridge backed by the Gateway]' 'gateway[Run the WebSocket Gateway]' 'daemon[Manage the Gateway service (launchd/systemd/schtasks)]' 'logs[Tail gateway file logs via RPC]' 'system[System tools (events, heartbeat, presence)]' 'models[Model discovery, scanning, and configuration]' 'approvals[Manage exec approvals (gateway or node host)]' 'nodes[Manage gateway-owned node pairing]' 'devices[Device pairing and auth tokens]' 'node[Run a headless node host (system.run/system.which)]' 'sandbox[Manage sandbox containers (Docker-based agent isolation)]' 'tui[Open a terminal UI connected to the Gateway]' 'cron[Manage cron jobs (via Gateway)]' 'dns[DNS helpers for wide-area discovery (Tailscale + CoreDNS)]' 'docs[Search the live OpenClaw docs]' 'hooks[Manage internal agent hooks]' 'webhooks[Webhook helpers and integrations]' 'pairing[Secure DM pairing (approve inbound requests)]' 'plugins[Manage OpenClaw plugins/extensions]' 'channels[Manage chat channel accounts]' 'directory[Directory lookups (self, peers, groups) for channels that support it]' 'security[Security tools (audit)]' 'skills[List and inspect available skills]' 'update[Update OpenClaw to the latest version]'" \
14
+ "*::arg:->args"
15
+
16
+ case $state in
17
+ (args)
18
+ case $line[1] in
19
+ (setup) _openclaw_setup ;;
20
+ (onboard) _openclaw_onboard ;;
21
+ (configure) _openclaw_configure ;;
22
+ (config) _openclaw_config ;;
23
+ (doctor) _openclaw_doctor ;;
24
+ (dashboard) _openclaw_dashboard ;;
25
+ (reset) _openclaw_reset ;;
26
+ (uninstall) _openclaw_uninstall ;;
27
+ (message) _openclaw_message ;;
28
+ (memory) _openclaw_memory ;;
29
+ (agent) _openclaw_agent ;;
30
+ (agents) _openclaw_agents ;;
31
+ (status) _openclaw_status ;;
32
+ (health) _openclaw_health ;;
33
+ (sessions) _openclaw_sessions ;;
34
+ (browser) _openclaw_browser ;;
35
+ (completion) _openclaw_completion ;;
36
+ (acp) _openclaw_acp ;;
37
+ (gateway) _openclaw_gateway ;;
38
+ (daemon) _openclaw_daemon ;;
39
+ (logs) _openclaw_logs ;;
40
+ (system) _openclaw_system ;;
41
+ (models) _openclaw_models ;;
42
+ (approvals) _openclaw_approvals ;;
43
+ (nodes) _openclaw_nodes ;;
44
+ (devices) _openclaw_devices ;;
45
+ (node) _openclaw_node ;;
46
+ (sandbox) _openclaw_sandbox ;;
47
+ (tui) _openclaw_tui ;;
48
+ (cron) _openclaw_cron ;;
49
+ (dns) _openclaw_dns ;;
50
+ (docs) _openclaw_docs ;;
51
+ (hooks) _openclaw_hooks ;;
52
+ (webhooks) _openclaw_webhooks ;;
53
+ (pairing) _openclaw_pairing ;;
54
+ (plugins) _openclaw_plugins ;;
55
+ (channels) _openclaw_channels ;;
56
+ (directory) _openclaw_directory ;;
57
+ (security) _openclaw_security ;;
58
+ (skills) _openclaw_skills ;;
59
+ (update) _openclaw_update ;;
60
+ esac
61
+ ;;
62
+ esac
63
+ }
64
+
65
+
66
+ _openclaw_setup() {
67
+ _arguments -C \
68
+ "--workspace[Agent workspace directory (default: ~/.openclaw/workspace; stored as agents.defaults.workspace)]" \
69
+ "--wizard[Run the interactive onboarding wizard]" \
70
+ "--non-interactive[Run the wizard without prompts]" \
71
+ "--mode[Wizard mode: local|remote]" \
72
+ "--remote-url[Remote Gateway WebSocket URL]" \
73
+ "--remote-token[Remote Gateway token (optional)]"
74
+ }
75
+
76
+ _openclaw_onboard() {
77
+ _arguments -C \
78
+ "--workspace[Agent workspace directory (default: ~/.openclaw/workspace)]" \
79
+ "--reset[Reset config + credentials + sessions + workspace before running wizard]" \
80
+ "--non-interactive[Run without prompts]" \
81
+ "--accept-risk[Acknowledge that agents are powerful and full system access is risky (required for --non-interactive)]" \
82
+ "--flow[Wizard flow: quickstart|advanced|manual]" \
83
+ "--mode[Wizard mode: local|remote]" \
84
+ "--auth-choice[Auth: setup-token|token|chutes|openai-codex|openai-api-key|xai-api-key|qianfan-api-key|openrouter-api-key|ai-gateway-api-key|cloudflare-ai-gateway-api-key|moonshot-api-key|moonshot-api-key-cn|kimi-code-api-key|synthetic-api-key|venice-api-key|gemini-api-key|zai-api-key|xiaomi-api-key|apiKey|minimax-api|minimax-api-lightning|opencode-zen|skip]" \
85
+ "--token-provider[Token provider id (non-interactive; used with --auth-choice token)]" \
86
+ "--token[Token value (non-interactive; used with --auth-choice token)]" \
87
+ "--token-profile-id[Auth profile id (non-interactive; default: <provider>:manual)]" \
88
+ "--token-expires-in[Optional token expiry duration (e.g. 365d, 12h)]" \
89
+ "--anthropic-api-key[Anthropic API key]" \
90
+ "--openai-api-key[OpenAI API key]" \
91
+ "--openrouter-api-key[OpenRouter API key]" \
92
+ "--ai-gateway-api-key[Vercel AI Gateway API key]" \
93
+ "--cloudflare-ai-gateway-account-id[Cloudflare Account ID]" \
94
+ "--cloudflare-ai-gateway-gateway-id[Cloudflare AI Gateway ID]" \
95
+ "--cloudflare-ai-gateway-api-key[Cloudflare AI Gateway API key]" \
96
+ "--moonshot-api-key[Moonshot API key]" \
97
+ "--kimi-code-api-key[Kimi Coding API key]" \
98
+ "--gemini-api-key[Gemini API key]" \
99
+ "--zai-api-key[Z.AI API key]" \
100
+ "--xiaomi-api-key[Xiaomi API key]" \
101
+ "--minimax-api-key[MiniMax API key]" \
102
+ "--synthetic-api-key[Synthetic API key]" \
103
+ "--venice-api-key[Venice API key]" \
104
+ "--opencode-zen-api-key[OpenCode Zen API key]" \
105
+ "--xai-api-key[xAI API key]" \
106
+ "--qianfan-api-key[QIANFAN API key]" \
107
+ "--gateway-port[Gateway port]" \
108
+ "--gateway-bind[Gateway bind: loopback|tailnet|lan|auto|custom]" \
109
+ "--gateway-auth[Gateway auth: token|password]" \
110
+ "--gateway-token[Gateway token (token auth)]" \
111
+ "--gateway-password[Gateway password (password auth)]" \
112
+ "--remote-url[Remote Gateway WebSocket URL]" \
113
+ "--remote-token[Remote Gateway token (optional)]" \
114
+ "--tailscale[Tailscale: off|serve|funnel]" \
115
+ "--tailscale-reset-on-exit[Reset tailscale serve/funnel on exit]" \
116
+ "--install-daemon[Install gateway service]" \
117
+ "--no-install-daemon[Skip gateway service install]" \
118
+ "--skip-daemon[Skip gateway service install]" \
119
+ "--daemon-runtime[Daemon runtime: node|bun]" \
120
+ "--skip-channels[Skip channel setup]" \
121
+ "--skip-skills[Skip skills setup]" \
122
+ "--skip-health[Skip health check]" \
123
+ "--skip-ui[Skip Control UI/TUI prompts]" \
124
+ "--node-manager[Node manager for skills: npm|pnpm|bun]" \
125
+ "--json[Output JSON summary]"
126
+ }
127
+
128
+ _openclaw_configure() {
129
+ _arguments -C \
130
+ "--section[Configuration sections (repeatable). Options: workspace, model, web, gateway, daemon, channels, skills, health]"
131
+ }
132
+
133
+ _openclaw_config_get() {
134
+ _arguments -C \
135
+ "--json[Output JSON]"
136
+ }
137
+
138
+ _openclaw_config_set() {
139
+ _arguments -C \
140
+ "--json[Parse value as JSON5 (required)]"
141
+ }
142
+
143
+ _openclaw_config_unset() {
144
+ _arguments -C \
145
+
146
+ }
147
+
148
+ _openclaw_config() {
149
+ local -a commands
150
+ local -a options
151
+
152
+ _arguments -C \
153
+ "--section[Configure wizard sections (repeatable). Use with no subcommand.]" \
154
+ "1: :_values 'command' 'get[Get a config value by dot path]' 'set[Set a config value by dot path]' 'unset[Remove a config value by dot path]'" \
155
+ "*::arg:->args"
156
+
157
+ case $state in
158
+ (args)
159
+ case $line[1] in
160
+ (get) _openclaw_config_get ;;
161
+ (set) _openclaw_config_set ;;
162
+ (unset) _openclaw_config_unset ;;
163
+ esac
164
+ ;;
165
+ esac
166
+ }
167
+
168
+ _openclaw_doctor() {
169
+ _arguments -C \
170
+ "--no-workspace-suggestions[Disable workspace memory system suggestions]" \
171
+ "--yes[Accept defaults without prompting]" \
172
+ "--repair[Apply recommended repairs without prompting]" \
173
+ "--fix[Apply recommended repairs (alias for --repair)]" \
174
+ "--force[Apply aggressive repairs (overwrites custom service config)]" \
175
+ "--non-interactive[Run without prompts (safe migrations only)]" \
176
+ "--generate-gateway-token[Generate and configure a gateway token]" \
177
+ "--deep[Scan system services for extra gateway installs]"
178
+ }
179
+
180
+ _openclaw_dashboard() {
181
+ _arguments -C \
182
+ "--no-open[Print URL but do not launch a browser]"
183
+ }
184
+
185
+ _openclaw_reset() {
186
+ _arguments -C \
187
+ "--scope[config|config+creds+sessions|full (default: interactive prompt)]" \
188
+ "--yes[Skip confirmation prompts]" \
189
+ "--non-interactive[Disable prompts (requires --scope + --yes)]" \
190
+ "--dry-run[Print actions without removing files]"
191
+ }
192
+
193
+ _openclaw_uninstall() {
194
+ _arguments -C \
195
+ "--service[Remove the gateway service]" \
196
+ "--state[Remove state + config]" \
197
+ "--workspace[Remove workspace dirs]" \
198
+ "--app[Remove the macOS app]" \
199
+ "--all[Remove service + state + workspace + app]" \
200
+ "--yes[Skip confirmation prompts]" \
201
+ "--non-interactive[Disable prompts (requires --yes)]" \
202
+ "--dry-run[Print actions without removing files]"
203
+ }
204
+
205
+ _openclaw_message_send() {
206
+ _arguments -C \
207
+ "(--message -m)"{--message,-m}"[Message body (required unless --media is set)]" \
208
+ "(--target -t)"{--target,-t}"[Recipient/channel: E.164 for WhatsApp/Signal, Telegram chat id/@username, Discord/Slack channel/user, or iMessage handle/chat_id]" \
209
+ "--media[Attach media (image/audio/video/document). Accepts local paths or URLs.]" \
210
+ "--buttons[Telegram inline keyboard buttons as JSON (array of button rows)]" \
211
+ "--card[Adaptive Card JSON object (when supported by the channel)]" \
212
+ "--reply-to[Reply-to message id]" \
213
+ "--thread-id[Thread id (Telegram forum thread)]" \
214
+ "--gif-playback[Treat video media as GIF playback (WhatsApp only).]" \
215
+ "--silent[Send message silently without notification (Telegram only)]" \
216
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
217
+ "--account[Channel account id (accountId)]" \
218
+ "--json[Output result as JSON]" \
219
+ "--dry-run[Print payload and skip sending]" \
220
+ "--verbose[Verbose logging]"
221
+ }
222
+
223
+ _openclaw_message_broadcast() {
224
+ _arguments -C \
225
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
226
+ "--account[Channel account id (accountId)]" \
227
+ "--json[Output result as JSON]" \
228
+ "--dry-run[Print payload and skip sending]" \
229
+ "--verbose[Verbose logging]" \
230
+ "--targets[Recipient/channel targets (same format as --target); accepts ids or names when the directory is available.]" \
231
+ "--message[Message to send]" \
232
+ "--media[Media URL]"
233
+ }
234
+
235
+ _openclaw_message_poll() {
236
+ _arguments -C \
237
+ "(--target -t)"{--target,-t}"[Recipient/channel: E.164 for WhatsApp/Signal, Telegram chat id/@username, Discord/Slack channel/user, or iMessage handle/chat_id]" \
238
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
239
+ "--account[Channel account id (accountId)]" \
240
+ "--json[Output result as JSON]" \
241
+ "--dry-run[Print payload and skip sending]" \
242
+ "--verbose[Verbose logging]" \
243
+ "--poll-question[Poll question]" \
244
+ "--poll-option[Poll option (repeat 2-12 times)]" \
245
+ "--poll-multi[Allow multiple selections]" \
246
+ "--poll-duration-hours[Poll duration (Discord)]" \
247
+ "(--message -m)"{--message,-m}"[Optional message body]"
248
+ }
249
+
250
+ _openclaw_message_react() {
251
+ _arguments -C \
252
+ "(--target -t)"{--target,-t}"[Recipient/channel: E.164 for WhatsApp/Signal, Telegram chat id/@username, Discord/Slack channel/user, or iMessage handle/chat_id]" \
253
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
254
+ "--account[Channel account id (accountId)]" \
255
+ "--json[Output result as JSON]" \
256
+ "--dry-run[Print payload and skip sending]" \
257
+ "--verbose[Verbose logging]" \
258
+ "--message-id[Message id]" \
259
+ "--emoji[Emoji for reactions]" \
260
+ "--remove[Remove reaction]" \
261
+ "--participant[WhatsApp reaction participant]" \
262
+ "--from-me[WhatsApp reaction fromMe]" \
263
+ "--target-author[Signal reaction target author (uuid or phone)]" \
264
+ "--target-author-uuid[Signal reaction target author uuid]"
265
+ }
266
+
267
+ _openclaw_message_reactions() {
268
+ _arguments -C \
269
+ "(--target -t)"{--target,-t}"[Recipient/channel: E.164 for WhatsApp/Signal, Telegram chat id/@username, Discord/Slack channel/user, or iMessage handle/chat_id]" \
270
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
271
+ "--account[Channel account id (accountId)]" \
272
+ "--json[Output result as JSON]" \
273
+ "--dry-run[Print payload and skip sending]" \
274
+ "--verbose[Verbose logging]" \
275
+ "--message-id[Message id]" \
276
+ "--limit[Result limit]"
277
+ }
278
+
279
+ _openclaw_message_read() {
280
+ _arguments -C \
281
+ "(--target -t)"{--target,-t}"[Recipient/channel: E.164 for WhatsApp/Signal, Telegram chat id/@username, Discord/Slack channel/user, or iMessage handle/chat_id]" \
282
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
283
+ "--account[Channel account id (accountId)]" \
284
+ "--json[Output result as JSON]" \
285
+ "--dry-run[Print payload and skip sending]" \
286
+ "--verbose[Verbose logging]" \
287
+ "--limit[Result limit]" \
288
+ "--before[Read/search before id]" \
289
+ "--after[Read/search after id]" \
290
+ "--around[Read around id]" \
291
+ "--include-thread[Include thread replies (Discord)]"
292
+ }
293
+
294
+ _openclaw_message_edit() {
295
+ _arguments -C \
296
+ "--message-id[Message id]" \
297
+ "(--message -m)"{--message,-m}"[Message body]" \
298
+ "(--target -t)"{--target,-t}"[Recipient/channel: E.164 for WhatsApp/Signal, Telegram chat id/@username, Discord/Slack channel/user, or iMessage handle/chat_id]" \
299
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
300
+ "--account[Channel account id (accountId)]" \
301
+ "--json[Output result as JSON]" \
302
+ "--dry-run[Print payload and skip sending]" \
303
+ "--verbose[Verbose logging]" \
304
+ "--thread-id[Thread id (Telegram forum thread)]"
305
+ }
306
+
307
+ _openclaw_message_delete() {
308
+ _arguments -C \
309
+ "--message-id[Message id]" \
310
+ "(--target -t)"{--target,-t}"[Recipient/channel: E.164 for WhatsApp/Signal, Telegram chat id/@username, Discord/Slack channel/user, or iMessage handle/chat_id]" \
311
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
312
+ "--account[Channel account id (accountId)]" \
313
+ "--json[Output result as JSON]" \
314
+ "--dry-run[Print payload and skip sending]" \
315
+ "--verbose[Verbose logging]"
316
+ }
317
+
318
+ _openclaw_message_pin() {
319
+ _arguments -C \
320
+ "(--target -t)"{--target,-t}"[Recipient/channel: E.164 for WhatsApp/Signal, Telegram chat id/@username, Discord/Slack channel/user, or iMessage handle/chat_id]" \
321
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
322
+ "--account[Channel account id (accountId)]" \
323
+ "--json[Output result as JSON]" \
324
+ "--dry-run[Print payload and skip sending]" \
325
+ "--verbose[Verbose logging]" \
326
+ "--message-id[Message id]"
327
+ }
328
+
329
+ _openclaw_message_unpin() {
330
+ _arguments -C \
331
+ "(--target -t)"{--target,-t}"[Recipient/channel: E.164 for WhatsApp/Signal, Telegram chat id/@username, Discord/Slack channel/user, or iMessage handle/chat_id]" \
332
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
333
+ "--account[Channel account id (accountId)]" \
334
+ "--json[Output result as JSON]" \
335
+ "--dry-run[Print payload and skip sending]" \
336
+ "--verbose[Verbose logging]" \
337
+ "--message-id[Message id]"
338
+ }
339
+
340
+ _openclaw_message_pins() {
341
+ _arguments -C \
342
+ "(--target -t)"{--target,-t}"[Recipient/channel: E.164 for WhatsApp/Signal, Telegram chat id/@username, Discord/Slack channel/user, or iMessage handle/chat_id]" \
343
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
344
+ "--account[Channel account id (accountId)]" \
345
+ "--json[Output result as JSON]" \
346
+ "--dry-run[Print payload and skip sending]" \
347
+ "--verbose[Verbose logging]" \
348
+ "--limit[Result limit]"
349
+ }
350
+
351
+ _openclaw_message_permissions() {
352
+ _arguments -C \
353
+ "(--target -t)"{--target,-t}"[Recipient/channel: E.164 for WhatsApp/Signal, Telegram chat id/@username, Discord/Slack channel/user, or iMessage handle/chat_id]" \
354
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
355
+ "--account[Channel account id (accountId)]" \
356
+ "--json[Output result as JSON]" \
357
+ "--dry-run[Print payload and skip sending]" \
358
+ "--verbose[Verbose logging]"
359
+ }
360
+
361
+ _openclaw_message_search() {
362
+ _arguments -C \
363
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
364
+ "--account[Channel account id (accountId)]" \
365
+ "--json[Output result as JSON]" \
366
+ "--dry-run[Print payload and skip sending]" \
367
+ "--verbose[Verbose logging]" \
368
+ "--guild-id[Guild id]" \
369
+ "--query[Search query]" \
370
+ "--channel-id[Channel id]" \
371
+ "--channel-ids[Channel id (repeat)]" \
372
+ "--author-id[Author id]" \
373
+ "--author-ids[Author id (repeat)]" \
374
+ "--limit[Result limit]"
375
+ }
376
+
377
+ _openclaw_message_thread_create() {
378
+ _arguments -C \
379
+ "--thread-name[Thread name]" \
380
+ "(--target -t)"{--target,-t}"[Recipient/channel: E.164 for WhatsApp/Signal, Telegram chat id/@username, Discord/Slack channel/user, or iMessage handle/chat_id]" \
381
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
382
+ "--account[Channel account id (accountId)]" \
383
+ "--json[Output result as JSON]" \
384
+ "--dry-run[Print payload and skip sending]" \
385
+ "--verbose[Verbose logging]" \
386
+ "--message-id[Message id (optional)]" \
387
+ "(--message -m)"{--message,-m}"[Initial thread message text]" \
388
+ "--auto-archive-min[Thread auto-archive minutes]"
389
+ }
390
+
391
+ _openclaw_message_thread_list() {
392
+ _arguments -C \
393
+ "--guild-id[Guild id]" \
394
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
395
+ "--account[Channel account id (accountId)]" \
396
+ "--json[Output result as JSON]" \
397
+ "--dry-run[Print payload and skip sending]" \
398
+ "--verbose[Verbose logging]" \
399
+ "--channel-id[Channel id]" \
400
+ "--include-archived[Include archived threads]" \
401
+ "--before[Read/search before id]" \
402
+ "--limit[Result limit]"
403
+ }
404
+
405
+ _openclaw_message_thread_reply() {
406
+ _arguments -C \
407
+ "(--message -m)"{--message,-m}"[Message body]" \
408
+ "(--target -t)"{--target,-t}"[Recipient/channel: E.164 for WhatsApp/Signal, Telegram chat id/@username, Discord/Slack channel/user, or iMessage handle/chat_id]" \
409
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
410
+ "--account[Channel account id (accountId)]" \
411
+ "--json[Output result as JSON]" \
412
+ "--dry-run[Print payload and skip sending]" \
413
+ "--verbose[Verbose logging]" \
414
+ "--media[Attach media (image/audio/video/document). Accepts local paths or URLs.]" \
415
+ "--reply-to[Reply-to message id]"
416
+ }
417
+
418
+ _openclaw_message_thread() {
419
+ local -a commands
420
+ local -a options
421
+
422
+ _arguments -C \
423
+ \
424
+ "1: :_values 'command' 'create[Create a thread]' 'list[List threads]' 'reply[Reply in a thread]'" \
425
+ "*::arg:->args"
426
+
427
+ case $state in
428
+ (args)
429
+ case $line[1] in
430
+ (create) _openclaw_message_thread_create ;;
431
+ (list) _openclaw_message_thread_list ;;
432
+ (reply) _openclaw_message_thread_reply ;;
433
+ esac
434
+ ;;
435
+ esac
436
+ }
437
+
438
+ _openclaw_message_emoji_list() {
439
+ _arguments -C \
440
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
441
+ "--account[Channel account id (accountId)]" \
442
+ "--json[Output result as JSON]" \
443
+ "--dry-run[Print payload and skip sending]" \
444
+ "--verbose[Verbose logging]" \
445
+ "--guild-id[Guild id (Discord)]"
446
+ }
447
+
448
+ _openclaw_message_emoji_upload() {
449
+ _arguments -C \
450
+ "--guild-id[Guild id]" \
451
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
452
+ "--account[Channel account id (accountId)]" \
453
+ "--json[Output result as JSON]" \
454
+ "--dry-run[Print payload and skip sending]" \
455
+ "--verbose[Verbose logging]" \
456
+ "--emoji-name[Emoji name]" \
457
+ "--media[Emoji media (path or URL)]" \
458
+ "--role-ids[Role id (repeat)]"
459
+ }
460
+
461
+ _openclaw_message_emoji() {
462
+ local -a commands
463
+ local -a options
464
+
465
+ _arguments -C \
466
+ \
467
+ "1: :_values 'command' 'list[List emojis]' 'upload[Upload an emoji]'" \
468
+ "*::arg:->args"
469
+
470
+ case $state in
471
+ (args)
472
+ case $line[1] in
473
+ (list) _openclaw_message_emoji_list ;;
474
+ (upload) _openclaw_message_emoji_upload ;;
475
+ esac
476
+ ;;
477
+ esac
478
+ }
479
+
480
+ _openclaw_message_sticker_send() {
481
+ _arguments -C \
482
+ "(--target -t)"{--target,-t}"[Recipient/channel: E.164 for WhatsApp/Signal, Telegram chat id/@username, Discord/Slack channel/user, or iMessage handle/chat_id]" \
483
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
484
+ "--account[Channel account id (accountId)]" \
485
+ "--json[Output result as JSON]" \
486
+ "--dry-run[Print payload and skip sending]" \
487
+ "--verbose[Verbose logging]" \
488
+ "--sticker-id[Sticker id (repeat)]" \
489
+ "(--message -m)"{--message,-m}"[Optional message body]"
490
+ }
491
+
492
+ _openclaw_message_sticker_upload() {
493
+ _arguments -C \
494
+ "--guild-id[Guild id]" \
495
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
496
+ "--account[Channel account id (accountId)]" \
497
+ "--json[Output result as JSON]" \
498
+ "--dry-run[Print payload and skip sending]" \
499
+ "--verbose[Verbose logging]" \
500
+ "--sticker-name[Sticker name]" \
501
+ "--sticker-desc[Sticker description]" \
502
+ "--sticker-tags[Sticker tags]" \
503
+ "--media[Sticker media (path or URL)]"
504
+ }
505
+
506
+ _openclaw_message_sticker() {
507
+ local -a commands
508
+ local -a options
509
+
510
+ _arguments -C \
511
+ \
512
+ "1: :_values 'command' 'send[Send stickers]' 'upload[Upload a sticker]'" \
513
+ "*::arg:->args"
514
+
515
+ case $state in
516
+ (args)
517
+ case $line[1] in
518
+ (send) _openclaw_message_sticker_send ;;
519
+ (upload) _openclaw_message_sticker_upload ;;
520
+ esac
521
+ ;;
522
+ esac
523
+ }
524
+
525
+ _openclaw_message_role_info() {
526
+ _arguments -C \
527
+ "--guild-id[Guild id]" \
528
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
529
+ "--account[Channel account id (accountId)]" \
530
+ "--json[Output result as JSON]" \
531
+ "--dry-run[Print payload and skip sending]" \
532
+ "--verbose[Verbose logging]"
533
+ }
534
+
535
+ _openclaw_message_role_add() {
536
+ _arguments -C \
537
+ "--guild-id[Guild id]" \
538
+ "--user-id[User id]" \
539
+ "--role-id[Role id]" \
540
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
541
+ "--account[Channel account id (accountId)]" \
542
+ "--json[Output result as JSON]" \
543
+ "--dry-run[Print payload and skip sending]" \
544
+ "--verbose[Verbose logging]"
545
+ }
546
+
547
+ _openclaw_message_role_remove() {
548
+ _arguments -C \
549
+ "--guild-id[Guild id]" \
550
+ "--user-id[User id]" \
551
+ "--role-id[Role id]" \
552
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
553
+ "--account[Channel account id (accountId)]" \
554
+ "--json[Output result as JSON]" \
555
+ "--dry-run[Print payload and skip sending]" \
556
+ "--verbose[Verbose logging]"
557
+ }
558
+
559
+ _openclaw_message_role() {
560
+ local -a commands
561
+ local -a options
562
+
563
+ _arguments -C \
564
+ \
565
+ "1: :_values 'command' 'info[List roles]' 'add[Add role to a member]' 'remove[Remove role from a member]'" \
566
+ "*::arg:->args"
567
+
568
+ case $state in
569
+ (args)
570
+ case $line[1] in
571
+ (info) _openclaw_message_role_info ;;
572
+ (add) _openclaw_message_role_add ;;
573
+ (remove) _openclaw_message_role_remove ;;
574
+ esac
575
+ ;;
576
+ esac
577
+ }
578
+
579
+ _openclaw_message_channel_info() {
580
+ _arguments -C \
581
+ "(--target -t)"{--target,-t}"[Recipient/channel: E.164 for WhatsApp/Signal, Telegram chat id/@username, Discord/Slack channel/user, or iMessage handle/chat_id]" \
582
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
583
+ "--account[Channel account id (accountId)]" \
584
+ "--json[Output result as JSON]" \
585
+ "--dry-run[Print payload and skip sending]" \
586
+ "--verbose[Verbose logging]"
587
+ }
588
+
589
+ _openclaw_message_channel_list() {
590
+ _arguments -C \
591
+ "--guild-id[Guild id]" \
592
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
593
+ "--account[Channel account id (accountId)]" \
594
+ "--json[Output result as JSON]" \
595
+ "--dry-run[Print payload and skip sending]" \
596
+ "--verbose[Verbose logging]"
597
+ }
598
+
599
+ _openclaw_message_channel() {
600
+ local -a commands
601
+ local -a options
602
+
603
+ _arguments -C \
604
+ \
605
+ "1: :_values 'command' 'info[Fetch channel info]' 'list[List channels]'" \
606
+ "*::arg:->args"
607
+
608
+ case $state in
609
+ (args)
610
+ case $line[1] in
611
+ (info) _openclaw_message_channel_info ;;
612
+ (list) _openclaw_message_channel_list ;;
613
+ esac
614
+ ;;
615
+ esac
616
+ }
617
+
618
+ _openclaw_message_member_info() {
619
+ _arguments -C \
620
+ "--user-id[User id]" \
621
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
622
+ "--account[Channel account id (accountId)]" \
623
+ "--json[Output result as JSON]" \
624
+ "--dry-run[Print payload and skip sending]" \
625
+ "--verbose[Verbose logging]" \
626
+ "--guild-id[Guild id (Discord)]"
627
+ }
628
+
629
+ _openclaw_message_member() {
630
+ local -a commands
631
+ local -a options
632
+
633
+ _arguments -C \
634
+ \
635
+ "1: :_values 'command' 'info[Fetch member info]'" \
636
+ "*::arg:->args"
637
+
638
+ case $state in
639
+ (args)
640
+ case $line[1] in
641
+ (info) _openclaw_message_member_info ;;
642
+ esac
643
+ ;;
644
+ esac
645
+ }
646
+
647
+ _openclaw_message_voice_status() {
648
+ _arguments -C \
649
+ "--guild-id[Guild id]" \
650
+ "--user-id[User id]" \
651
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
652
+ "--account[Channel account id (accountId)]" \
653
+ "--json[Output result as JSON]" \
654
+ "--dry-run[Print payload and skip sending]" \
655
+ "--verbose[Verbose logging]"
656
+ }
657
+
658
+ _openclaw_message_voice() {
659
+ local -a commands
660
+ local -a options
661
+
662
+ _arguments -C \
663
+ \
664
+ "1: :_values 'command' 'status[Fetch voice status]'" \
665
+ "*::arg:->args"
666
+
667
+ case $state in
668
+ (args)
669
+ case $line[1] in
670
+ (status) _openclaw_message_voice_status ;;
671
+ esac
672
+ ;;
673
+ esac
674
+ }
675
+
676
+ _openclaw_message_event_list() {
677
+ _arguments -C \
678
+ "--guild-id[Guild id]" \
679
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
680
+ "--account[Channel account id (accountId)]" \
681
+ "--json[Output result as JSON]" \
682
+ "--dry-run[Print payload and skip sending]" \
683
+ "--verbose[Verbose logging]"
684
+ }
685
+
686
+ _openclaw_message_event_create() {
687
+ _arguments -C \
688
+ "--guild-id[Guild id]" \
689
+ "--event-name[Event name]" \
690
+ "--start-time[Event start time]" \
691
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
692
+ "--account[Channel account id (accountId)]" \
693
+ "--json[Output result as JSON]" \
694
+ "--dry-run[Print payload and skip sending]" \
695
+ "--verbose[Verbose logging]" \
696
+ "--end-time[Event end time]" \
697
+ "--desc[Event description]" \
698
+ "--channel-id[Channel id]" \
699
+ "--location[Event location]" \
700
+ "--event-type[Event type]"
701
+ }
702
+
703
+ _openclaw_message_event() {
704
+ local -a commands
705
+ local -a options
706
+
707
+ _arguments -C \
708
+ \
709
+ "1: :_values 'command' 'list[List scheduled events]' 'create[Create a scheduled event]'" \
710
+ "*::arg:->args"
711
+
712
+ case $state in
713
+ (args)
714
+ case $line[1] in
715
+ (list) _openclaw_message_event_list ;;
716
+ (create) _openclaw_message_event_create ;;
717
+ esac
718
+ ;;
719
+ esac
720
+ }
721
+
722
+ _openclaw_message_timeout() {
723
+ _arguments -C \
724
+ "--guild-id[Guild id]" \
725
+ "--user-id[User id]" \
726
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
727
+ "--account[Channel account id (accountId)]" \
728
+ "--json[Output result as JSON]" \
729
+ "--dry-run[Print payload and skip sending]" \
730
+ "--verbose[Verbose logging]" \
731
+ "--duration-min[Timeout duration minutes]" \
732
+ "--until[Timeout until]" \
733
+ "--reason[Moderation reason]"
734
+ }
735
+
736
+ _openclaw_message_kick() {
737
+ _arguments -C \
738
+ "--guild-id[Guild id]" \
739
+ "--user-id[User id]" \
740
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
741
+ "--account[Channel account id (accountId)]" \
742
+ "--json[Output result as JSON]" \
743
+ "--dry-run[Print payload and skip sending]" \
744
+ "--verbose[Verbose logging]" \
745
+ "--reason[Moderation reason]"
746
+ }
747
+
748
+ _openclaw_message_ban() {
749
+ _arguments -C \
750
+ "--guild-id[Guild id]" \
751
+ "--user-id[User id]" \
752
+ "--channel[Channel: telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon]" \
753
+ "--account[Channel account id (accountId)]" \
754
+ "--json[Output result as JSON]" \
755
+ "--dry-run[Print payload and skip sending]" \
756
+ "--verbose[Verbose logging]" \
757
+ "--reason[Moderation reason]" \
758
+ "--delete-days[Ban delete message days]"
759
+ }
760
+
761
+ _openclaw_message() {
762
+ local -a commands
763
+ local -a options
764
+
765
+ _arguments -C \
766
+ \
767
+ "1: :_values 'command' 'send[Send a message]' 'broadcast[Broadcast a message to multiple targets]' 'poll[Send a poll]' 'react[Add or remove a reaction]' 'reactions[List reactions on a message]' 'read[Read recent messages]' 'edit[Edit a message]' 'delete[Delete a message]' 'pin[Pin a message]' 'unpin[Unpin a message]' 'pins[List pinned messages]' 'permissions[Fetch channel permissions]' 'search[Search Discord messages]' 'thread[Thread actions]' 'emoji[Emoji actions]' 'sticker[Sticker actions]' 'role[Role actions]' 'channel[Channel actions]' 'member[Member actions]' 'voice[Voice actions]' 'event[Event actions]' 'timeout[Timeout a member]' 'kick[Kick a member]' 'ban[Ban a member]'" \
768
+ "*::arg:->args"
769
+
770
+ case $state in
771
+ (args)
772
+ case $line[1] in
773
+ (send) _openclaw_message_send ;;
774
+ (broadcast) _openclaw_message_broadcast ;;
775
+ (poll) _openclaw_message_poll ;;
776
+ (react) _openclaw_message_react ;;
777
+ (reactions) _openclaw_message_reactions ;;
778
+ (read) _openclaw_message_read ;;
779
+ (edit) _openclaw_message_edit ;;
780
+ (delete) _openclaw_message_delete ;;
781
+ (pin) _openclaw_message_pin ;;
782
+ (unpin) _openclaw_message_unpin ;;
783
+ (pins) _openclaw_message_pins ;;
784
+ (permissions) _openclaw_message_permissions ;;
785
+ (search) _openclaw_message_search ;;
786
+ (thread) _openclaw_message_thread ;;
787
+ (emoji) _openclaw_message_emoji ;;
788
+ (sticker) _openclaw_message_sticker ;;
789
+ (role) _openclaw_message_role ;;
790
+ (channel) _openclaw_message_channel ;;
791
+ (member) _openclaw_message_member ;;
792
+ (voice) _openclaw_message_voice ;;
793
+ (event) _openclaw_message_event ;;
794
+ (timeout) _openclaw_message_timeout ;;
795
+ (kick) _openclaw_message_kick ;;
796
+ (ban) _openclaw_message_ban ;;
797
+ esac
798
+ ;;
799
+ esac
800
+ }
801
+
802
+ _openclaw_memory_status() {
803
+ _arguments -C \
804
+ "--agent[Agent id (default: default agent)]" \
805
+ "--json[Print JSON]" \
806
+ "--deep[Probe embedding provider availability]" \
807
+ "--index[Reindex if dirty (implies --deep)]" \
808
+ "--verbose[Verbose logging]"
809
+ }
810
+
811
+ _openclaw_memory_index() {
812
+ _arguments -C \
813
+ "--agent[Agent id (default: default agent)]" \
814
+ "--force[Force full reindex]" \
815
+ "--verbose[Verbose logging]"
816
+ }
817
+
818
+ _openclaw_memory_search() {
819
+ _arguments -C \
820
+ "--agent[Agent id (default: default agent)]" \
821
+ "--max-results[Max results]" \
822
+ "--min-score[Minimum score]" \
823
+ "--json[Print JSON]"
824
+ }
825
+
826
+ _openclaw_memory() {
827
+ local -a commands
828
+ local -a options
829
+
830
+ _arguments -C \
831
+ \
832
+ "1: :_values 'command' 'status[Show memory search index status]' 'index[Reindex memory files]' 'search[Search memory files]'" \
833
+ "*::arg:->args"
834
+
835
+ case $state in
836
+ (args)
837
+ case $line[1] in
838
+ (status) _openclaw_memory_status ;;
839
+ (index) _openclaw_memory_index ;;
840
+ (search) _openclaw_memory_search ;;
841
+ esac
842
+ ;;
843
+ esac
844
+ }
845
+
846
+ _openclaw_agent() {
847
+ _arguments -C \
848
+ "(--message -m)"{--message,-m}"[Message body for the agent]" \
849
+ "(--to -t)"{--to,-t}"[Recipient number in E.164 used to derive the session key]" \
850
+ "--session-id[Use an explicit session id]" \
851
+ "--agent[Agent id (overrides routing bindings)]" \
852
+ "--thinking[Thinking level: off | minimal | low | medium | high]" \
853
+ "--verbose[Persist agent verbose level for the session]" \
854
+ "--channel[Delivery channel: last|telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon (default: whatsapp)]" \
855
+ "--reply-to[Delivery target override (separate from session routing)]" \
856
+ "--reply-channel[Delivery channel override (separate from routing)]" \
857
+ "--reply-account[Delivery account id override]" \
858
+ "--local[Run the embedded agent locally (requires model provider API keys in your shell)]" \
859
+ "--deliver[Send the agent'\''s reply back to the selected channel]" \
860
+ "--json[Output result as JSON]" \
861
+ "--timeout[Override agent command timeout (seconds, default 600 or config value)]"
862
+ }
863
+
864
+ _openclaw_agents_list() {
865
+ _arguments -C \
866
+ "--json[Output JSON instead of text]" \
867
+ "--bindings[Include routing bindings]"
868
+ }
869
+
870
+ _openclaw_agents_add() {
871
+ _arguments -C \
872
+ "--workspace[Workspace directory for the new agent]" \
873
+ "--model[Model id for this agent]" \
874
+ "--agent-dir[Agent state directory for this agent]" \
875
+ "--bind[Route channel binding (repeatable)]" \
876
+ "--non-interactive[Disable prompts; requires --workspace]" \
877
+ "--json[Output JSON summary]"
878
+ }
879
+
880
+ _openclaw_agents_set_identity() {
881
+ _arguments -C \
882
+ "--agent[Agent id to update]" \
883
+ "--workspace[Workspace directory used to locate the agent + IDENTITY.md]" \
884
+ "--identity-file[Explicit IDENTITY.md path to read]" \
885
+ "--from-identity[Read values from IDENTITY.md]" \
886
+ "--name[Identity name]" \
887
+ "--theme[Identity theme]" \
888
+ "--emoji[Identity emoji]" \
889
+ "--avatar[Identity avatar (workspace path, http(s) URL, or data URI)]" \
890
+ "--json[Output JSON summary]"
891
+ }
892
+
893
+ _openclaw_agents_delete() {
894
+ _arguments -C \
895
+ "--force[Skip confirmation]" \
896
+ "--json[Output JSON summary]"
897
+ }
898
+
899
+ _openclaw_agents() {
900
+ local -a commands
901
+ local -a options
902
+
903
+ _arguments -C \
904
+ \
905
+ "1: :_values 'command' 'list[List configured agents]' 'add[Add a new isolated agent]' 'set-identity[Update an agent identity (name/theme/emoji/avatar)]' 'delete[Delete an agent and prune workspace/state]'" \
906
+ "*::arg:->args"
907
+
908
+ case $state in
909
+ (args)
910
+ case $line[1] in
911
+ (list) _openclaw_agents_list ;;
912
+ (add) _openclaw_agents_add ;;
913
+ (set-identity) _openclaw_agents_set_identity ;;
914
+ (delete) _openclaw_agents_delete ;;
915
+ esac
916
+ ;;
917
+ esac
918
+ }
919
+
920
+ _openclaw_status() {
921
+ _arguments -C \
922
+ "--json[Output JSON instead of text]" \
923
+ "--all[Full diagnosis (read-only, pasteable)]" \
924
+ "--usage[Show model provider usage/quota snapshots]" \
925
+ "--deep[Probe channels (WhatsApp Web + Telegram + Discord + Slack + Signal)]" \
926
+ "--timeout[Probe timeout in milliseconds]" \
927
+ "--verbose[Verbose logging]" \
928
+ "--debug[Alias for --verbose]"
929
+ }
930
+
931
+ _openclaw_health() {
932
+ _arguments -C \
933
+ "--json[Output JSON instead of text]" \
934
+ "--timeout[Connection timeout in milliseconds]" \
935
+ "--verbose[Verbose logging]" \
936
+ "--debug[Alias for --verbose]"
937
+ }
938
+
939
+ _openclaw_sessions() {
940
+ _arguments -C \
941
+ "--json[Output as JSON]" \
942
+ "--verbose[Verbose logging]" \
943
+ "--store[Path to session store (default: resolved from config)]" \
944
+ "--active[Only show sessions updated within the past N minutes]"
945
+ }
946
+
947
+ _openclaw_browser_status() {
948
+ _arguments -C \
949
+
950
+ }
951
+
952
+ _openclaw_browser_start() {
953
+ _arguments -C \
954
+
955
+ }
956
+
957
+ _openclaw_browser_stop() {
958
+ _arguments -C \
959
+
960
+ }
961
+
962
+ _openclaw_browser_reset_profile() {
963
+ _arguments -C \
964
+
965
+ }
966
+
967
+ _openclaw_browser_tabs() {
968
+ _arguments -C \
969
+
970
+ }
971
+
972
+ _openclaw_browser_tab_new() {
973
+ _arguments -C \
974
+
975
+ }
976
+
977
+ _openclaw_browser_tab_select() {
978
+ _arguments -C \
979
+
980
+ }
981
+
982
+ _openclaw_browser_tab_close() {
983
+ _arguments -C \
984
+
985
+ }
986
+
987
+ _openclaw_browser_tab() {
988
+ local -a commands
989
+ local -a options
990
+
991
+ _arguments -C \
992
+ \
993
+ "1: :_values 'command' 'new[Open a new tab (about:blank)]' 'select[Focus tab by index (1-based)]' 'close[Close tab by index (1-based); default: first tab]'" \
994
+ "*::arg:->args"
995
+
996
+ case $state in
997
+ (args)
998
+ case $line[1] in
999
+ (new) _openclaw_browser_tab_new ;;
1000
+ (select) _openclaw_browser_tab_select ;;
1001
+ (close) _openclaw_browser_tab_close ;;
1002
+ esac
1003
+ ;;
1004
+ esac
1005
+ }
1006
+
1007
+ _openclaw_browser_open() {
1008
+ _arguments -C \
1009
+
1010
+ }
1011
+
1012
+ _openclaw_browser_focus() {
1013
+ _arguments -C \
1014
+
1015
+ }
1016
+
1017
+ _openclaw_browser_close() {
1018
+ _arguments -C \
1019
+
1020
+ }
1021
+
1022
+ _openclaw_browser_profiles() {
1023
+ _arguments -C \
1024
+
1025
+ }
1026
+
1027
+ _openclaw_browser_create_profile() {
1028
+ _arguments -C \
1029
+ "--name[Profile name (lowercase, numbers, hyphens)]" \
1030
+ "--color[Profile color (hex format, e.g. #0066CC)]" \
1031
+ "--cdp-url[CDP URL for remote Chrome (http/https)]" \
1032
+ "--driver[Profile driver (openclaw|extension). Default: openclaw]"
1033
+ }
1034
+
1035
+ _openclaw_browser_delete_profile() {
1036
+ _arguments -C \
1037
+ "--name[Profile name to delete]"
1038
+ }
1039
+
1040
+ _openclaw_browser_extension_install() {
1041
+ _arguments -C \
1042
+
1043
+ }
1044
+
1045
+ _openclaw_browser_extension_path() {
1046
+ _arguments -C \
1047
+
1048
+ }
1049
+
1050
+ _openclaw_browser_extension() {
1051
+ local -a commands
1052
+ local -a options
1053
+
1054
+ _arguments -C \
1055
+ \
1056
+ "1: :_values 'command' 'install[Install the Chrome extension to a stable local path]' 'path[Print the path to the installed Chrome extension (load unpacked)]'" \
1057
+ "*::arg:->args"
1058
+
1059
+ case $state in
1060
+ (args)
1061
+ case $line[1] in
1062
+ (install) _openclaw_browser_extension_install ;;
1063
+ (path) _openclaw_browser_extension_path ;;
1064
+ esac
1065
+ ;;
1066
+ esac
1067
+ }
1068
+
1069
+ _openclaw_browser_screenshot() {
1070
+ _arguments -C \
1071
+ "--full-page[Capture full scrollable page]" \
1072
+ "--ref[ARIA ref from ai snapshot]" \
1073
+ "--element[CSS selector for element screenshot]" \
1074
+ "--type[Output type (default: png)]"
1075
+ }
1076
+
1077
+ _openclaw_browser_snapshot() {
1078
+ _arguments -C \
1079
+ "--format[Snapshot format (default: ai)]" \
1080
+ "--target-id[CDP target id (or unique prefix)]" \
1081
+ "--limit[Max nodes (default: 500/800)]" \
1082
+ "--mode[Snapshot preset (efficient)]" \
1083
+ "--efficient[Use the efficient snapshot preset]" \
1084
+ "--interactive[Role snapshot: interactive elements only]" \
1085
+ "--compact[Role snapshot: compact output]" \
1086
+ "--depth[Role snapshot: max depth]" \
1087
+ "--selector[Role snapshot: scope to CSS selector]" \
1088
+ "--frame[Role snapshot: scope to an iframe selector]" \
1089
+ "--labels[Include viewport label overlay screenshot]" \
1090
+ "--out[Write snapshot to a file]"
1091
+ }
1092
+
1093
+ _openclaw_browser_navigate() {
1094
+ _arguments -C \
1095
+ "--target-id[CDP target id (or unique prefix)]"
1096
+ }
1097
+
1098
+ _openclaw_browser_resize() {
1099
+ _arguments -C \
1100
+ "--target-id[CDP target id (or unique prefix)]"
1101
+ }
1102
+
1103
+ _openclaw_browser_click() {
1104
+ _arguments -C \
1105
+ "--target-id[CDP target id (or unique prefix)]" \
1106
+ "--double[Double click]" \
1107
+ "--button[Mouse button to use]" \
1108
+ "--modifiers[Comma-separated modifiers (Shift,Alt,Meta)]"
1109
+ }
1110
+
1111
+ _openclaw_browser_type() {
1112
+ _arguments -C \
1113
+ "--submit[Press Enter after typing]" \
1114
+ "--slowly[Type slowly (human-like)]" \
1115
+ "--target-id[CDP target id (or unique prefix)]"
1116
+ }
1117
+
1118
+ _openclaw_browser_press() {
1119
+ _arguments -C \
1120
+ "--target-id[CDP target id (or unique prefix)]"
1121
+ }
1122
+
1123
+ _openclaw_browser_hover() {
1124
+ _arguments -C \
1125
+ "--target-id[CDP target id (or unique prefix)]"
1126
+ }
1127
+
1128
+ _openclaw_browser_scrollintoview() {
1129
+ _arguments -C \
1130
+ "--target-id[CDP target id (or unique prefix)]" \
1131
+ "--timeout-ms[How long to wait for scroll (default: 20000)]"
1132
+ }
1133
+
1134
+ _openclaw_browser_drag() {
1135
+ _arguments -C \
1136
+ "--target-id[CDP target id (or unique prefix)]"
1137
+ }
1138
+
1139
+ _openclaw_browser_select() {
1140
+ _arguments -C \
1141
+ "--target-id[CDP target id (or unique prefix)]"
1142
+ }
1143
+
1144
+ _openclaw_browser_upload() {
1145
+ _arguments -C \
1146
+ "--ref[Ref id from snapshot to click after arming]" \
1147
+ "--input-ref[Ref id for <input type=file> to set directly]" \
1148
+ "--element[CSS selector for <input type=file>]" \
1149
+ "--target-id[CDP target id (or unique prefix)]" \
1150
+ "--timeout-ms[How long to wait for the next file chooser (default: 120000)]"
1151
+ }
1152
+
1153
+ _openclaw_browser_waitfordownload() {
1154
+ _arguments -C \
1155
+ "--target-id[CDP target id (or unique prefix)]" \
1156
+ "--timeout-ms[How long to wait for the next download (default: 120000)]"
1157
+ }
1158
+
1159
+ _openclaw_browser_download() {
1160
+ _arguments -C \
1161
+ "--target-id[CDP target id (or unique prefix)]" \
1162
+ "--timeout-ms[How long to wait for the download to start (default: 120000)]"
1163
+ }
1164
+
1165
+ _openclaw_browser_dialog() {
1166
+ _arguments -C \
1167
+ "--accept[Accept the dialog]" \
1168
+ "--dismiss[Dismiss the dialog]" \
1169
+ "--prompt[Prompt response text]" \
1170
+ "--target-id[CDP target id (or unique prefix)]" \
1171
+ "--timeout-ms[How long to wait for the next dialog (default: 120000)]"
1172
+ }
1173
+
1174
+ _openclaw_browser_fill() {
1175
+ _arguments -C \
1176
+ "--fields[JSON array of field objects]" \
1177
+ "--fields-file[Read JSON array from a file]" \
1178
+ "--target-id[CDP target id (or unique prefix)]"
1179
+ }
1180
+
1181
+ _openclaw_browser_wait() {
1182
+ _arguments -C \
1183
+ "--time[Wait for N milliseconds]" \
1184
+ "--text[Wait for text to appear]" \
1185
+ "--text-gone[Wait for text to disappear]" \
1186
+ "--url[Wait for URL (supports globs like **/dash)]" \
1187
+ "--load[Wait for load state]" \
1188
+ "--fn[Wait for JS condition (passed to waitForFunction)]" \
1189
+ "--timeout-ms[How long to wait for each condition (default: 20000)]" \
1190
+ "--target-id[CDP target id (or unique prefix)]"
1191
+ }
1192
+
1193
+ _openclaw_browser_evaluate() {
1194
+ _arguments -C \
1195
+ "--fn[Function source, e.g. (el) => el.textContent]" \
1196
+ "--ref[Ref from snapshot]" \
1197
+ "--target-id[CDP target id (or unique prefix)]"
1198
+ }
1199
+
1200
+ _openclaw_browser_console() {
1201
+ _arguments -C \
1202
+ "--level[Filter by level (error, warn, info)]" \
1203
+ "--target-id[CDP target id (or unique prefix)]"
1204
+ }
1205
+
1206
+ _openclaw_browser_pdf() {
1207
+ _arguments -C \
1208
+ "--target-id[CDP target id (or unique prefix)]"
1209
+ }
1210
+
1211
+ _openclaw_browser_responsebody() {
1212
+ _arguments -C \
1213
+ "--target-id[CDP target id (or unique prefix)]" \
1214
+ "--timeout-ms[How long to wait for the response (default: 20000)]" \
1215
+ "--max-chars[Max body chars to return (default: 200000)]"
1216
+ }
1217
+
1218
+ _openclaw_browser_highlight() {
1219
+ _arguments -C \
1220
+ "--target-id[CDP target id (or unique prefix)]"
1221
+ }
1222
+
1223
+ _openclaw_browser_errors() {
1224
+ _arguments -C \
1225
+ "--clear[Clear stored errors after reading]" \
1226
+ "--target-id[CDP target id (or unique prefix)]"
1227
+ }
1228
+
1229
+ _openclaw_browser_requests() {
1230
+ _arguments -C \
1231
+ "--filter[Only show URLs that contain this substring]" \
1232
+ "--clear[Clear stored requests after reading]" \
1233
+ "--target-id[CDP target id (or unique prefix)]"
1234
+ }
1235
+
1236
+ _openclaw_browser_trace_start() {
1237
+ _arguments -C \
1238
+ "--target-id[CDP target id (or unique prefix)]" \
1239
+ "--no-screenshots[Disable screenshots]" \
1240
+ "--no-snapshots[Disable snapshots]" \
1241
+ "--sources[Include sources (bigger traces)]"
1242
+ }
1243
+
1244
+ _openclaw_browser_trace_stop() {
1245
+ _arguments -C \
1246
+ "--out[Output path for the trace zip]" \
1247
+ "--target-id[CDP target id (or unique prefix)]"
1248
+ }
1249
+
1250
+ _openclaw_browser_trace() {
1251
+ local -a commands
1252
+ local -a options
1253
+
1254
+ _arguments -C \
1255
+ \
1256
+ "1: :_values 'command' 'start[Start trace recording]' 'stop[Stop trace recording and write a .zip]'" \
1257
+ "*::arg:->args"
1258
+
1259
+ case $state in
1260
+ (args)
1261
+ case $line[1] in
1262
+ (start) _openclaw_browser_trace_start ;;
1263
+ (stop) _openclaw_browser_trace_stop ;;
1264
+ esac
1265
+ ;;
1266
+ esac
1267
+ }
1268
+
1269
+ _openclaw_browser_cookies_set() {
1270
+ _arguments -C \
1271
+ "--url[Cookie URL scope (recommended)]" \
1272
+ "--target-id[CDP target id (or unique prefix)]"
1273
+ }
1274
+
1275
+ _openclaw_browser_cookies_clear() {
1276
+ _arguments -C \
1277
+ "--target-id[CDP target id (or unique prefix)]"
1278
+ }
1279
+
1280
+ _openclaw_browser_cookies() {
1281
+ local -a commands
1282
+ local -a options
1283
+
1284
+ _arguments -C \
1285
+ "--target-id[CDP target id (or unique prefix)]" \
1286
+ "1: :_values 'command' 'set[Set a cookie (requires --url or domain+path)]' 'clear[Clear all cookies]'" \
1287
+ "*::arg:->args"
1288
+
1289
+ case $state in
1290
+ (args)
1291
+ case $line[1] in
1292
+ (set) _openclaw_browser_cookies_set ;;
1293
+ (clear) _openclaw_browser_cookies_clear ;;
1294
+ esac
1295
+ ;;
1296
+ esac
1297
+ }
1298
+
1299
+ _openclaw_browser_storage_local_get() {
1300
+ _arguments -C \
1301
+ "--target-id[CDP target id (or unique prefix)]"
1302
+ }
1303
+
1304
+ _openclaw_browser_storage_local_set() {
1305
+ _arguments -C \
1306
+ "--target-id[CDP target id (or unique prefix)]"
1307
+ }
1308
+
1309
+ _openclaw_browser_storage_local_clear() {
1310
+ _arguments -C \
1311
+ "--target-id[CDP target id (or unique prefix)]"
1312
+ }
1313
+
1314
+ _openclaw_browser_storage_local() {
1315
+ local -a commands
1316
+ local -a options
1317
+
1318
+ _arguments -C \
1319
+ \
1320
+ "1: :_values 'command' 'get[Get localStorage (all keys or one key)]' 'set[Set a localStorage key]' 'clear[Clear all localStorage keys]'" \
1321
+ "*::arg:->args"
1322
+
1323
+ case $state in
1324
+ (args)
1325
+ case $line[1] in
1326
+ (get) _openclaw_browser_storage_local_get ;;
1327
+ (set) _openclaw_browser_storage_local_set ;;
1328
+ (clear) _openclaw_browser_storage_local_clear ;;
1329
+ esac
1330
+ ;;
1331
+ esac
1332
+ }
1333
+
1334
+ _openclaw_browser_storage_session_get() {
1335
+ _arguments -C \
1336
+ "--target-id[CDP target id (or unique prefix)]"
1337
+ }
1338
+
1339
+ _openclaw_browser_storage_session_set() {
1340
+ _arguments -C \
1341
+ "--target-id[CDP target id (or unique prefix)]"
1342
+ }
1343
+
1344
+ _openclaw_browser_storage_session_clear() {
1345
+ _arguments -C \
1346
+ "--target-id[CDP target id (or unique prefix)]"
1347
+ }
1348
+
1349
+ _openclaw_browser_storage_session() {
1350
+ local -a commands
1351
+ local -a options
1352
+
1353
+ _arguments -C \
1354
+ \
1355
+ "1: :_values 'command' 'get[Get sessionStorage (all keys or one key)]' 'set[Set a sessionStorage key]' 'clear[Clear all sessionStorage keys]'" \
1356
+ "*::arg:->args"
1357
+
1358
+ case $state in
1359
+ (args)
1360
+ case $line[1] in
1361
+ (get) _openclaw_browser_storage_session_get ;;
1362
+ (set) _openclaw_browser_storage_session_set ;;
1363
+ (clear) _openclaw_browser_storage_session_clear ;;
1364
+ esac
1365
+ ;;
1366
+ esac
1367
+ }
1368
+
1369
+ _openclaw_browser_storage() {
1370
+ local -a commands
1371
+ local -a options
1372
+
1373
+ _arguments -C \
1374
+ \
1375
+ "1: :_values 'command' 'local[localStorage commands]' 'session[sessionStorage commands]'" \
1376
+ "*::arg:->args"
1377
+
1378
+ case $state in
1379
+ (args)
1380
+ case $line[1] in
1381
+ (local) _openclaw_browser_storage_local ;;
1382
+ (session) _openclaw_browser_storage_session ;;
1383
+ esac
1384
+ ;;
1385
+ esac
1386
+ }
1387
+
1388
+ _openclaw_browser_set_viewport() {
1389
+ _arguments -C \
1390
+ "--target-id[CDP target id (or unique prefix)]"
1391
+ }
1392
+
1393
+ _openclaw_browser_set_offline() {
1394
+ _arguments -C \
1395
+ "--target-id[CDP target id (or unique prefix)]"
1396
+ }
1397
+
1398
+ _openclaw_browser_set_headers() {
1399
+ _arguments -C \
1400
+ "--json[JSON object of headers]" \
1401
+ "--target-id[CDP target id (or unique prefix)]"
1402
+ }
1403
+
1404
+ _openclaw_browser_set_credentials() {
1405
+ _arguments -C \
1406
+ "--clear[Clear credentials]" \
1407
+ "--target-id[CDP target id (or unique prefix)]"
1408
+ }
1409
+
1410
+ _openclaw_browser_set_geo() {
1411
+ _arguments -C \
1412
+ "--clear[Clear geolocation + permissions]" \
1413
+ "--accuracy[Accuracy in meters]" \
1414
+ "--origin[Origin to grant permissions for]" \
1415
+ "--target-id[CDP target id (or unique prefix)]"
1416
+ }
1417
+
1418
+ _openclaw_browser_set_media() {
1419
+ _arguments -C \
1420
+ "--target-id[CDP target id (or unique prefix)]"
1421
+ }
1422
+
1423
+ _openclaw_browser_set_timezone() {
1424
+ _arguments -C \
1425
+ "--target-id[CDP target id (or unique prefix)]"
1426
+ }
1427
+
1428
+ _openclaw_browser_set_locale() {
1429
+ _arguments -C \
1430
+ "--target-id[CDP target id (or unique prefix)]"
1431
+ }
1432
+
1433
+ _openclaw_browser_set_device() {
1434
+ _arguments -C \
1435
+ "--target-id[CDP target id (or unique prefix)]"
1436
+ }
1437
+
1438
+ _openclaw_browser_set() {
1439
+ local -a commands
1440
+ local -a options
1441
+
1442
+ _arguments -C \
1443
+ \
1444
+ "1: :_values 'command' 'viewport[Set viewport size (alias for resize)]' 'offline[Toggle offline mode]' 'headers[Set extra HTTP headers (JSON object)]' 'credentials[Set HTTP basic auth credentials]' 'geo[Set geolocation (and grant permission)]' 'media[Emulate prefers-color-scheme]' 'timezone[Override timezone (CDP)]' 'locale[Override locale (CDP)]' 'device[Apply a Playwright device descriptor (e.g. "iPhone 14")]'" \
1445
+ "*::arg:->args"
1446
+
1447
+ case $state in
1448
+ (args)
1449
+ case $line[1] in
1450
+ (viewport) _openclaw_browser_set_viewport ;;
1451
+ (offline) _openclaw_browser_set_offline ;;
1452
+ (headers) _openclaw_browser_set_headers ;;
1453
+ (credentials) _openclaw_browser_set_credentials ;;
1454
+ (geo) _openclaw_browser_set_geo ;;
1455
+ (media) _openclaw_browser_set_media ;;
1456
+ (timezone) _openclaw_browser_set_timezone ;;
1457
+ (locale) _openclaw_browser_set_locale ;;
1458
+ (device) _openclaw_browser_set_device ;;
1459
+ esac
1460
+ ;;
1461
+ esac
1462
+ }
1463
+
1464
+ _openclaw_browser() {
1465
+ local -a commands
1466
+ local -a options
1467
+
1468
+ _arguments -C \
1469
+ "--browser-profile[Browser profile name (default from config)]" \
1470
+ "--json[Output machine-readable JSON]" \
1471
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
1472
+ "--token[Gateway token (if required)]" \
1473
+ "--timeout[Timeout in ms]" \
1474
+ "--expect-final[Wait for final response (agent)]" \
1475
+ "1: :_values 'command' 'status[Show browser status]' 'start[Start the browser (no-op if already running)]' 'stop[Stop the browser (best-effort)]' 'reset-profile[Reset browser profile (moves it to Trash)]' 'tabs[List open tabs]' 'tab[Tab shortcuts (index-based)]' 'open[Open a URL in a new tab]' 'focus[Focus a tab by target id (or unique prefix)]' 'close[Close a tab (target id optional)]' 'profiles[List all browser profiles]' 'create-profile[Create a new browser profile]' 'delete-profile[Delete a browser profile]' 'extension[Chrome extension helpers]' 'screenshot[Capture a screenshot (MEDIA:<path>)]' 'snapshot[Capture a snapshot (default: ai; aria is the accessibility tree)]' 'navigate[Navigate the current tab to a URL]' 'resize[Resize the viewport]' 'click[Click an element by ref from snapshot]' 'type[Type into an element by ref from snapshot]' 'press[Press a key]' 'hover[Hover an element by ai ref]' 'scrollintoview[Scroll an element into view by ref from snapshot]' 'drag[Drag from one ref to another]' 'select[Select option(s) in a select element]' 'upload[Arm file upload for the next file chooser]' 'waitfordownload[Wait for the next download (and save it)]' 'download[Click a ref and save the resulting download]' 'dialog[Arm the next modal dialog (alert/confirm/prompt)]' 'fill[Fill a form with JSON field descriptors]' 'wait[Wait for time, selector, URL, load state, or JS conditions]' 'evaluate[Evaluate a function against the page or a ref]' 'console[Get recent console messages]' 'pdf[Save page as PDF]' 'responsebody[Wait for a network response and return its body]' 'highlight[Highlight an element by ref]' 'errors[Get recent page errors]' 'requests[Get recent network requests (best-effort)]' 'trace[Record a Playwright trace]' 'cookies[Read/write cookies]' 'storage[Read/write localStorage/sessionStorage]' 'set[Browser environment settings]'" \
1476
+ "*::arg:->args"
1477
+
1478
+ case $state in
1479
+ (args)
1480
+ case $line[1] in
1481
+ (status) _openclaw_browser_status ;;
1482
+ (start) _openclaw_browser_start ;;
1483
+ (stop) _openclaw_browser_stop ;;
1484
+ (reset-profile) _openclaw_browser_reset_profile ;;
1485
+ (tabs) _openclaw_browser_tabs ;;
1486
+ (tab) _openclaw_browser_tab ;;
1487
+ (open) _openclaw_browser_open ;;
1488
+ (focus) _openclaw_browser_focus ;;
1489
+ (close) _openclaw_browser_close ;;
1490
+ (profiles) _openclaw_browser_profiles ;;
1491
+ (create-profile) _openclaw_browser_create_profile ;;
1492
+ (delete-profile) _openclaw_browser_delete_profile ;;
1493
+ (extension) _openclaw_browser_extension ;;
1494
+ (screenshot) _openclaw_browser_screenshot ;;
1495
+ (snapshot) _openclaw_browser_snapshot ;;
1496
+ (navigate) _openclaw_browser_navigate ;;
1497
+ (resize) _openclaw_browser_resize ;;
1498
+ (click) _openclaw_browser_click ;;
1499
+ (type) _openclaw_browser_type ;;
1500
+ (press) _openclaw_browser_press ;;
1501
+ (hover) _openclaw_browser_hover ;;
1502
+ (scrollintoview) _openclaw_browser_scrollintoview ;;
1503
+ (drag) _openclaw_browser_drag ;;
1504
+ (select) _openclaw_browser_select ;;
1505
+ (upload) _openclaw_browser_upload ;;
1506
+ (waitfordownload) _openclaw_browser_waitfordownload ;;
1507
+ (download) _openclaw_browser_download ;;
1508
+ (dialog) _openclaw_browser_dialog ;;
1509
+ (fill) _openclaw_browser_fill ;;
1510
+ (wait) _openclaw_browser_wait ;;
1511
+ (evaluate) _openclaw_browser_evaluate ;;
1512
+ (console) _openclaw_browser_console ;;
1513
+ (pdf) _openclaw_browser_pdf ;;
1514
+ (responsebody) _openclaw_browser_responsebody ;;
1515
+ (highlight) _openclaw_browser_highlight ;;
1516
+ (errors) _openclaw_browser_errors ;;
1517
+ (requests) _openclaw_browser_requests ;;
1518
+ (trace) _openclaw_browser_trace ;;
1519
+ (cookies) _openclaw_browser_cookies ;;
1520
+ (storage) _openclaw_browser_storage ;;
1521
+ (set) _openclaw_browser_set ;;
1522
+ esac
1523
+ ;;
1524
+ esac
1525
+ }
1526
+
1527
+ _openclaw_completion() {
1528
+ _arguments -C \
1529
+ "(--shell -s)"{--shell,-s}"[Shell to generate completion for (default: zsh)]" \
1530
+ "(--install -i)"{--install,-i}"[Install completion script to shell profile]" \
1531
+ "--write-state[Write completion scripts to $OPENCLAW_STATE_DIR/completions (no stdout)]" \
1532
+ "(--yes -y)"{--yes,-y}"[Skip confirmation (non-interactive)]"
1533
+ }
1534
+
1535
+ _openclaw_acp_client() {
1536
+ _arguments -C \
1537
+ "--cwd[Working directory for the ACP session]" \
1538
+ "--server[ACP server command (default: openclaw)]" \
1539
+ "--server-args[Extra arguments for the ACP server]" \
1540
+ "--server-verbose[Enable verbose logging on the ACP server]" \
1541
+ "(--verbose -v)"{--verbose,-v}"[Verbose client logging]"
1542
+ }
1543
+
1544
+ _openclaw_acp() {
1545
+ local -a commands
1546
+ local -a options
1547
+
1548
+ _arguments -C \
1549
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
1550
+ "--token[Gateway token (if required)]" \
1551
+ "--password[Gateway password (if required)]" \
1552
+ "--session[Default session key (e.g. agent:main:main)]" \
1553
+ "--session-label[Default session label to resolve]" \
1554
+ "--require-existing[Fail if the session key/label does not exist]" \
1555
+ "--reset-session[Reset the session key before first use]" \
1556
+ "--no-prefix-cwd[Do not prefix prompts with the working directory]" \
1557
+ "(--verbose -v)"{--verbose,-v}"[Verbose logging to stderr]" \
1558
+ "1: :_values 'command' 'client[Run an interactive ACP client against the local ACP bridge]'" \
1559
+ "*::arg:->args"
1560
+
1561
+ case $state in
1562
+ (args)
1563
+ case $line[1] in
1564
+ (client) _openclaw_acp_client ;;
1565
+ esac
1566
+ ;;
1567
+ esac
1568
+ }
1569
+
1570
+ _openclaw_gateway_run() {
1571
+ _arguments -C \
1572
+ "--port[Port for the gateway WebSocket]" \
1573
+ "--bind[Bind mode (\"loopback\"|\"lan\"|\"tailnet\"|\"auto\"|\"custom\"). Defaults to config gateway.bind (or loopback).]" \
1574
+ "--token[Shared token required in connect.params.auth.token (default: OPENCLAW_GATEWAY_TOKEN env if set)]" \
1575
+ "--auth[Gateway auth mode (\"token\"|\"password\")]" \
1576
+ "--password[Password for auth mode=password]" \
1577
+ "--tailscale[Tailscale exposure mode (\"off\"|\"serve\"|\"funnel\")]" \
1578
+ "--tailscale-reset-on-exit[Reset Tailscale serve/funnel configuration on shutdown]" \
1579
+ "--allow-unconfigured[Allow gateway start without gateway.mode=local in config]" \
1580
+ "--dev[Create a dev config + workspace if missing (no BOOTSTRAP.md)]" \
1581
+ "--reset[Reset dev config + credentials + sessions + workspace (requires --dev)]" \
1582
+ "--force[Kill any existing listener on the target port before starting]" \
1583
+ "--verbose[Verbose logging to stdout/stderr]" \
1584
+ "--claude-cli-logs[Only show claude-cli logs in the console (includes stdout/stderr)]" \
1585
+ "--ws-log[WebSocket log style (\"auto\"|\"full\"|\"compact\")]" \
1586
+ "--compact[Alias for \"--ws-log compact\"]" \
1587
+ "--raw-stream[Log raw model stream events to jsonl]" \
1588
+ "--raw-stream-path[Raw stream jsonl path]"
1589
+ }
1590
+
1591
+ _openclaw_gateway_status() {
1592
+ _arguments -C \
1593
+ "--url[Gateway WebSocket URL (defaults to config/remote/local)]" \
1594
+ "--token[Gateway token (if required)]" \
1595
+ "--password[Gateway password (password auth)]" \
1596
+ "--timeout[Timeout in ms]" \
1597
+ "--no-probe[Skip RPC probe]" \
1598
+ "--deep[Scan system-level services]" \
1599
+ "--json[Output JSON]"
1600
+ }
1601
+
1602
+ _openclaw_gateway_install() {
1603
+ _arguments -C \
1604
+ "--port[Gateway port]" \
1605
+ "--runtime[Daemon runtime (node|bun). Default: node]" \
1606
+ "--token[Gateway token (token auth)]" \
1607
+ "--force[Reinstall/overwrite if already installed]" \
1608
+ "--json[Output JSON]"
1609
+ }
1610
+
1611
+ _openclaw_gateway_uninstall() {
1612
+ _arguments -C \
1613
+ "--json[Output JSON]"
1614
+ }
1615
+
1616
+ _openclaw_gateway_start() {
1617
+ _arguments -C \
1618
+ "--json[Output JSON]"
1619
+ }
1620
+
1621
+ _openclaw_gateway_stop() {
1622
+ _arguments -C \
1623
+ "--json[Output JSON]"
1624
+ }
1625
+
1626
+ _openclaw_gateway_restart() {
1627
+ _arguments -C \
1628
+ "--json[Output JSON]"
1629
+ }
1630
+
1631
+ _openclaw_gateway_call() {
1632
+ _arguments -C \
1633
+ "--params[JSON object string for params]" \
1634
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
1635
+ "--token[Gateway token (if required)]" \
1636
+ "--password[Gateway password (password auth)]" \
1637
+ "--timeout[Timeout in ms]" \
1638
+ "--expect-final[Wait for final response (agent)]" \
1639
+ "--json[Output JSON]"
1640
+ }
1641
+
1642
+ _openclaw_gateway_usage_cost() {
1643
+ _arguments -C \
1644
+ "--days[Number of days to include]" \
1645
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
1646
+ "--token[Gateway token (if required)]" \
1647
+ "--password[Gateway password (password auth)]" \
1648
+ "--timeout[Timeout in ms]" \
1649
+ "--expect-final[Wait for final response (agent)]" \
1650
+ "--json[Output JSON]"
1651
+ }
1652
+
1653
+ _openclaw_gateway_health() {
1654
+ _arguments -C \
1655
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
1656
+ "--token[Gateway token (if required)]" \
1657
+ "--password[Gateway password (password auth)]" \
1658
+ "--timeout[Timeout in ms]" \
1659
+ "--expect-final[Wait for final response (agent)]" \
1660
+ "--json[Output JSON]"
1661
+ }
1662
+
1663
+ _openclaw_gateway_probe() {
1664
+ _arguments -C \
1665
+ "--url[Explicit Gateway WebSocket URL (still probes localhost)]" \
1666
+ "--ssh[SSH target for remote gateway tunnel (user@host or user@host:port)]" \
1667
+ "--ssh-identity[SSH identity file path]" \
1668
+ "--ssh-auto[Try to derive an SSH target from Bonjour discovery]" \
1669
+ "--token[Gateway token (applies to all probes)]" \
1670
+ "--password[Gateway password (applies to all probes)]" \
1671
+ "--timeout[Overall probe budget in ms]" \
1672
+ "--json[Output JSON]"
1673
+ }
1674
+
1675
+ _openclaw_gateway_discover() {
1676
+ _arguments -C \
1677
+ "--timeout[Per-command timeout in ms]" \
1678
+ "--json[Output JSON]"
1679
+ }
1680
+
1681
+ _openclaw_gateway() {
1682
+ local -a commands
1683
+ local -a options
1684
+
1685
+ _arguments -C \
1686
+ "--port[Port for the gateway WebSocket]" \
1687
+ "--bind[Bind mode (\"loopback\"|\"lan\"|\"tailnet\"|\"auto\"|\"custom\"). Defaults to config gateway.bind (or loopback).]" \
1688
+ "--token[Shared token required in connect.params.auth.token (default: OPENCLAW_GATEWAY_TOKEN env if set)]" \
1689
+ "--auth[Gateway auth mode (\"token\"|\"password\")]" \
1690
+ "--password[Password for auth mode=password]" \
1691
+ "--tailscale[Tailscale exposure mode (\"off\"|\"serve\"|\"funnel\")]" \
1692
+ "--tailscale-reset-on-exit[Reset Tailscale serve/funnel configuration on shutdown]" \
1693
+ "--allow-unconfigured[Allow gateway start without gateway.mode=local in config]" \
1694
+ "--dev[Create a dev config + workspace if missing (no BOOTSTRAP.md)]" \
1695
+ "--reset[Reset dev config + credentials + sessions + workspace (requires --dev)]" \
1696
+ "--force[Kill any existing listener on the target port before starting]" \
1697
+ "--verbose[Verbose logging to stdout/stderr]" \
1698
+ "--claude-cli-logs[Only show claude-cli logs in the console (includes stdout/stderr)]" \
1699
+ "--ws-log[WebSocket log style (\"auto\"|\"full\"|\"compact\")]" \
1700
+ "--compact[Alias for \"--ws-log compact\"]" \
1701
+ "--raw-stream[Log raw model stream events to jsonl]" \
1702
+ "--raw-stream-path[Raw stream jsonl path]" \
1703
+ "1: :_values 'command' 'run[Run the WebSocket Gateway (foreground)]' 'status[Show gateway service status + probe the Gateway]' 'install[Install the Gateway service (launchd/systemd/schtasks)]' 'uninstall[Uninstall the Gateway service (launchd/systemd/schtasks)]' 'start[Start the Gateway service (launchd/systemd/schtasks)]' 'stop[Stop the Gateway service (launchd/systemd/schtasks)]' 'restart[Restart the Gateway service (launchd/systemd/schtasks)]' 'call[Call a Gateway method]' 'usage-cost[Fetch usage cost summary from session logs]' 'health[Fetch Gateway health]' 'probe[Show gateway reachability + discovery + health + status summary (local + remote)]' 'discover[Discover gateways via Bonjour (local + wide-area if configured)]'" \
1704
+ "*::arg:->args"
1705
+
1706
+ case $state in
1707
+ (args)
1708
+ case $line[1] in
1709
+ (run) _openclaw_gateway_run ;;
1710
+ (status) _openclaw_gateway_status ;;
1711
+ (install) _openclaw_gateway_install ;;
1712
+ (uninstall) _openclaw_gateway_uninstall ;;
1713
+ (start) _openclaw_gateway_start ;;
1714
+ (stop) _openclaw_gateway_stop ;;
1715
+ (restart) _openclaw_gateway_restart ;;
1716
+ (call) _openclaw_gateway_call ;;
1717
+ (usage-cost) _openclaw_gateway_usage_cost ;;
1718
+ (health) _openclaw_gateway_health ;;
1719
+ (probe) _openclaw_gateway_probe ;;
1720
+ (discover) _openclaw_gateway_discover ;;
1721
+ esac
1722
+ ;;
1723
+ esac
1724
+ }
1725
+
1726
+ _openclaw_daemon_status() {
1727
+ _arguments -C \
1728
+ "--url[Gateway WebSocket URL (defaults to config/remote/local)]" \
1729
+ "--token[Gateway token (if required)]" \
1730
+ "--password[Gateway password (password auth)]" \
1731
+ "--timeout[Timeout in ms]" \
1732
+ "--no-probe[Skip RPC probe]" \
1733
+ "--deep[Scan system-level services]" \
1734
+ "--json[Output JSON]"
1735
+ }
1736
+
1737
+ _openclaw_daemon_install() {
1738
+ _arguments -C \
1739
+ "--port[Gateway port]" \
1740
+ "--runtime[Daemon runtime (node|bun). Default: node]" \
1741
+ "--token[Gateway token (token auth)]" \
1742
+ "--force[Reinstall/overwrite if already installed]" \
1743
+ "--json[Output JSON]"
1744
+ }
1745
+
1746
+ _openclaw_daemon_uninstall() {
1747
+ _arguments -C \
1748
+ "--json[Output JSON]"
1749
+ }
1750
+
1751
+ _openclaw_daemon_start() {
1752
+ _arguments -C \
1753
+ "--json[Output JSON]"
1754
+ }
1755
+
1756
+ _openclaw_daemon_stop() {
1757
+ _arguments -C \
1758
+ "--json[Output JSON]"
1759
+ }
1760
+
1761
+ _openclaw_daemon_restart() {
1762
+ _arguments -C \
1763
+ "--json[Output JSON]"
1764
+ }
1765
+
1766
+ _openclaw_daemon() {
1767
+ local -a commands
1768
+ local -a options
1769
+
1770
+ _arguments -C \
1771
+ \
1772
+ "1: :_values 'command' 'status[Show service install status + probe the Gateway]' 'install[Install the Gateway service (launchd/systemd/schtasks)]' 'uninstall[Uninstall the Gateway service (launchd/systemd/schtasks)]' 'start[Start the Gateway service (launchd/systemd/schtasks)]' 'stop[Stop the Gateway service (launchd/systemd/schtasks)]' 'restart[Restart the Gateway service (launchd/systemd/schtasks)]'" \
1773
+ "*::arg:->args"
1774
+
1775
+ case $state in
1776
+ (args)
1777
+ case $line[1] in
1778
+ (status) _openclaw_daemon_status ;;
1779
+ (install) _openclaw_daemon_install ;;
1780
+ (uninstall) _openclaw_daemon_uninstall ;;
1781
+ (start) _openclaw_daemon_start ;;
1782
+ (stop) _openclaw_daemon_stop ;;
1783
+ (restart) _openclaw_daemon_restart ;;
1784
+ esac
1785
+ ;;
1786
+ esac
1787
+ }
1788
+
1789
+ _openclaw_logs() {
1790
+ _arguments -C \
1791
+ "--limit[Max lines to return]" \
1792
+ "--max-bytes[Max bytes to read]" \
1793
+ "--follow[Follow log output]" \
1794
+ "--interval[Polling interval in ms]" \
1795
+ "--json[Emit JSON log lines]" \
1796
+ "--plain[Plain text output (no ANSI styling)]" \
1797
+ "--no-color[Disable ANSI colors]" \
1798
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
1799
+ "--token[Gateway token (if required)]" \
1800
+ "--timeout[Timeout in ms]" \
1801
+ "--expect-final[Wait for final response (agent)]"
1802
+ }
1803
+
1804
+ _openclaw_system_event() {
1805
+ _arguments -C \
1806
+ "--text[System event text]" \
1807
+ "--mode[Wake mode (now|next-heartbeat)]" \
1808
+ "--json[Output JSON]" \
1809
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
1810
+ "--token[Gateway token (if required)]" \
1811
+ "--timeout[Timeout in ms]" \
1812
+ "--expect-final[Wait for final response (agent)]"
1813
+ }
1814
+
1815
+ _openclaw_system_heartbeat_last() {
1816
+ _arguments -C \
1817
+ "--json[Output JSON]" \
1818
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
1819
+ "--token[Gateway token (if required)]" \
1820
+ "--timeout[Timeout in ms]" \
1821
+ "--expect-final[Wait for final response (agent)]"
1822
+ }
1823
+
1824
+ _openclaw_system_heartbeat_enable() {
1825
+ _arguments -C \
1826
+ "--json[Output JSON]" \
1827
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
1828
+ "--token[Gateway token (if required)]" \
1829
+ "--timeout[Timeout in ms]" \
1830
+ "--expect-final[Wait for final response (agent)]"
1831
+ }
1832
+
1833
+ _openclaw_system_heartbeat_disable() {
1834
+ _arguments -C \
1835
+ "--json[Output JSON]" \
1836
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
1837
+ "--token[Gateway token (if required)]" \
1838
+ "--timeout[Timeout in ms]" \
1839
+ "--expect-final[Wait for final response (agent)]"
1840
+ }
1841
+
1842
+ _openclaw_system_heartbeat() {
1843
+ local -a commands
1844
+ local -a options
1845
+
1846
+ _arguments -C \
1847
+ \
1848
+ "1: :_values 'command' 'last[Show the last heartbeat event]' 'enable[Enable heartbeats]' 'disable[Disable heartbeats]'" \
1849
+ "*::arg:->args"
1850
+
1851
+ case $state in
1852
+ (args)
1853
+ case $line[1] in
1854
+ (last) _openclaw_system_heartbeat_last ;;
1855
+ (enable) _openclaw_system_heartbeat_enable ;;
1856
+ (disable) _openclaw_system_heartbeat_disable ;;
1857
+ esac
1858
+ ;;
1859
+ esac
1860
+ }
1861
+
1862
+ _openclaw_system_presence() {
1863
+ _arguments -C \
1864
+ "--json[Output JSON]" \
1865
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
1866
+ "--token[Gateway token (if required)]" \
1867
+ "--timeout[Timeout in ms]" \
1868
+ "--expect-final[Wait for final response (agent)]"
1869
+ }
1870
+
1871
+ _openclaw_system() {
1872
+ local -a commands
1873
+ local -a options
1874
+
1875
+ _arguments -C \
1876
+ \
1877
+ "1: :_values 'command' 'event[Enqueue a system event and optionally trigger a heartbeat]' 'heartbeat[Heartbeat controls]' 'presence[List system presence entries]'" \
1878
+ "*::arg:->args"
1879
+
1880
+ case $state in
1881
+ (args)
1882
+ case $line[1] in
1883
+ (event) _openclaw_system_event ;;
1884
+ (heartbeat) _openclaw_system_heartbeat ;;
1885
+ (presence) _openclaw_system_presence ;;
1886
+ esac
1887
+ ;;
1888
+ esac
1889
+ }
1890
+
1891
+ _openclaw_models_list() {
1892
+ _arguments -C \
1893
+ "--all[Show full model catalog]" \
1894
+ "--local[Filter to local models]" \
1895
+ "--provider[Filter by provider]" \
1896
+ "--json[Output JSON]" \
1897
+ "--plain[Plain line output]"
1898
+ }
1899
+
1900
+ _openclaw_models_status() {
1901
+ _arguments -C \
1902
+ "--json[Output JSON]" \
1903
+ "--plain[Plain output]" \
1904
+ "--check[Exit non-zero if auth is expiring/expired (1=expired/missing, 2=expiring)]" \
1905
+ "--probe[Probe configured provider auth (live)]" \
1906
+ "--probe-provider[Only probe a single provider]" \
1907
+ "--probe-profile[Only probe specific auth profile ids (repeat or comma-separated)]" \
1908
+ "--probe-timeout[Per-probe timeout in ms]" \
1909
+ "--probe-concurrency[Concurrent probes]" \
1910
+ "--probe-max-tokens[Probe max tokens (best-effort)]" \
1911
+ "--agent[Agent id to inspect (overrides OPENCLAW_AGENT_DIR/PI_CODING_AGENT_DIR)]"
1912
+ }
1913
+
1914
+ _openclaw_models_set() {
1915
+ _arguments -C \
1916
+
1917
+ }
1918
+
1919
+ _openclaw_models_set_image() {
1920
+ _arguments -C \
1921
+
1922
+ }
1923
+
1924
+ _openclaw_models_aliases_list() {
1925
+ _arguments -C \
1926
+ "--json[Output JSON]" \
1927
+ "--plain[Plain output]"
1928
+ }
1929
+
1930
+ _openclaw_models_aliases_add() {
1931
+ _arguments -C \
1932
+
1933
+ }
1934
+
1935
+ _openclaw_models_aliases_remove() {
1936
+ _arguments -C \
1937
+
1938
+ }
1939
+
1940
+ _openclaw_models_aliases() {
1941
+ local -a commands
1942
+ local -a options
1943
+
1944
+ _arguments -C \
1945
+ \
1946
+ "1: :_values 'command' 'list[List model aliases]' 'add[Add or update a model alias]' 'remove[Remove a model alias]'" \
1947
+ "*::arg:->args"
1948
+
1949
+ case $state in
1950
+ (args)
1951
+ case $line[1] in
1952
+ (list) _openclaw_models_aliases_list ;;
1953
+ (add) _openclaw_models_aliases_add ;;
1954
+ (remove) _openclaw_models_aliases_remove ;;
1955
+ esac
1956
+ ;;
1957
+ esac
1958
+ }
1959
+
1960
+ _openclaw_models_fallbacks_list() {
1961
+ _arguments -C \
1962
+ "--json[Output JSON]" \
1963
+ "--plain[Plain output]"
1964
+ }
1965
+
1966
+ _openclaw_models_fallbacks_add() {
1967
+ _arguments -C \
1968
+
1969
+ }
1970
+
1971
+ _openclaw_models_fallbacks_remove() {
1972
+ _arguments -C \
1973
+
1974
+ }
1975
+
1976
+ _openclaw_models_fallbacks_clear() {
1977
+ _arguments -C \
1978
+
1979
+ }
1980
+
1981
+ _openclaw_models_fallbacks() {
1982
+ local -a commands
1983
+ local -a options
1984
+
1985
+ _arguments -C \
1986
+ \
1987
+ "1: :_values 'command' 'list[List fallback models]' 'add[Add a fallback model]' 'remove[Remove a fallback model]' 'clear[Clear all fallback models]'" \
1988
+ "*::arg:->args"
1989
+
1990
+ case $state in
1991
+ (args)
1992
+ case $line[1] in
1993
+ (list) _openclaw_models_fallbacks_list ;;
1994
+ (add) _openclaw_models_fallbacks_add ;;
1995
+ (remove) _openclaw_models_fallbacks_remove ;;
1996
+ (clear) _openclaw_models_fallbacks_clear ;;
1997
+ esac
1998
+ ;;
1999
+ esac
2000
+ }
2001
+
2002
+ _openclaw_models_image_fallbacks_list() {
2003
+ _arguments -C \
2004
+ "--json[Output JSON]" \
2005
+ "--plain[Plain output]"
2006
+ }
2007
+
2008
+ _openclaw_models_image_fallbacks_add() {
2009
+ _arguments -C \
2010
+
2011
+ }
2012
+
2013
+ _openclaw_models_image_fallbacks_remove() {
2014
+ _arguments -C \
2015
+
2016
+ }
2017
+
2018
+ _openclaw_models_image_fallbacks_clear() {
2019
+ _arguments -C \
2020
+
2021
+ }
2022
+
2023
+ _openclaw_models_image_fallbacks() {
2024
+ local -a commands
2025
+ local -a options
2026
+
2027
+ _arguments -C \
2028
+ \
2029
+ "1: :_values 'command' 'list[List image fallback models]' 'add[Add an image fallback model]' 'remove[Remove an image fallback model]' 'clear[Clear all image fallback models]'" \
2030
+ "*::arg:->args"
2031
+
2032
+ case $state in
2033
+ (args)
2034
+ case $line[1] in
2035
+ (list) _openclaw_models_image_fallbacks_list ;;
2036
+ (add) _openclaw_models_image_fallbacks_add ;;
2037
+ (remove) _openclaw_models_image_fallbacks_remove ;;
2038
+ (clear) _openclaw_models_image_fallbacks_clear ;;
2039
+ esac
2040
+ ;;
2041
+ esac
2042
+ }
2043
+
2044
+ _openclaw_models_scan() {
2045
+ _arguments -C \
2046
+ "--min-params[Minimum parameter size (billions)]" \
2047
+ "--max-age-days[Skip models older than N days]" \
2048
+ "--provider[Filter by provider prefix]" \
2049
+ "--max-candidates[Max fallback candidates]" \
2050
+ "--timeout[Per-probe timeout in ms]" \
2051
+ "--concurrency[Probe concurrency]" \
2052
+ "--no-probe[Skip live probes; list free candidates only]" \
2053
+ "--yes[Accept defaults without prompting]" \
2054
+ "--no-input[Disable prompts (use defaults)]" \
2055
+ "--set-default[Set agents.defaults.model to the first selection]" \
2056
+ "--set-image[Set agents.defaults.imageModel to the first image selection]" \
2057
+ "--json[Output JSON]"
2058
+ }
2059
+
2060
+ _openclaw_models_auth_add() {
2061
+ _arguments -C \
2062
+
2063
+ }
2064
+
2065
+ _openclaw_models_auth_login() {
2066
+ _arguments -C \
2067
+ "--provider[Provider id registered by a plugin]" \
2068
+ "--method[Provider auth method id]" \
2069
+ "--set-default[Apply the provider'\''s default model recommendation]"
2070
+ }
2071
+
2072
+ _openclaw_models_auth_setup_token() {
2073
+ _arguments -C \
2074
+ "--provider[Provider id (default: anthropic)]" \
2075
+ "--yes[Skip confirmation]"
2076
+ }
2077
+
2078
+ _openclaw_models_auth_paste_token() {
2079
+ _arguments -C \
2080
+ "--provider[Provider id (e.g. anthropic)]" \
2081
+ "--profile-id[Auth profile id (default: <provider>:manual)]" \
2082
+ "--expires-in[Optional expiry duration (e.g. 365d, 12h). Stored as absolute expiresAt.]"
2083
+ }
2084
+
2085
+ _openclaw_models_auth_login_github_copilot() {
2086
+ _arguments -C \
2087
+ "--profile-id[Auth profile id (default: github-copilot:github)]" \
2088
+ "--yes[Overwrite existing profile without prompting]"
2089
+ }
2090
+
2091
+ _openclaw_models_auth_order_get() {
2092
+ _arguments -C \
2093
+ "--provider[Provider id (e.g. anthropic)]" \
2094
+ "--agent[Agent id (default: configured default agent)]" \
2095
+ "--json[Output JSON]"
2096
+ }
2097
+
2098
+ _openclaw_models_auth_order_set() {
2099
+ _arguments -C \
2100
+ "--provider[Provider id (e.g. anthropic)]" \
2101
+ "--agent[Agent id (default: configured default agent)]"
2102
+ }
2103
+
2104
+ _openclaw_models_auth_order_clear() {
2105
+ _arguments -C \
2106
+ "--provider[Provider id (e.g. anthropic)]" \
2107
+ "--agent[Agent id (default: configured default agent)]"
2108
+ }
2109
+
2110
+ _openclaw_models_auth_order() {
2111
+ local -a commands
2112
+ local -a options
2113
+
2114
+ _arguments -C \
2115
+ \
2116
+ "1: :_values 'command' 'get[Show per-agent auth order override (from auth-profiles.json)]' 'set[Set per-agent auth order override (locks rotation to this list)]' 'clear[Clear per-agent auth order override (fall back to config/round-robin)]'" \
2117
+ "*::arg:->args"
2118
+
2119
+ case $state in
2120
+ (args)
2121
+ case $line[1] in
2122
+ (get) _openclaw_models_auth_order_get ;;
2123
+ (set) _openclaw_models_auth_order_set ;;
2124
+ (clear) _openclaw_models_auth_order_clear ;;
2125
+ esac
2126
+ ;;
2127
+ esac
2128
+ }
2129
+
2130
+ _openclaw_models_auth() {
2131
+ local -a commands
2132
+ local -a options
2133
+
2134
+ _arguments -C \
2135
+ "--agent[Agent id for auth order get/set/clear]" \
2136
+ "1: :_values 'command' 'add[Interactive auth helper (setup-token or paste token)]' 'login[Run a provider plugin auth flow (OAuth/API key)]' 'setup-token[Run a provider CLI to create/sync a token (TTY required)]' 'paste-token[Paste a token into auth-profiles.json and update config]' 'login-github-copilot[Login to GitHub Copilot via GitHub device flow (TTY required)]' 'order[Manage per-agent auth profile order overrides]'" \
2137
+ "*::arg:->args"
2138
+
2139
+ case $state in
2140
+ (args)
2141
+ case $line[1] in
2142
+ (add) _openclaw_models_auth_add ;;
2143
+ (login) _openclaw_models_auth_login ;;
2144
+ (setup-token) _openclaw_models_auth_setup_token ;;
2145
+ (paste-token) _openclaw_models_auth_paste_token ;;
2146
+ (login-github-copilot) _openclaw_models_auth_login_github_copilot ;;
2147
+ (order) _openclaw_models_auth_order ;;
2148
+ esac
2149
+ ;;
2150
+ esac
2151
+ }
2152
+
2153
+ _openclaw_models() {
2154
+ local -a commands
2155
+ local -a options
2156
+
2157
+ _arguments -C \
2158
+ "--status-json[Output JSON (alias for `models status --json`)]" \
2159
+ "--status-plain[Plain output (alias for `models status --plain`)]" \
2160
+ "--agent[Agent id to inspect (overrides OPENCLAW_AGENT_DIR/PI_CODING_AGENT_DIR)]" \
2161
+ "1: :_values 'command' 'list[List models (configured by default)]' 'status[Show configured model state]' 'set[Set the default model]' 'set-image[Set the image model]' 'aliases[Manage model aliases]' 'fallbacks[Manage model fallback list]' 'image-fallbacks[Manage image model fallback list]' 'scan[Scan OpenRouter free models for tools + images]' 'auth[Manage model auth profiles]'" \
2162
+ "*::arg:->args"
2163
+
2164
+ case $state in
2165
+ (args)
2166
+ case $line[1] in
2167
+ (list) _openclaw_models_list ;;
2168
+ (status) _openclaw_models_status ;;
2169
+ (set) _openclaw_models_set ;;
2170
+ (set-image) _openclaw_models_set_image ;;
2171
+ (aliases) _openclaw_models_aliases ;;
2172
+ (fallbacks) _openclaw_models_fallbacks ;;
2173
+ (image-fallbacks) _openclaw_models_image_fallbacks ;;
2174
+ (scan) _openclaw_models_scan ;;
2175
+ (auth) _openclaw_models_auth ;;
2176
+ esac
2177
+ ;;
2178
+ esac
2179
+ }
2180
+
2181
+ _openclaw_approvals_get() {
2182
+ _arguments -C \
2183
+ "--node[Target node id/name/IP]" \
2184
+ "--gateway[Force gateway approvals]" \
2185
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2186
+ "--token[Gateway token (if required)]" \
2187
+ "--timeout[Timeout in ms]" \
2188
+ "--json[Output JSON]"
2189
+ }
2190
+
2191
+ _openclaw_approvals_set() {
2192
+ _arguments -C \
2193
+ "--node[Target node id/name/IP]" \
2194
+ "--gateway[Force gateway approvals]" \
2195
+ "--file[Path to JSON file to upload]" \
2196
+ "--stdin[Read JSON from stdin]" \
2197
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2198
+ "--token[Gateway token (if required)]" \
2199
+ "--timeout[Timeout in ms]" \
2200
+ "--json[Output JSON]"
2201
+ }
2202
+
2203
+ _openclaw_approvals_allowlist_add() {
2204
+ _arguments -C \
2205
+ "--node[Target node id/name/IP]" \
2206
+ "--gateway[Force gateway approvals]" \
2207
+ "--agent[Agent id (defaults to \"*\")]" \
2208
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2209
+ "--token[Gateway token (if required)]" \
2210
+ "--timeout[Timeout in ms]" \
2211
+ "--json[Output JSON]"
2212
+ }
2213
+
2214
+ _openclaw_approvals_allowlist_remove() {
2215
+ _arguments -C \
2216
+ "--node[Target node id/name/IP]" \
2217
+ "--gateway[Force gateway approvals]" \
2218
+ "--agent[Agent id (defaults to \"*\")]" \
2219
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2220
+ "--token[Gateway token (if required)]" \
2221
+ "--timeout[Timeout in ms]" \
2222
+ "--json[Output JSON]"
2223
+ }
2224
+
2225
+ _openclaw_approvals_allowlist() {
2226
+ local -a commands
2227
+ local -a options
2228
+
2229
+ _arguments -C \
2230
+ \
2231
+ "1: :_values 'command' 'add[Add a glob pattern to an allowlist]' 'remove[Remove a glob pattern from an allowlist]'" \
2232
+ "*::arg:->args"
2233
+
2234
+ case $state in
2235
+ (args)
2236
+ case $line[1] in
2237
+ (add) _openclaw_approvals_allowlist_add ;;
2238
+ (remove) _openclaw_approvals_allowlist_remove ;;
2239
+ esac
2240
+ ;;
2241
+ esac
2242
+ }
2243
+
2244
+ _openclaw_approvals() {
2245
+ local -a commands
2246
+ local -a options
2247
+
2248
+ _arguments -C \
2249
+ \
2250
+ "1: :_values 'command' 'get[Fetch exec approvals snapshot]' 'set[Replace exec approvals with a JSON file]' 'allowlist[Edit the per-agent allowlist]'" \
2251
+ "*::arg:->args"
2252
+
2253
+ case $state in
2254
+ (args)
2255
+ case $line[1] in
2256
+ (get) _openclaw_approvals_get ;;
2257
+ (set) _openclaw_approvals_set ;;
2258
+ (allowlist) _openclaw_approvals_allowlist ;;
2259
+ esac
2260
+ ;;
2261
+ esac
2262
+ }
2263
+
2264
+ _openclaw_nodes_status() {
2265
+ _arguments -C \
2266
+ "--connected[Only show connected nodes]" \
2267
+ "--last-connected[Only show nodes connected within duration (e.g. 24h)]" \
2268
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2269
+ "--token[Gateway token (if required)]" \
2270
+ "--timeout[Timeout in ms]" \
2271
+ "--json[Output JSON]"
2272
+ }
2273
+
2274
+ _openclaw_nodes_describe() {
2275
+ _arguments -C \
2276
+ "--node[Node id, name, or IP]" \
2277
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2278
+ "--token[Gateway token (if required)]" \
2279
+ "--timeout[Timeout in ms]" \
2280
+ "--json[Output JSON]"
2281
+ }
2282
+
2283
+ _openclaw_nodes_list() {
2284
+ _arguments -C \
2285
+ "--connected[Only show connected nodes]" \
2286
+ "--last-connected[Only show nodes connected within duration (e.g. 24h)]" \
2287
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2288
+ "--token[Gateway token (if required)]" \
2289
+ "--timeout[Timeout in ms]" \
2290
+ "--json[Output JSON]"
2291
+ }
2292
+
2293
+ _openclaw_nodes_pending() {
2294
+ _arguments -C \
2295
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2296
+ "--token[Gateway token (if required)]" \
2297
+ "--timeout[Timeout in ms]" \
2298
+ "--json[Output JSON]"
2299
+ }
2300
+
2301
+ _openclaw_nodes_approve() {
2302
+ _arguments -C \
2303
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2304
+ "--token[Gateway token (if required)]" \
2305
+ "--timeout[Timeout in ms]" \
2306
+ "--json[Output JSON]"
2307
+ }
2308
+
2309
+ _openclaw_nodes_reject() {
2310
+ _arguments -C \
2311
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2312
+ "--token[Gateway token (if required)]" \
2313
+ "--timeout[Timeout in ms]" \
2314
+ "--json[Output JSON]"
2315
+ }
2316
+
2317
+ _openclaw_nodes_rename() {
2318
+ _arguments -C \
2319
+ "--node[Node id, name, or IP]" \
2320
+ "--name[New display name]" \
2321
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2322
+ "--token[Gateway token (if required)]" \
2323
+ "--timeout[Timeout in ms]" \
2324
+ "--json[Output JSON]"
2325
+ }
2326
+
2327
+ _openclaw_nodes_invoke() {
2328
+ _arguments -C \
2329
+ "--node[Node id, name, or IP]" \
2330
+ "--command[Command (e.g. canvas.eval)]" \
2331
+ "--params[JSON object string for params]" \
2332
+ "--invoke-timeout[Node invoke timeout in ms (default 15000)]" \
2333
+ "--idempotency-key[Idempotency key (optional)]" \
2334
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2335
+ "--token[Gateway token (if required)]" \
2336
+ "--timeout[Timeout in ms]" \
2337
+ "--json[Output JSON]"
2338
+ }
2339
+
2340
+ _openclaw_nodes_run() {
2341
+ _arguments -C \
2342
+ "--node[Node id, name, or IP]" \
2343
+ "--cwd[Working directory]" \
2344
+ "--env[Environment override (repeatable)]" \
2345
+ "--raw[Run a raw shell command string (sh -lc / cmd.exe /c)]" \
2346
+ "--agent[Agent id (default: configured default agent)]" \
2347
+ "--ask[Exec ask mode (off|on-miss|always)]" \
2348
+ "--security[Exec security mode (deny|allowlist|full)]" \
2349
+ "--command-timeout[Command timeout (ms)]" \
2350
+ "--needs-screen-recording[Require screen recording permission]" \
2351
+ "--invoke-timeout[Node invoke timeout in ms (default 30000)]" \
2352
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2353
+ "--token[Gateway token (if required)]" \
2354
+ "--timeout[Timeout in ms]" \
2355
+ "--json[Output JSON]"
2356
+ }
2357
+
2358
+ _openclaw_nodes_notify() {
2359
+ _arguments -C \
2360
+ "--node[Node id, name, or IP]" \
2361
+ "--title[Notification title]" \
2362
+ "--body[Notification body]" \
2363
+ "--sound[Notification sound]" \
2364
+ "--priority[Notification priority]" \
2365
+ "--delivery[Delivery mode]" \
2366
+ "--invoke-timeout[Node invoke timeout in ms (default 15000)]" \
2367
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2368
+ "--token[Gateway token (if required)]" \
2369
+ "--timeout[Timeout in ms]" \
2370
+ "--json[Output JSON]"
2371
+ }
2372
+
2373
+ _openclaw_nodes_canvas_snapshot() {
2374
+ _arguments -C \
2375
+ "--node[Node id, name, or IP]" \
2376
+ "--format[Image format]" \
2377
+ "--max-width[Max width in px (optional)]" \
2378
+ "--quality[JPEG quality (optional)]" \
2379
+ "--invoke-timeout[Node invoke timeout in ms (default 20000)]" \
2380
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2381
+ "--token[Gateway token (if required)]" \
2382
+ "--timeout[Timeout in ms]" \
2383
+ "--json[Output JSON]"
2384
+ }
2385
+
2386
+ _openclaw_nodes_canvas_present() {
2387
+ _arguments -C \
2388
+ "--node[Node id, name, or IP]" \
2389
+ "--target[Target URL/path (optional)]" \
2390
+ "--x[Placement x coordinate]" \
2391
+ "--y[Placement y coordinate]" \
2392
+ "--width[Placement width]" \
2393
+ "--height[Placement height]" \
2394
+ "--invoke-timeout[Node invoke timeout in ms]" \
2395
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2396
+ "--token[Gateway token (if required)]" \
2397
+ "--timeout[Timeout in ms]" \
2398
+ "--json[Output JSON]"
2399
+ }
2400
+
2401
+ _openclaw_nodes_canvas_hide() {
2402
+ _arguments -C \
2403
+ "--node[Node id, name, or IP]" \
2404
+ "--invoke-timeout[Node invoke timeout in ms]" \
2405
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2406
+ "--token[Gateway token (if required)]" \
2407
+ "--timeout[Timeout in ms]" \
2408
+ "--json[Output JSON]"
2409
+ }
2410
+
2411
+ _openclaw_nodes_canvas_navigate() {
2412
+ _arguments -C \
2413
+ "--node[Node id, name, or IP]" \
2414
+ "--invoke-timeout[Node invoke timeout in ms]" \
2415
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2416
+ "--token[Gateway token (if required)]" \
2417
+ "--timeout[Timeout in ms]" \
2418
+ "--json[Output JSON]"
2419
+ }
2420
+
2421
+ _openclaw_nodes_canvas_eval() {
2422
+ _arguments -C \
2423
+ "--js[JavaScript to evaluate]" \
2424
+ "--node[Node id, name, or IP]" \
2425
+ "--invoke-timeout[Node invoke timeout in ms]" \
2426
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2427
+ "--token[Gateway token (if required)]" \
2428
+ "--timeout[Timeout in ms]" \
2429
+ "--json[Output JSON]"
2430
+ }
2431
+
2432
+ _openclaw_nodes_canvas_a2ui_push() {
2433
+ _arguments -C \
2434
+ "--jsonl[Path to JSONL payload]" \
2435
+ "--text[Render a quick A2UI text payload]" \
2436
+ "--node[Node id, name, or IP]" \
2437
+ "--invoke-timeout[Node invoke timeout in ms]" \
2438
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2439
+ "--token[Gateway token (if required)]" \
2440
+ "--timeout[Timeout in ms]" \
2441
+ "--json[Output JSON]"
2442
+ }
2443
+
2444
+ _openclaw_nodes_canvas_a2ui_reset() {
2445
+ _arguments -C \
2446
+ "--node[Node id, name, or IP]" \
2447
+ "--invoke-timeout[Node invoke timeout in ms]" \
2448
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2449
+ "--token[Gateway token (if required)]" \
2450
+ "--timeout[Timeout in ms]" \
2451
+ "--json[Output JSON]"
2452
+ }
2453
+
2454
+ _openclaw_nodes_canvas_a2ui() {
2455
+ local -a commands
2456
+ local -a options
2457
+
2458
+ _arguments -C \
2459
+ \
2460
+ "1: :_values 'command' 'push[Push A2UI JSONL to the canvas]' 'reset[Reset A2UI renderer state]'" \
2461
+ "*::arg:->args"
2462
+
2463
+ case $state in
2464
+ (args)
2465
+ case $line[1] in
2466
+ (push) _openclaw_nodes_canvas_a2ui_push ;;
2467
+ (reset) _openclaw_nodes_canvas_a2ui_reset ;;
2468
+ esac
2469
+ ;;
2470
+ esac
2471
+ }
2472
+
2473
+ _openclaw_nodes_canvas() {
2474
+ local -a commands
2475
+ local -a options
2476
+
2477
+ _arguments -C \
2478
+ \
2479
+ "1: :_values 'command' 'snapshot[Capture a canvas snapshot (prints MEDIA:<path>)]' 'present[Show the canvas (optionally with a target URL/path)]' 'hide[Hide the canvas]' 'navigate[Navigate the canvas to a URL]' 'eval[Evaluate JavaScript in the canvas]' 'a2ui[Render A2UI content on the canvas]'" \
2480
+ "*::arg:->args"
2481
+
2482
+ case $state in
2483
+ (args)
2484
+ case $line[1] in
2485
+ (snapshot) _openclaw_nodes_canvas_snapshot ;;
2486
+ (present) _openclaw_nodes_canvas_present ;;
2487
+ (hide) _openclaw_nodes_canvas_hide ;;
2488
+ (navigate) _openclaw_nodes_canvas_navigate ;;
2489
+ (eval) _openclaw_nodes_canvas_eval ;;
2490
+ (a2ui) _openclaw_nodes_canvas_a2ui ;;
2491
+ esac
2492
+ ;;
2493
+ esac
2494
+ }
2495
+
2496
+ _openclaw_nodes_camera_list() {
2497
+ _arguments -C \
2498
+ "--node[Node id, name, or IP]" \
2499
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2500
+ "--token[Gateway token (if required)]" \
2501
+ "--timeout[Timeout in ms]" \
2502
+ "--json[Output JSON]"
2503
+ }
2504
+
2505
+ _openclaw_nodes_camera_snap() {
2506
+ _arguments -C \
2507
+ "--node[Node id, name, or IP]" \
2508
+ "--facing[Camera facing]" \
2509
+ "--device-id[Camera device id (from nodes camera list)]" \
2510
+ "--max-width[Max width in px (optional)]" \
2511
+ "--quality[JPEG quality (default 0.9)]" \
2512
+ "--delay-ms[Delay before capture in ms (macOS default 2000)]" \
2513
+ "--invoke-timeout[Node invoke timeout in ms (default 20000)]" \
2514
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2515
+ "--token[Gateway token (if required)]" \
2516
+ "--timeout[Timeout in ms]" \
2517
+ "--json[Output JSON]"
2518
+ }
2519
+
2520
+ _openclaw_nodes_camera_clip() {
2521
+ _arguments -C \
2522
+ "--node[Node id, name, or IP]" \
2523
+ "--facing[Camera facing]" \
2524
+ "--device-id[Camera device id (from nodes camera list)]" \
2525
+ "--duration[Duration (default 3000ms; supports ms/s/m, e.g. 10s)]" \
2526
+ "--no-audio[Disable audio capture]" \
2527
+ "--invoke-timeout[Node invoke timeout in ms (default 90000)]" \
2528
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2529
+ "--token[Gateway token (if required)]" \
2530
+ "--timeout[Timeout in ms]" \
2531
+ "--json[Output JSON]"
2532
+ }
2533
+
2534
+ _openclaw_nodes_camera() {
2535
+ local -a commands
2536
+ local -a options
2537
+
2538
+ _arguments -C \
2539
+ \
2540
+ "1: :_values 'command' 'list[List available cameras on a node]' 'snap[Capture a photo from a node camera (prints MEDIA:<path>)]' 'clip[Capture a short video clip from a node camera (prints MEDIA:<path>)]'" \
2541
+ "*::arg:->args"
2542
+
2543
+ case $state in
2544
+ (args)
2545
+ case $line[1] in
2546
+ (list) _openclaw_nodes_camera_list ;;
2547
+ (snap) _openclaw_nodes_camera_snap ;;
2548
+ (clip) _openclaw_nodes_camera_clip ;;
2549
+ esac
2550
+ ;;
2551
+ esac
2552
+ }
2553
+
2554
+ _openclaw_nodes_screen_record() {
2555
+ _arguments -C \
2556
+ "--node[Node id, name, or IP]" \
2557
+ "--screen[Screen index (0 = primary)]" \
2558
+ "--duration[Clip duration (ms or 10s)]" \
2559
+ "--fps[Frames per second]" \
2560
+ "--no-audio[Disable microphone audio capture]" \
2561
+ "--out[Output path]" \
2562
+ "--invoke-timeout[Node invoke timeout in ms (default 120000)]" \
2563
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2564
+ "--token[Gateway token (if required)]" \
2565
+ "--timeout[Timeout in ms]" \
2566
+ "--json[Output JSON]"
2567
+ }
2568
+
2569
+ _openclaw_nodes_screen() {
2570
+ local -a commands
2571
+ local -a options
2572
+
2573
+ _arguments -C \
2574
+ \
2575
+ "1: :_values 'command' 'record[Capture a short screen recording from a node (prints MEDIA:<path>)]'" \
2576
+ "*::arg:->args"
2577
+
2578
+ case $state in
2579
+ (args)
2580
+ case $line[1] in
2581
+ (record) _openclaw_nodes_screen_record ;;
2582
+ esac
2583
+ ;;
2584
+ esac
2585
+ }
2586
+
2587
+ _openclaw_nodes_location_get() {
2588
+ _arguments -C \
2589
+ "--node[Node id, name, or IP]" \
2590
+ "--max-age[Use cached location newer than this (ms)]" \
2591
+ "--accuracy[Desired accuracy (default: balanced/precise depending on node setting)]" \
2592
+ "--location-timeout[Location fix timeout (ms)]" \
2593
+ "--invoke-timeout[Node invoke timeout in ms (default 20000)]" \
2594
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2595
+ "--token[Gateway token (if required)]" \
2596
+ "--timeout[Timeout in ms]" \
2597
+ "--json[Output JSON]"
2598
+ }
2599
+
2600
+ _openclaw_nodes_location() {
2601
+ local -a commands
2602
+ local -a options
2603
+
2604
+ _arguments -C \
2605
+ \
2606
+ "1: :_values 'command' 'get[Fetch the current location from a node]'" \
2607
+ "*::arg:->args"
2608
+
2609
+ case $state in
2610
+ (args)
2611
+ case $line[1] in
2612
+ (get) _openclaw_nodes_location_get ;;
2613
+ esac
2614
+ ;;
2615
+ esac
2616
+ }
2617
+
2618
+ _openclaw_nodes() {
2619
+ local -a commands
2620
+ local -a options
2621
+
2622
+ _arguments -C \
2623
+ \
2624
+ "1: :_values 'command' 'status[List known nodes with connection status and capabilities]' 'describe[Describe a node (capabilities + supported invoke commands)]' 'list[List pending and paired nodes]' 'pending[List pending pairing requests]' 'approve[Approve a pending pairing request]' 'reject[Reject a pending pairing request]' 'rename[Rename a paired node (display name override)]' 'invoke[Invoke a command on a paired node]' 'run[Run a shell command on a node (mac only)]' 'notify[Send a local notification on a node (mac only)]' 'canvas[Capture or render canvas content from a paired node]' 'camera[Capture camera media from a paired node]' 'screen[Capture screen recordings from a paired node]' 'location[Fetch location from a paired node]'" \
2625
+ "*::arg:->args"
2626
+
2627
+ case $state in
2628
+ (args)
2629
+ case $line[1] in
2630
+ (status) _openclaw_nodes_status ;;
2631
+ (describe) _openclaw_nodes_describe ;;
2632
+ (list) _openclaw_nodes_list ;;
2633
+ (pending) _openclaw_nodes_pending ;;
2634
+ (approve) _openclaw_nodes_approve ;;
2635
+ (reject) _openclaw_nodes_reject ;;
2636
+ (rename) _openclaw_nodes_rename ;;
2637
+ (invoke) _openclaw_nodes_invoke ;;
2638
+ (run) _openclaw_nodes_run ;;
2639
+ (notify) _openclaw_nodes_notify ;;
2640
+ (canvas) _openclaw_nodes_canvas ;;
2641
+ (camera) _openclaw_nodes_camera ;;
2642
+ (screen) _openclaw_nodes_screen ;;
2643
+ (location) _openclaw_nodes_location ;;
2644
+ esac
2645
+ ;;
2646
+ esac
2647
+ }
2648
+
2649
+ _openclaw_devices_list() {
2650
+ _arguments -C \
2651
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2652
+ "--token[Gateway token (if required)]" \
2653
+ "--password[Gateway password (password auth)]" \
2654
+ "--timeout[Timeout in ms]" \
2655
+ "--json[Output JSON]"
2656
+ }
2657
+
2658
+ _openclaw_devices_approve() {
2659
+ _arguments -C \
2660
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2661
+ "--token[Gateway token (if required)]" \
2662
+ "--password[Gateway password (password auth)]" \
2663
+ "--timeout[Timeout in ms]" \
2664
+ "--json[Output JSON]"
2665
+ }
2666
+
2667
+ _openclaw_devices_reject() {
2668
+ _arguments -C \
2669
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2670
+ "--token[Gateway token (if required)]" \
2671
+ "--password[Gateway password (password auth)]" \
2672
+ "--timeout[Timeout in ms]" \
2673
+ "--json[Output JSON]"
2674
+ }
2675
+
2676
+ _openclaw_devices_rotate() {
2677
+ _arguments -C \
2678
+ "--device[Device id]" \
2679
+ "--role[Role name]" \
2680
+ "--scope[Scopes to attach to the token (repeatable)]" \
2681
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2682
+ "--token[Gateway token (if required)]" \
2683
+ "--password[Gateway password (password auth)]" \
2684
+ "--timeout[Timeout in ms]" \
2685
+ "--json[Output JSON]"
2686
+ }
2687
+
2688
+ _openclaw_devices_revoke() {
2689
+ _arguments -C \
2690
+ "--device[Device id]" \
2691
+ "--role[Role name]" \
2692
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2693
+ "--token[Gateway token (if required)]" \
2694
+ "--password[Gateway password (password auth)]" \
2695
+ "--timeout[Timeout in ms]" \
2696
+ "--json[Output JSON]"
2697
+ }
2698
+
2699
+ _openclaw_devices() {
2700
+ local -a commands
2701
+ local -a options
2702
+
2703
+ _arguments -C \
2704
+ \
2705
+ "1: :_values 'command' 'list[List pending and paired devices]' 'approve[Approve a pending device pairing request]' 'reject[Reject a pending device pairing request]' 'rotate[Rotate a device token for a role]' 'revoke[Revoke a device token for a role]'" \
2706
+ "*::arg:->args"
2707
+
2708
+ case $state in
2709
+ (args)
2710
+ case $line[1] in
2711
+ (list) _openclaw_devices_list ;;
2712
+ (approve) _openclaw_devices_approve ;;
2713
+ (reject) _openclaw_devices_reject ;;
2714
+ (rotate) _openclaw_devices_rotate ;;
2715
+ (revoke) _openclaw_devices_revoke ;;
2716
+ esac
2717
+ ;;
2718
+ esac
2719
+ }
2720
+
2721
+ _openclaw_node_run() {
2722
+ _arguments -C \
2723
+ "--host[Gateway host]" \
2724
+ "--port[Gateway port]" \
2725
+ "--tls[Use TLS for the gateway connection]" \
2726
+ "--tls-fingerprint[Expected TLS certificate fingerprint (sha256)]" \
2727
+ "--node-id[Override node id (clears pairing token)]" \
2728
+ "--display-name[Override node display name]"
2729
+ }
2730
+
2731
+ _openclaw_node_status() {
2732
+ _arguments -C \
2733
+ "--json[Output JSON]"
2734
+ }
2735
+
2736
+ _openclaw_node_install() {
2737
+ _arguments -C \
2738
+ "--host[Gateway host]" \
2739
+ "--port[Gateway port]" \
2740
+ "--tls[Use TLS for the gateway connection]" \
2741
+ "--tls-fingerprint[Expected TLS certificate fingerprint (sha256)]" \
2742
+ "--node-id[Override node id (clears pairing token)]" \
2743
+ "--display-name[Override node display name]" \
2744
+ "--runtime[Service runtime (node|bun). Default: node]" \
2745
+ "--force[Reinstall/overwrite if already installed]" \
2746
+ "--json[Output JSON]"
2747
+ }
2748
+
2749
+ _openclaw_node_uninstall() {
2750
+ _arguments -C \
2751
+ "--json[Output JSON]"
2752
+ }
2753
+
2754
+ _openclaw_node_stop() {
2755
+ _arguments -C \
2756
+ "--json[Output JSON]"
2757
+ }
2758
+
2759
+ _openclaw_node_restart() {
2760
+ _arguments -C \
2761
+ "--json[Output JSON]"
2762
+ }
2763
+
2764
+ _openclaw_node() {
2765
+ local -a commands
2766
+ local -a options
2767
+
2768
+ _arguments -C \
2769
+ \
2770
+ "1: :_values 'command' 'run[Run the headless node host (foreground)]' 'status[Show node host status]' 'install[Install the node host service (launchd/systemd/schtasks)]' 'uninstall[Uninstall the node host service (launchd/systemd/schtasks)]' 'stop[Stop the node host service (launchd/systemd/schtasks)]' 'restart[Restart the node host service (launchd/systemd/schtasks)]'" \
2771
+ "*::arg:->args"
2772
+
2773
+ case $state in
2774
+ (args)
2775
+ case $line[1] in
2776
+ (run) _openclaw_node_run ;;
2777
+ (status) _openclaw_node_status ;;
2778
+ (install) _openclaw_node_install ;;
2779
+ (uninstall) _openclaw_node_uninstall ;;
2780
+ (stop) _openclaw_node_stop ;;
2781
+ (restart) _openclaw_node_restart ;;
2782
+ esac
2783
+ ;;
2784
+ esac
2785
+ }
2786
+
2787
+ _openclaw_sandbox_list() {
2788
+ _arguments -C \
2789
+ "--json[Output result as JSON]" \
2790
+ "--browser[List browser containers only]"
2791
+ }
2792
+
2793
+ _openclaw_sandbox_recreate() {
2794
+ _arguments -C \
2795
+ "--all[Recreate all sandbox containers]" \
2796
+ "--session[Recreate container for specific session]" \
2797
+ "--agent[Recreate containers for specific agent]" \
2798
+ "--browser[Only recreate browser containers]" \
2799
+ "--force[Skip confirmation prompt]"
2800
+ }
2801
+
2802
+ _openclaw_sandbox_explain() {
2803
+ _arguments -C \
2804
+ "--session[Session key to inspect (defaults to agent main)]" \
2805
+ "--agent[Agent id to inspect (defaults to derived agent)]" \
2806
+ "--json[Output result as JSON]"
2807
+ }
2808
+
2809
+ _openclaw_sandbox() {
2810
+ local -a commands
2811
+ local -a options
2812
+
2813
+ _arguments -C \
2814
+ \
2815
+ "1: :_values 'command' 'list[List sandbox containers and their status]' 'recreate[Remove containers to force recreation with updated config]' 'explain[Explain effective sandbox/tool policy for a session/agent]'" \
2816
+ "*::arg:->args"
2817
+
2818
+ case $state in
2819
+ (args)
2820
+ case $line[1] in
2821
+ (list) _openclaw_sandbox_list ;;
2822
+ (recreate) _openclaw_sandbox_recreate ;;
2823
+ (explain) _openclaw_sandbox_explain ;;
2824
+ esac
2825
+ ;;
2826
+ esac
2827
+ }
2828
+
2829
+ _openclaw_tui() {
2830
+ _arguments -C \
2831
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2832
+ "--token[Gateway token (if required)]" \
2833
+ "--password[Gateway password (if required)]" \
2834
+ "--session[Session key (default: \"main\", or \"global\" when scope is global)]" \
2835
+ "--deliver[Deliver assistant replies]" \
2836
+ "--thinking[Thinking level override]" \
2837
+ "--message[Send an initial message after connecting]" \
2838
+ "--timeout-ms[Agent timeout in ms (defaults to agents.defaults.timeoutSeconds)]" \
2839
+ "--history-limit[History entries to load]"
2840
+ }
2841
+
2842
+ _openclaw_cron_status() {
2843
+ _arguments -C \
2844
+ "--json[Output JSON]" \
2845
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2846
+ "--token[Gateway token (if required)]" \
2847
+ "--timeout[Timeout in ms]" \
2848
+ "--expect-final[Wait for final response (agent)]"
2849
+ }
2850
+
2851
+ _openclaw_cron_list() {
2852
+ _arguments -C \
2853
+ "--all[Include disabled jobs]" \
2854
+ "--json[Output JSON]" \
2855
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2856
+ "--token[Gateway token (if required)]" \
2857
+ "--timeout[Timeout in ms]" \
2858
+ "--expect-final[Wait for final response (agent)]"
2859
+ }
2860
+
2861
+ _openclaw_cron_add() {
2862
+ _arguments -C \
2863
+ "--name[Job name]" \
2864
+ "--description[Optional description]" \
2865
+ "--disabled[Create job disabled]" \
2866
+ "--delete-after-run[Delete one-shot job after it succeeds]" \
2867
+ "--keep-after-run[Keep one-shot job after it succeeds]" \
2868
+ "--agent[Agent id for this job]" \
2869
+ "--session[Session target (main|isolated)]" \
2870
+ "--wake[Wake mode (now|next-heartbeat)]" \
2871
+ "--at[Run once at time (ISO) or +duration (e.g. 20m)]" \
2872
+ "--every[Run every duration (e.g. 10m, 1h)]" \
2873
+ "--cron[Cron expression (5-field)]" \
2874
+ "--tz[Timezone for cron expressions (IANA)]" \
2875
+ "--system-event[System event payload (main session)]" \
2876
+ "--message[Agent message payload]" \
2877
+ "--thinking[Thinking level for agent jobs (off|minimal|low|medium|high)]" \
2878
+ "--model[Model override for agent jobs (provider/model or alias)]" \
2879
+ "--timeout-seconds[Timeout seconds for agent jobs]" \
2880
+ "--announce[Announce summary to a chat (subagent-style)]" \
2881
+ "--deliver[Deprecated (use --announce). Announces a summary to a chat.]" \
2882
+ "--no-deliver[Disable announce delivery and skip main-session summary]" \
2883
+ "--channel[Delivery channel (last)]" \
2884
+ "--to[Delivery destination (E.164, Telegram chatId, or Discord channel/user)]" \
2885
+ "--best-effort-deliver[Do not fail the job if delivery fails]" \
2886
+ "--json[Output JSON]" \
2887
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2888
+ "--token[Gateway token (if required)]" \
2889
+ "--timeout[Timeout in ms]" \
2890
+ "--expect-final[Wait for final response (agent)]"
2891
+ }
2892
+
2893
+ _openclaw_cron_rm() {
2894
+ _arguments -C \
2895
+ "--json[Output JSON]" \
2896
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2897
+ "--token[Gateway token (if required)]" \
2898
+ "--timeout[Timeout in ms]" \
2899
+ "--expect-final[Wait for final response (agent)]"
2900
+ }
2901
+
2902
+ _openclaw_cron_enable() {
2903
+ _arguments -C \
2904
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2905
+ "--token[Gateway token (if required)]" \
2906
+ "--timeout[Timeout in ms]" \
2907
+ "--expect-final[Wait for final response (agent)]"
2908
+ }
2909
+
2910
+ _openclaw_cron_disable() {
2911
+ _arguments -C \
2912
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2913
+ "--token[Gateway token (if required)]" \
2914
+ "--timeout[Timeout in ms]" \
2915
+ "--expect-final[Wait for final response (agent)]"
2916
+ }
2917
+
2918
+ _openclaw_cron_runs() {
2919
+ _arguments -C \
2920
+ "--id[Job id]" \
2921
+ "--limit[Max entries (default 50)]" \
2922
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2923
+ "--token[Gateway token (if required)]" \
2924
+ "--timeout[Timeout in ms]" \
2925
+ "--expect-final[Wait for final response (agent)]"
2926
+ }
2927
+
2928
+ _openclaw_cron_run() {
2929
+ _arguments -C \
2930
+ "--due[Run only when due (default behavior in older versions)]" \
2931
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2932
+ "--token[Gateway token (if required)]" \
2933
+ "--timeout[Timeout in ms]" \
2934
+ "--expect-final[Wait for final response (agent)]"
2935
+ }
2936
+
2937
+ _openclaw_cron_edit() {
2938
+ _arguments -C \
2939
+ "--name[Set name]" \
2940
+ "--description[Set description]" \
2941
+ "--enable[Enable job]" \
2942
+ "--disable[Disable job]" \
2943
+ "--delete-after-run[Delete one-shot job after it succeeds]" \
2944
+ "--keep-after-run[Keep one-shot job after it succeeds]" \
2945
+ "--session[Session target (main|isolated)]" \
2946
+ "--agent[Set agent id]" \
2947
+ "--clear-agent[Unset agent and use default]" \
2948
+ "--wake[Wake mode (now|next-heartbeat)]" \
2949
+ "--at[Set one-shot time (ISO) or duration like 20m]" \
2950
+ "--every[Set interval duration like 10m]" \
2951
+ "--cron[Set cron expression]" \
2952
+ "--tz[Timezone for cron expressions (IANA)]" \
2953
+ "--system-event[Set systemEvent payload]" \
2954
+ "--message[Set agentTurn payload message]" \
2955
+ "--thinking[Thinking level for agent jobs]" \
2956
+ "--model[Model override for agent jobs]" \
2957
+ "--timeout-seconds[Timeout seconds for agent jobs]" \
2958
+ "--announce[Announce summary to a chat (subagent-style)]" \
2959
+ "--deliver[Deprecated (use --announce). Announces a summary to a chat.]" \
2960
+ "--no-deliver[Disable announce delivery]" \
2961
+ "--channel[Delivery channel (last)]" \
2962
+ "--to[Delivery destination (E.164, Telegram chatId, or Discord channel/user)]" \
2963
+ "--best-effort-deliver[Do not fail job if delivery fails]" \
2964
+ "--no-best-effort-deliver[Fail job when delivery fails]" \
2965
+ "--url[Gateway WebSocket URL (defaults to gateway.remote.url when configured)]" \
2966
+ "--token[Gateway token (if required)]" \
2967
+ "--timeout[Timeout in ms]" \
2968
+ "--expect-final[Wait for final response (agent)]"
2969
+ }
2970
+
2971
+ _openclaw_cron() {
2972
+ local -a commands
2973
+ local -a options
2974
+
2975
+ _arguments -C \
2976
+ \
2977
+ "1: :_values 'command' 'status[Show cron scheduler status]' 'list[List cron jobs]' 'add[Add a cron job]' 'rm[Remove a cron job]' 'enable[Enable a cron job]' 'disable[Disable a cron job]' 'runs[Show cron run history (JSONL-backed)]' 'run[Run a cron job now (debug)]' 'edit[Edit a cron job (patch fields)]'" \
2978
+ "*::arg:->args"
2979
+
2980
+ case $state in
2981
+ (args)
2982
+ case $line[1] in
2983
+ (status) _openclaw_cron_status ;;
2984
+ (list) _openclaw_cron_list ;;
2985
+ (add) _openclaw_cron_add ;;
2986
+ (rm) _openclaw_cron_rm ;;
2987
+ (enable) _openclaw_cron_enable ;;
2988
+ (disable) _openclaw_cron_disable ;;
2989
+ (runs) _openclaw_cron_runs ;;
2990
+ (run) _openclaw_cron_run ;;
2991
+ (edit) _openclaw_cron_edit ;;
2992
+ esac
2993
+ ;;
2994
+ esac
2995
+ }
2996
+
2997
+ _openclaw_dns_setup() {
2998
+ _arguments -C \
2999
+ "--domain[Wide-area discovery domain (e.g. openclaw.internal)]" \
3000
+ "--apply[Install/update CoreDNS config and (re)start the service (requires sudo)]"
3001
+ }
3002
+
3003
+ _openclaw_dns() {
3004
+ local -a commands
3005
+ local -a options
3006
+
3007
+ _arguments -C \
3008
+ \
3009
+ "1: :_values 'command' 'setup[Set up CoreDNS to serve your discovery domain for unicast DNS-SD (Wide-Area Bonjour)]'" \
3010
+ "*::arg:->args"
3011
+
3012
+ case $state in
3013
+ (args)
3014
+ case $line[1] in
3015
+ (setup) _openclaw_dns_setup ;;
3016
+ esac
3017
+ ;;
3018
+ esac
3019
+ }
3020
+
3021
+ _openclaw_docs() {
3022
+ _arguments -C \
3023
+
3024
+ }
3025
+
3026
+ _openclaw_hooks_list() {
3027
+ _arguments -C \
3028
+ "--eligible[Show only eligible hooks]" \
3029
+ "--json[Output as JSON]" \
3030
+ "(--verbose -v)"{--verbose,-v}"[Show more details including missing requirements]"
3031
+ }
3032
+
3033
+ _openclaw_hooks_info() {
3034
+ _arguments -C \
3035
+ "--json[Output as JSON]"
3036
+ }
3037
+
3038
+ _openclaw_hooks_check() {
3039
+ _arguments -C \
3040
+ "--json[Output as JSON]"
3041
+ }
3042
+
3043
+ _openclaw_hooks_enable() {
3044
+ _arguments -C \
3045
+
3046
+ }
3047
+
3048
+ _openclaw_hooks_disable() {
3049
+ _arguments -C \
3050
+
3051
+ }
3052
+
3053
+ _openclaw_hooks_install() {
3054
+ _arguments -C \
3055
+ "(--link -l)"{--link,-l}"[Link a local path instead of copying]"
3056
+ }
3057
+
3058
+ _openclaw_hooks_update() {
3059
+ _arguments -C \
3060
+ "--all[Update all tracked hooks]" \
3061
+ "--dry-run[Show what would change without writing]"
3062
+ }
3063
+
3064
+ _openclaw_hooks() {
3065
+ local -a commands
3066
+ local -a options
3067
+
3068
+ _arguments -C \
3069
+ \
3070
+ "1: :_values 'command' 'list[List all hooks]' 'info[Show detailed information about a hook]' 'check[Check hooks eligibility status]' 'enable[Enable a hook]' 'disable[Disable a hook]' 'install[Install a hook pack (path, archive, or npm spec)]' 'update[Update installed hooks (npm installs only)]'" \
3071
+ "*::arg:->args"
3072
+
3073
+ case $state in
3074
+ (args)
3075
+ case $line[1] in
3076
+ (list) _openclaw_hooks_list ;;
3077
+ (info) _openclaw_hooks_info ;;
3078
+ (check) _openclaw_hooks_check ;;
3079
+ (enable) _openclaw_hooks_enable ;;
3080
+ (disable) _openclaw_hooks_disable ;;
3081
+ (install) _openclaw_hooks_install ;;
3082
+ (update) _openclaw_hooks_update ;;
3083
+ esac
3084
+ ;;
3085
+ esac
3086
+ }
3087
+
3088
+ _openclaw_webhooks_gmail_setup() {
3089
+ _arguments -C \
3090
+ "--account[Gmail account to watch]" \
3091
+ "--project[GCP project id (OAuth client owner)]" \
3092
+ "--topic[Pub/Sub topic name]" \
3093
+ "--subscription[Pub/Sub subscription name]" \
3094
+ "--label[Gmail label to watch]" \
3095
+ "--hook-url[OpenClaw hook URL]" \
3096
+ "--hook-token[OpenClaw hook token]" \
3097
+ "--push-token[Push token for gog watch serve]" \
3098
+ "--bind[gog watch serve bind host]" \
3099
+ "--port[gog watch serve port]" \
3100
+ "--path[gog watch serve path]" \
3101
+ "--include-body[Include email body snippets]" \
3102
+ "--max-bytes[Max bytes for body snippets]" \
3103
+ "--renew-minutes[Renew watch every N minutes]" \
3104
+ "--tailscale[Expose push endpoint via tailscale (funnel|serve|off)]" \
3105
+ "--tailscale-path[Path for tailscale serve/funnel]" \
3106
+ "--tailscale-target[Tailscale serve/funnel target (port, host:port, or URL)]" \
3107
+ "--push-endpoint[Explicit Pub/Sub push endpoint]" \
3108
+ "--json[Output JSON summary]"
3109
+ }
3110
+
3111
+ _openclaw_webhooks_gmail_run() {
3112
+ _arguments -C \
3113
+ "--account[Gmail account to watch]" \
3114
+ "--topic[Pub/Sub topic path (projects/.../topics/..)]" \
3115
+ "--subscription[Pub/Sub subscription name]" \
3116
+ "--label[Gmail label to watch]" \
3117
+ "--hook-url[OpenClaw hook URL]" \
3118
+ "--hook-token[OpenClaw hook token]" \
3119
+ "--push-token[Push token for gog watch serve]" \
3120
+ "--bind[gog watch serve bind host]" \
3121
+ "--port[gog watch serve port]" \
3122
+ "--path[gog watch serve path]" \
3123
+ "--include-body[Include email body snippets]" \
3124
+ "--max-bytes[Max bytes for body snippets]" \
3125
+ "--renew-minutes[Renew watch every N minutes]" \
3126
+ "--tailscale[Expose push endpoint via tailscale (funnel|serve|off)]" \
3127
+ "--tailscale-path[Path for tailscale serve/funnel]" \
3128
+ "--tailscale-target[Tailscale serve/funnel target (port, host:port, or URL)]"
3129
+ }
3130
+
3131
+ _openclaw_webhooks_gmail() {
3132
+ local -a commands
3133
+ local -a options
3134
+
3135
+ _arguments -C \
3136
+ \
3137
+ "1: :_values 'command' 'setup[Configure Gmail watch + Pub/Sub + OpenClaw hooks]' 'run[Run gog watch serve + auto-renew loop]'" \
3138
+ "*::arg:->args"
3139
+
3140
+ case $state in
3141
+ (args)
3142
+ case $line[1] in
3143
+ (setup) _openclaw_webhooks_gmail_setup ;;
3144
+ (run) _openclaw_webhooks_gmail_run ;;
3145
+ esac
3146
+ ;;
3147
+ esac
3148
+ }
3149
+
3150
+ _openclaw_webhooks() {
3151
+ local -a commands
3152
+ local -a options
3153
+
3154
+ _arguments -C \
3155
+ \
3156
+ "1: :_values 'command' 'gmail[Gmail Pub/Sub hooks (via gogcli)]'" \
3157
+ "*::arg:->args"
3158
+
3159
+ case $state in
3160
+ (args)
3161
+ case $line[1] in
3162
+ (gmail) _openclaw_webhooks_gmail ;;
3163
+ esac
3164
+ ;;
3165
+ esac
3166
+ }
3167
+
3168
+ _openclaw_pairing_list() {
3169
+ _arguments -C \
3170
+ "--channel[Channel ()]" \
3171
+ "--json[Print JSON]"
3172
+ }
3173
+
3174
+ _openclaw_pairing_approve() {
3175
+ _arguments -C \
3176
+ "--channel[Channel ()]" \
3177
+ "--notify[Notify the requester on the same channel]"
3178
+ }
3179
+
3180
+ _openclaw_pairing() {
3181
+ local -a commands
3182
+ local -a options
3183
+
3184
+ _arguments -C \
3185
+ \
3186
+ "1: :_values 'command' 'list[List pending pairing requests]' 'approve[Approve a pairing code and allow that sender]'" \
3187
+ "*::arg:->args"
3188
+
3189
+ case $state in
3190
+ (args)
3191
+ case $line[1] in
3192
+ (list) _openclaw_pairing_list ;;
3193
+ (approve) _openclaw_pairing_approve ;;
3194
+ esac
3195
+ ;;
3196
+ esac
3197
+ }
3198
+
3199
+ _openclaw_plugins_list() {
3200
+ _arguments -C \
3201
+ "--json[Print JSON]" \
3202
+ "--enabled[Only show enabled plugins]" \
3203
+ "--verbose[Show detailed entries]"
3204
+ }
3205
+
3206
+ _openclaw_plugins_info() {
3207
+ _arguments -C \
3208
+ "--json[Print JSON]"
3209
+ }
3210
+
3211
+ _openclaw_plugins_enable() {
3212
+ _arguments -C \
3213
+
3214
+ }
3215
+
3216
+ _openclaw_plugins_disable() {
3217
+ _arguments -C \
3218
+
3219
+ }
3220
+
3221
+ _openclaw_plugins_install() {
3222
+ _arguments -C \
3223
+ "(--link -l)"{--link,-l}"[Link a local path instead of copying]"
3224
+ }
3225
+
3226
+ _openclaw_plugins_update() {
3227
+ _arguments -C \
3228
+ "--all[Update all tracked plugins]" \
3229
+ "--dry-run[Show what would change without writing]"
3230
+ }
3231
+
3232
+ _openclaw_plugins_doctor() {
3233
+ _arguments -C \
3234
+
3235
+ }
3236
+
3237
+ _openclaw_plugins() {
3238
+ local -a commands
3239
+ local -a options
3240
+
3241
+ _arguments -C \
3242
+ \
3243
+ "1: :_values 'command' 'list[List discovered plugins]' 'info[Show plugin details]' 'enable[Enable a plugin in config]' 'disable[Disable a plugin in config]' 'install[Install a plugin (path, archive, or npm spec)]' 'update[Update installed plugins (npm installs only)]' 'doctor[Report plugin load issues]'" \
3244
+ "*::arg:->args"
3245
+
3246
+ case $state in
3247
+ (args)
3248
+ case $line[1] in
3249
+ (list) _openclaw_plugins_list ;;
3250
+ (info) _openclaw_plugins_info ;;
3251
+ (enable) _openclaw_plugins_enable ;;
3252
+ (disable) _openclaw_plugins_disable ;;
3253
+ (install) _openclaw_plugins_install ;;
3254
+ (update) _openclaw_plugins_update ;;
3255
+ (doctor) _openclaw_plugins_doctor ;;
3256
+ esac
3257
+ ;;
3258
+ esac
3259
+ }
3260
+
3261
+ _openclaw_channels_list() {
3262
+ _arguments -C \
3263
+ "--no-usage[Skip model provider usage/quota snapshots]" \
3264
+ "--json[Output JSON]"
3265
+ }
3266
+
3267
+ _openclaw_channels_status() {
3268
+ _arguments -C \
3269
+ "--probe[Probe channel credentials]" \
3270
+ "--timeout[Timeout in ms]" \
3271
+ "--json[Output JSON]"
3272
+ }
3273
+
3274
+ _openclaw_channels_capabilities() {
3275
+ _arguments -C \
3276
+ "--channel[Channel (all|telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon)]" \
3277
+ "--account[Account id (only with --channel)]" \
3278
+ "--target[Channel target for permission audit (Discord channel:<id>)]" \
3279
+ "--timeout[Timeout in ms]" \
3280
+ "--json[Output JSON]"
3281
+ }
3282
+
3283
+ _openclaw_channels_resolve() {
3284
+ _arguments -C \
3285
+ "--channel[Channel (telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon)]" \
3286
+ "--account[Account id (accountId)]" \
3287
+ "--kind[Target kind (auto|user|group)]" \
3288
+ "--json[Output JSON]"
3289
+ }
3290
+
3291
+ _openclaw_channels_logs() {
3292
+ _arguments -C \
3293
+ "--channel[Channel (all|telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon)]" \
3294
+ "--lines[Number of lines (default: 200)]" \
3295
+ "--json[Output JSON]"
3296
+ }
3297
+
3298
+ _openclaw_channels_add() {
3299
+ _arguments -C \
3300
+ "--channel[Channel (telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon)]" \
3301
+ "--account[Account id (default when omitted)]" \
3302
+ "--name[Display name for this account]" \
3303
+ "--token[Bot token (Telegram/Discord)]" \
3304
+ "--token-file[Bot token file (Telegram)]" \
3305
+ "--bot-token[Slack bot token (xoxb-...)]" \
3306
+ "--app-token[Slack app token (xapp-...)]" \
3307
+ "--signal-number[Signal account number (E.164)]" \
3308
+ "--cli-path[CLI path (signal-cli or imsg)]" \
3309
+ "--db-path[iMessage database path]" \
3310
+ "--service[iMessage service (imessage|sms|auto)]" \
3311
+ "--region[iMessage region (for SMS)]" \
3312
+ "--auth-dir[WhatsApp auth directory override]" \
3313
+ "--http-url[Signal HTTP daemon base URL]" \
3314
+ "--http-host[Signal HTTP host]" \
3315
+ "--http-port[Signal HTTP port]" \
3316
+ "--webhook-path[Webhook path (Google Chat/BlueBubbles)]" \
3317
+ "--webhook-url[Google Chat webhook URL]" \
3318
+ "--audience-type[Google Chat audience type (app-url|project-number)]" \
3319
+ "--audience[Google Chat audience value (app URL or project number)]" \
3320
+ "--homeserver[Matrix homeserver URL]" \
3321
+ "--user-id[Matrix user ID]" \
3322
+ "--access-token[Matrix access token]" \
3323
+ "--password[Matrix password]" \
3324
+ "--device-name[Matrix device name]" \
3325
+ "--initial-sync-limit[Matrix initial sync limit]" \
3326
+ "--ship[Tlon ship name (~sampel-palnet)]" \
3327
+ "--url[Tlon ship URL]" \
3328
+ "--code[Tlon login code]" \
3329
+ "--group-channels[Tlon group channels (comma-separated)]" \
3330
+ "--dm-allowlist[Tlon DM allowlist (comma-separated ships)]" \
3331
+ "--auto-discover-channels[Tlon auto-discover group channels]" \
3332
+ "--no-auto-discover-channels[Disable Tlon auto-discovery]" \
3333
+ "--use-env[Use env token (default account only)]"
3334
+ }
3335
+
3336
+ _openclaw_channels_remove() {
3337
+ _arguments -C \
3338
+ "--channel[Channel (telegram|whatsapp|discord|googlechat|slack|signal|imessage|feishu|nostr|msteams|mattermost|nextcloud-talk|matrix|bluebubbles|line|zalo|zalouser|tlon)]" \
3339
+ "--account[Account id (default when omitted)]" \
3340
+ "--delete[Delete config entries (no prompt)]"
3341
+ }
3342
+
3343
+ _openclaw_channels_login() {
3344
+ _arguments -C \
3345
+ "--channel[Channel alias (default: whatsapp)]" \
3346
+ "--account[Account id (accountId)]" \
3347
+ "--verbose[Verbose connection logs]"
3348
+ }
3349
+
3350
+ _openclaw_channels_logout() {
3351
+ _arguments -C \
3352
+ "--channel[Channel alias (default: whatsapp)]" \
3353
+ "--account[Account id (accountId)]"
3354
+ }
3355
+
3356
+ _openclaw_channels() {
3357
+ local -a commands
3358
+ local -a options
3359
+
3360
+ _arguments -C \
3361
+ \
3362
+ "1: :_values 'command' 'list[List configured channels + auth profiles]' 'status[Show gateway channel status (use status --deep for local)]' 'capabilities[Show provider capabilities (intents/scopes + supported features)]' 'resolve[Resolve channel/user names to IDs]' 'logs[Show recent channel logs from the gateway log file]' 'add[Add or update a channel account]' 'remove[Disable or delete a channel account]' 'login[Link a channel account (if supported)]' 'logout[Log out of a channel session (if supported)]'" \
3363
+ "*::arg:->args"
3364
+
3365
+ case $state in
3366
+ (args)
3367
+ case $line[1] in
3368
+ (list) _openclaw_channels_list ;;
3369
+ (status) _openclaw_channels_status ;;
3370
+ (capabilities) _openclaw_channels_capabilities ;;
3371
+ (resolve) _openclaw_channels_resolve ;;
3372
+ (logs) _openclaw_channels_logs ;;
3373
+ (add) _openclaw_channels_add ;;
3374
+ (remove) _openclaw_channels_remove ;;
3375
+ (login) _openclaw_channels_login ;;
3376
+ (logout) _openclaw_channels_logout ;;
3377
+ esac
3378
+ ;;
3379
+ esac
3380
+ }
3381
+
3382
+ _openclaw_directory_self() {
3383
+ _arguments -C \
3384
+ "--channel[Channel (auto when only one is configured)]" \
3385
+ "--account[Account id (accountId)]" \
3386
+ "--json[Output JSON]"
3387
+ }
3388
+
3389
+ _openclaw_directory_peers_list() {
3390
+ _arguments -C \
3391
+ "--channel[Channel (auto when only one is configured)]" \
3392
+ "--account[Account id (accountId)]" \
3393
+ "--json[Output JSON]" \
3394
+ "--query[Optional search query]" \
3395
+ "--limit[Limit results]"
3396
+ }
3397
+
3398
+ _openclaw_directory_peers() {
3399
+ local -a commands
3400
+ local -a options
3401
+
3402
+ _arguments -C \
3403
+ \
3404
+ "1: :_values 'command' 'list[List peers]'" \
3405
+ "*::arg:->args"
3406
+
3407
+ case $state in
3408
+ (args)
3409
+ case $line[1] in
3410
+ (list) _openclaw_directory_peers_list ;;
3411
+ esac
3412
+ ;;
3413
+ esac
3414
+ }
3415
+
3416
+ _openclaw_directory_groups_list() {
3417
+ _arguments -C \
3418
+ "--channel[Channel (auto when only one is configured)]" \
3419
+ "--account[Account id (accountId)]" \
3420
+ "--json[Output JSON]" \
3421
+ "--query[Optional search query]" \
3422
+ "--limit[Limit results]"
3423
+ }
3424
+
3425
+ _openclaw_directory_groups_members() {
3426
+ _arguments -C \
3427
+ "--group-id[Group id]" \
3428
+ "--channel[Channel (auto when only one is configured)]" \
3429
+ "--account[Account id (accountId)]" \
3430
+ "--json[Output JSON]" \
3431
+ "--limit[Limit results]"
3432
+ }
3433
+
3434
+ _openclaw_directory_groups() {
3435
+ local -a commands
3436
+ local -a options
3437
+
3438
+ _arguments -C \
3439
+ \
3440
+ "1: :_values 'command' 'list[List groups]' 'members[List group members]'" \
3441
+ "*::arg:->args"
3442
+
3443
+ case $state in
3444
+ (args)
3445
+ case $line[1] in
3446
+ (list) _openclaw_directory_groups_list ;;
3447
+ (members) _openclaw_directory_groups_members ;;
3448
+ esac
3449
+ ;;
3450
+ esac
3451
+ }
3452
+
3453
+ _openclaw_directory() {
3454
+ local -a commands
3455
+ local -a options
3456
+
3457
+ _arguments -C \
3458
+ \
3459
+ "1: :_values 'command' 'self[Show the current account user]' 'peers[Peer directory (contacts/users)]' 'groups[Group directory]'" \
3460
+ "*::arg:->args"
3461
+
3462
+ case $state in
3463
+ (args)
3464
+ case $line[1] in
3465
+ (self) _openclaw_directory_self ;;
3466
+ (peers) _openclaw_directory_peers ;;
3467
+ (groups) _openclaw_directory_groups ;;
3468
+ esac
3469
+ ;;
3470
+ esac
3471
+ }
3472
+
3473
+ _openclaw_security_audit() {
3474
+ _arguments -C \
3475
+ "--deep[Attempt live Gateway probe (best-effort)]" \
3476
+ "--fix[Apply safe fixes (tighten defaults + chmod state/config)]" \
3477
+ "--json[Print JSON]"
3478
+ }
3479
+
3480
+ _openclaw_security() {
3481
+ local -a commands
3482
+ local -a options
3483
+
3484
+ _arguments -C \
3485
+ \
3486
+ "1: :_values 'command' 'audit[Audit config + local state for common security foot-guns]'" \
3487
+ "*::arg:->args"
3488
+
3489
+ case $state in
3490
+ (args)
3491
+ case $line[1] in
3492
+ (audit) _openclaw_security_audit ;;
3493
+ esac
3494
+ ;;
3495
+ esac
3496
+ }
3497
+
3498
+ _openclaw_skills_list() {
3499
+ _arguments -C \
3500
+ "--json[Output as JSON]" \
3501
+ "--eligible[Show only eligible (ready to use) skills]" \
3502
+ "(--verbose -v)"{--verbose,-v}"[Show more details including missing requirements]"
3503
+ }
3504
+
3505
+ _openclaw_skills_info() {
3506
+ _arguments -C \
3507
+ "--json[Output as JSON]"
3508
+ }
3509
+
3510
+ _openclaw_skills_check() {
3511
+ _arguments -C \
3512
+ "--json[Output as JSON]"
3513
+ }
3514
+
3515
+ _openclaw_skills() {
3516
+ local -a commands
3517
+ local -a options
3518
+
3519
+ _arguments -C \
3520
+ \
3521
+ "1: :_values 'command' 'list[List all available skills]' 'info[Show detailed information about a skill]' 'check[Check which skills are ready vs missing requirements]'" \
3522
+ "*::arg:->args"
3523
+
3524
+ case $state in
3525
+ (args)
3526
+ case $line[1] in
3527
+ (list) _openclaw_skills_list ;;
3528
+ (info) _openclaw_skills_info ;;
3529
+ (check) _openclaw_skills_check ;;
3530
+ esac
3531
+ ;;
3532
+ esac
3533
+ }
3534
+
3535
+ _openclaw_update_wizard() {
3536
+ _arguments -C \
3537
+ "--timeout[Timeout for each update step in seconds (default: 1200)]"
3538
+ }
3539
+
3540
+ _openclaw_update_status() {
3541
+ _arguments -C \
3542
+ "--json[Output result as JSON]" \
3543
+ "--timeout[Timeout for update checks in seconds (default: 3)]"
3544
+ }
3545
+
3546
+ _openclaw_update() {
3547
+ local -a commands
3548
+ local -a options
3549
+
3550
+ _arguments -C \
3551
+ "--json[Output result as JSON]" \
3552
+ "--no-restart[Skip restarting the gateway service after a successful update]" \
3553
+ "--channel[Persist update channel (git + npm)]" \
3554
+ "--tag[Override npm dist-tag or version for this update]" \
3555
+ "--timeout[Timeout for each update step in seconds (default: 1200)]" \
3556
+ "--yes[Skip confirmation prompts (non-interactive)]" \
3557
+ "1: :_values 'command' 'wizard[Interactive update wizard]' 'status[Show update channel and version status]'" \
3558
+ "*::arg:->args"
3559
+
3560
+ case $state in
3561
+ (args)
3562
+ case $line[1] in
3563
+ (wizard) _openclaw_update_wizard ;;
3564
+ (status) _openclaw_update_status ;;
3565
+ esac
3566
+ ;;
3567
+ esac
3568
+ }
3569
+
3570
+
3571
+ compdef _openclaw_root_completion openclaw