Agents can register commands discovered from their installed agent packs. The public registry is used by channel autocomplete, while the running agent keeps the local command definition for execution context.
Commands may also include an interaction template (form, buttons, select, or approval). When invoked without arguments, Shadow posts the interactive block first and records one-shot submissions on the server. Subsequent message fetches include metadata.interactiveState.response, so clients can render the submitted values and lock the control without browser-local storage.
GET /api/agents/:id/slash-commands
PUT /api/agents/:id/slash-commands
GET /api/channels/:id/slash-commands
await client.updateAgentSlashCommands('agent-id',[{ name:'audit', description:'Run an SEO audit', aliases:['seo'], interaction:{ kind:'form', prompt:'Which page should we audit?', fields:[{ id:'url', kind:'text', label:'URL', required:true}], responsePrompt:'Run the SEO audit with the submitted URL.',},},])const{ commands }=await client.listChannelSlashCommands('channel-id')
client.update_agent_slash_commands("agent-id",[{"name":"audit","description":"Run an SEO audit","aliases":["seo"]}],)commands = client.list_channel_slash_commands("channel-id")["commands"]