Skip to content

Commit 3704069

Browse files
committed
docs(slack): native slash command examples
1 parent 5fbc95e commit 3704069

1 file changed

Lines changed: 291 additions & 16 deletions

File tree

‎docs/channels/slack.md‎

Lines changed: 291 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,274 @@ openclaw gateway
283283
</Tabs>
284284

285285
<AccordionGroup>
286+
<Accordion title="Optional native slash commands">
287+
288+
Multiple [native slash commands](#commands-and-slash-behavior) can be used instead of a single configured command with nuance:
289+
290+
- Use `/agentstatus` instead of `/status` because the `/status` command is reserved.
291+
- No more than 25 slash commands can be made available at once.
292+
293+
Replace your existing `features.slash_commands` section with a subset of [available commands](/tools/slash-commands#command-list):
294+
295+
<Tabs>
296+
<Tab title="Socket Mode (default)">
297+
298+
```json
299+
"slash_commands": [
300+
{
301+
"command": "/new",
302+
"description": "Start a new session",
303+
"usage_hint": "[model]"
304+
},
305+
{
306+
"command": "/reset",
307+
"description": "Reset the current session"
308+
},
309+
{
310+
"command": "/compact",
311+
"description": "Compact the session context",
312+
"usage_hint": "[instructions]"
313+
},
314+
{
315+
"command": "/stop",
316+
"description": "Stop the current run"
317+
},
318+
{
319+
"command": "/session",
320+
"description": "Manage thread-binding expiry",
321+
"usage_hint": "idle <duration|off> or max-age <duration|off>"
322+
},
323+
{
324+
"command": "/think",
325+
"description": "Set the thinking level",
326+
"usage_hint": "<off|minimal|low|medium|high|xhigh>"
327+
},
328+
{
329+
"command": "/verbose",
330+
"description": "Toggle verbose output",
331+
"usage_hint": "on|off|full"
332+
},
333+
{
334+
"command": "/fast",
335+
"description": "Show or set fast mode",
336+
"usage_hint": "[status|on|off]"
337+
},
338+
{
339+
"command": "/reasoning",
340+
"description": "Toggle reasoning visibility",
341+
"usage_hint": "[on|off|stream]"
342+
},
343+
{
344+
"command": "/elevated",
345+
"description": "Toggle elevated mode",
346+
"usage_hint": "[on|off|ask|full]"
347+
},
348+
{
349+
"command": "/exec",
350+
"description": "Show or set exec defaults",
351+
"usage_hint": "host=<auto|sandbox|gateway|node> security=<deny|allowlist|full> ask=<off|on-miss|always> node=<id>"
352+
},
353+
{
354+
"command": "/model",
355+
"description": "Show or set the model",
356+
"usage_hint": "[name|#|status]"
357+
},
358+
{
359+
"command": "/models",
360+
"description": "List providers or models for a provider",
361+
"usage_hint": "[provider] [page] [limit=<n>|size=<n>|all]"
362+
},
363+
{
364+
"command": "/help",
365+
"description": "Show the short help summary"
366+
},
367+
{
368+
"command": "/commands",
369+
"description": "Show the generated command catalog"
370+
},
371+
{
372+
"command": "/tools",
373+
"description": "Show what the current agent can use right now",
374+
"usage_hint": "[compact|verbose]"
375+
},
376+
{
377+
"command": "/agentstatus",
378+
"description": "Show runtime status, including provider usage/quota when available"
379+
},
380+
{
381+
"command": "/tasks",
382+
"description": "List active/recent background tasks for the current session"
383+
},
384+
{
385+
"command": "/context",
386+
"description": "Explain how context is assembled",
387+
"usage_hint": "[list|detail|json]"
388+
},
389+
{
390+
"command": "/whoami",
391+
"description": "Show your sender identity"
392+
},
393+
{
394+
"command": "/skill",
395+
"description": "Run a skill by name",
396+
"usage_hint": "<name> [input]"
397+
},
398+
{
399+
"command": "/btw",
400+
"description": "Ask a side question without changing session context",
401+
"usage_hint": "<question>"
402+
},
403+
{
404+
"command": "/usage",
405+
"description": "Control the usage footer or show cost summary",
406+
"usage_hint": "off|tokens|full|cost"
407+
}
408+
]
409+
```
410+
411+
</Tab>
412+
<Tab title="HTTP Request URLs">
413+
414+
```json
415+
"slash_commands": [
416+
{
417+
"command": "/new",
418+
"description": "Start a new session",
419+
"usage_hint": "[model]",
420+
"url": "https://gateway-host.example.com/slack/events"
421+
},
422+
{
423+
"command": "/reset",
424+
"description": "Reset the current session",
425+
"url": "https://gateway-host.example.com/slack/events"
426+
},
427+
{
428+
"command": "/compact",
429+
"description": "Compact the session context",
430+
"usage_hint": "[instructions]",
431+
"url": "https://gateway-host.example.com/slack/events"
432+
},
433+
{
434+
"command": "/stop",
435+
"description": "Stop the current run",
436+
"url": "https://gateway-host.example.com/slack/events"
437+
},
438+
{
439+
"command": "/session",
440+
"description": "Manage thread-binding expiry",
441+
"usage_hint": "idle <duration|off> or max-age <duration|off>",
442+
"url": "https://gateway-host.example.com/slack/events"
443+
},
444+
{
445+
"command": "/think",
446+
"description": "Set the thinking level",
447+
"usage_hint": "<off|minimal|low|medium|high|xhigh>",
448+
"url": "https://gateway-host.example.com/slack/events"
449+
},
450+
{
451+
"command": "/verbose",
452+
"description": "Toggle verbose output",
453+
"usage_hint": "on|off|full",
454+
"url": "https://gateway-host.example.com/slack/events"
455+
},
456+
{
457+
"command": "/fast",
458+
"description": "Show or set fast mode",
459+
"usage_hint": "[status|on|off]",
460+
"url": "https://gateway-host.example.com/slack/events"
461+
},
462+
{
463+
"command": "/reasoning",
464+
"description": "Toggle reasoning visibility",
465+
"usage_hint": "[on|off|stream]",
466+
"url": "https://gateway-host.example.com/slack/events"
467+
},
468+
{
469+
"command": "/elevated",
470+
"description": "Toggle elevated mode",
471+
"usage_hint": "[on|off|ask|full]",
472+
"url": "https://gateway-host.example.com/slack/events"
473+
},
474+
{
475+
"command": "/exec",
476+
"description": "Show or set exec defaults",
477+
"usage_hint": "host=<auto|sandbox|gateway|node> security=<deny|allowlist|full> ask=<off|on-miss|always> node=<id>",
478+
"url": "https://gateway-host.example.com/slack/events"
479+
},
480+
{
481+
"command": "/model",
482+
"description": "Show or set the model",
483+
"usage_hint": "[name|#|status]",
484+
"url": "https://gateway-host.example.com/slack/events"
485+
},
486+
{
487+
"command": "/models",
488+
"description": "List providers or models for a provider",
489+
"usage_hint": "[provider] [page] [limit=<n>|size=<n>|all]",
490+
"url": "https://gateway-host.example.com/slack/events"
491+
},
492+
{
493+
"command": "/help",
494+
"description": "Show the short help summary",
495+
"url": "https://gateway-host.example.com/slack/events"
496+
},
497+
{
498+
"command": "/commands",
499+
"description": "Show the generated command catalog",
500+
"url": "https://gateway-host.example.com/slack/events"
501+
},
502+
{
503+
"command": "/tools",
504+
"description": "Show what the current agent can use right now",
505+
"usage_hint": "[compact|verbose]",
506+
"url": "https://gateway-host.example.com/slack/events"
507+
},
508+
{
509+
"command": "/agentstatus",
510+
"description": "Show runtime status, including provider usage/quota when available",
511+
"url": "https://gateway-host.example.com/slack/events"
512+
},
513+
{
514+
"command": "/tasks",
515+
"description": "List active/recent background tasks for the current session",
516+
"url": "https://gateway-host.example.com/slack/events"
517+
},
518+
{
519+
"command": "/context",
520+
"description": "Explain how context is assembled",
521+
"usage_hint": "[list|detail|json]",
522+
"url": "https://gateway-host.example.com/slack/events"
523+
},
524+
{
525+
"command": "/whoami",
526+
"description": "Show your sender identity",
527+
"url": "https://gateway-host.example.com/slack/events"
528+
},
529+
{
530+
"command": "/skill",
531+
"description": "Run a skill by name",
532+
"usage_hint": "<name> [input]",
533+
"url": "https://gateway-host.example.com/slack/events"
534+
},
535+
{
536+
"command": "/btw",
537+
"description": "Ask a side question without changing session context",
538+
"usage_hint": "<question>",
539+
"url": "https://gateway-host.example.com/slack/events"
540+
},
541+
{
542+
"command": "/usage",
543+
"description": "Control the usage footer or show cost summary",
544+
"usage_hint": "off|tokens|full|cost",
545+
"url": "https://gateway-host.example.com/slack/events"
546+
}
547+
]
548+
```
549+
550+
</Tab>
551+
</Tabs>
552+
553+
</Accordion>
286554
<Accordion title="Optional authorship scopes (write operations)">
287555
Add the `chat:write.customize` bot scope if you want outgoing messages to use the active agent identity (custom username and icon) instead of the default Slack app identity.
288556

@@ -536,30 +804,37 @@ Notes:
536804

537805
## Commands and slash behavior
538806

539-
- Native command auto-mode is **off** for Slack (`commands.native: "auto"` does not enable Slack native commands).
540-
- Enable native Slack command handlers with `channels.slack.commands.native: true` (or global `commands.native: true`).
541-
- When native commands are enabled, register matching slash commands in Slack (`/<command>` names), with one exception:
542-
- register `/agentstatus` for the status command (Slack reserves `/status`)
543-
- If native commands are not enabled, you can run a single configured slash command via `channels.slack.slashCommand`.
544-
- Native arg menus now adapt their rendering strategy:
545-
- up to 5 options: button blocks
546-
- 6-100 options: static select menu
547-
- more than 100 options: external select with async option filtering when interactivity options handlers are available
548-
- if encoded option values exceed Slack limits, the flow falls back to buttons
549-
- For long option payloads, Slash command argument menus use a confirm dialog before dispatching a selected value.
550-
551-
Default slash command settings:
807+
Slash commands appear in Slack as either a single configured command or multiple native commands. Configure `channels.slack.slashCommand` to change command defaults:
552808

553809
- `enabled: false`
554810
- `name: "openclaw"`
555811
- `sessionPrefix: "slack:slash"`
556812
- `ephemeral: true`
557813

558-
Slash sessions use isolated keys:
814+
```txt
815+
/openclaw /help
816+
```
817+
818+
Native commands require [manifest changes](#optional-native-slash-commands) to your Slack app and are enabled with `channels.slack.commands.native: true` or `commands.native: true` in global configurations instead.
819+
820+
- Native command auto-mode is **off** for Slack so `commands.native: "auto"` does not enable Slack native commands.
821+
822+
```txt
823+
/help
824+
```
825+
826+
Native argument menus use an adaptive rendering strategy that shows a confirmation modal before dispatching a selected option value:
559827

560-
- `agent:<agentId>:slack:slash:<userId>`
828+
- up to 5 options: button blocks
829+
- 6-100 options: static select menu
830+
- more than 100 options: external select with async option filtering when interactivity options handlers are available
831+
- exceeded Slack limits: encoded option values fall back to buttons
832+
833+
```txt
834+
/think
835+
```
561836

562-
and still route command execution against the target conversation session (`CommandTargetSessionKey`).
837+
Slash sessions use isolated keys like `agent:<agentId>:slack:slash:<userId>` and still route command executions to the target conversation session using `CommandTargetSessionKey`.
563838

564839
## Interactive replies
565840

0 commit comments

Comments
 (0)