Files
Memoh/assets/getting-started_slash-commands.md.ChJs4d6R.js
2026-04-23 13:02:42 +00:00

2 lines
22 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{_ as e,o,c as d,ag as a}from"./chunks/framework.CAXxHpAX.js";const u=JSON.parse('{"title":"Slash Commands","description":"","frontmatter":{},"headers":[],"relativePath":"getting-started/slash-commands.md","filePath":"getting-started/slash-commands.md","lastUpdated":1776332711000}'),s={name:"getting-started/slash-commands.md"};function c(n,t,r,i,l,h){return o(),d("div",null,[...t[0]||(t[0]=[a('<h1 id="slash-commands" tabindex="-1">Slash Commands <a class="header-anchor" href="#slash-commands" aria-label="Permalink to &quot;Slash Commands&quot;"></a></h1><p>Memoh bots support <strong>slash commands</strong> that are intercepted before the LLM runs. They are intended for fast inspection and control tasks such as viewing settings, switching providers, checking session status, or creating a fresh session.</p><p>Slash commands work in channel adapters and in the built-in Web UI chat. They do not consume model tokens just to parse the command itself.</p><hr><h2 id="command-model" tabindex="-1">Command Model <a class="header-anchor" href="#command-model" aria-label="Permalink to &quot;Command Model&quot;"></a></h2><p>Most commands follow a resource-group pattern:</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>/resource [action] [arguments...]</span></span></code></pre></div><p>Examples:</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>/schedule list</span></span>\n<span class="line"><span>/model current</span></span>\n<span class="line"><span>/schedule create morning-news &quot;0 9 * * *&quot; &quot;Send a daily summary&quot;</span></span></code></pre></div><p>Key ideas:</p><ul><li><strong>resource</strong> is the command group, such as <code>schedule</code>, <code>model</code>, or <code>status</code>.</li><li><strong>action</strong> is the specific operation, such as <code>list</code>, <code>get</code>, <code>set</code>, or <code>latest</code>.</li><li><strong>arguments</strong> are positional values after the action. Use quotes when a value contains spaces.</li><li>Some groups have a <strong>default action</strong>, so <code>/settings</code> is equivalent to <code>/settings get</code>, and <code>/status</code> is equivalent to <code>/status show</code>.</li></ul><p>Two commands are <strong>top-level</strong> instead of resource groups:</p><ul><li><code>/new</code> — create a new session for the current conversation route</li><li><code>/stop</code> — abort the currently running generation for the current conversation</li></ul><hr><h2 id="built-in-help" tabindex="-1">Built-in Help <a class="header-anchor" href="#built-in-help" aria-label="Permalink to &quot;Built-in Help&quot;"></a></h2><p>The slash system has layered help built into it:</p><table tabindex="0"><thead><tr><th>Command</th><th>Meaning</th></tr></thead><tbody><tr><td><code>/help</code></td><td>Show the top-level command list</td></tr><tr><td><code>/help &lt;group&gt;</code></td><td>Show actions inside one group</td></tr><tr><td><code>/help &lt;group&gt; &lt;action&gt;</code></td><td>Show detailed usage for one action</td></tr></tbody></table><p>Examples:</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>/help</span></span>\n<span class="line"><span>/help model</span></span>\n<span class="line"><span>/help model set</span></span></code></pre></div><p>This is the fastest way to discover the exact live command surface for your current Memoh version.</p><hr><h2 id="parsing-rules" tabindex="-1">Parsing Rules <a class="header-anchor" href="#parsing-rules" aria-label="Permalink to &quot;Parsing Rules&quot;"></a></h2><p>Slash commands support a few convenience forms:</p><ul><li><strong>Mention-prefixed commands</strong> work in group chats, for example <code>@BotName /help</code>.</li><li><strong>Telegram bot suffixes</strong> are accepted, for example <code>/help@MemohBot</code>.</li><li>Quoted strings are preserved as one argument, for example:</li></ul><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>/schedule create morning-news &quot;0 9 * * *&quot; &quot;Send today&#39;s top stories&quot;</span></span></code></pre></div><p>If the text does not resolve to a known command, Memoh treats it as a normal chat message instead of a slash command.</p><hr><h2 id="permissions" tabindex="-1">Permissions <a class="header-anchor" href="#permissions" aria-label="Permalink to &quot;Permissions&quot;"></a></h2><p>Read-only actions are available to users who can already chat with the bot. Write actions such as <code>set</code>, <code>create</code>, <code>update</code>, <code>delete</code>, <code>enable</code>, and <code>disable</code> are <strong>owner-only</strong>.</p><p>In <code>/help</code> output, owner-only actions are marked with <code>[owner]</code>.</p><hr><h2 id="quick-reference" tabindex="-1">Quick Reference <a class="header-anchor" href="#quick-reference" aria-label="Permalink to &quot;Quick Reference&quot;"></a></h2><h3 id="top-level-commands" tabindex="-1">Top-Level Commands <a class="header-anchor" href="#top-level-commands" aria-label="Permalink to &quot;Top-Level Commands&quot;"></a></h3><table tabindex="0"><thead><tr><th>Command</th><th>Description</th></tr></thead><tbody><tr><td><code>/help</code></td><td>Show slash command help</td></tr><tr><td>`/new [chat</td><td>discuss]`</td></tr><tr><td><code>/stop</code></td><td>Stop the current generation</td></tr></tbody></table><h3 id="resource-groups" tabindex="-1">Resource Groups <a class="header-anchor" href="#resource-groups" aria-label="Permalink to &quot;Resource Groups&quot;"></a></h3><table tabindex="0"><thead><tr><th>Group</th><th>Description</th><th>Default Action</th></tr></thead><tbody><tr><td><code>/schedule</code></td><td>Manage scheduled tasks</td><td>None</td></tr><tr><td><code>/mcp</code></td><td>Inspect MCP connections</td><td>None</td></tr><tr><td><code>/settings</code></td><td>View and update bot settings</td><td><code>get</code></td></tr><tr><td><code>/model</code></td><td>View and switch bot models</td><td>None</td></tr><tr><td><code>/memory</code></td><td>View and switch memory providers</td><td>None</td></tr><tr><td><code>/search</code></td><td>View and switch search providers</td><td>None</td></tr><tr><td><code>/browser</code></td><td>View and switch browser contexts</td><td>None</td></tr><tr><td><code>/usage</code></td><td>View token usage</td><td><code>summary</code></td></tr><tr><td><code>/email</code></td><td>Inspect email providers, bindings, and outbox</td><td>None</td></tr><tr><td><code>/heartbeat</code></td><td>View recent heartbeat logs</td><td><code>logs</code></td></tr><tr><td><code>/skill</code></td><td>View loaded bot skills</td><td><code>list</code></td></tr><tr><td><code>/fs</code></td><td>Browse files inside the bot container</td><td>None</td></tr><tr><td><code>/status</code></td><td>Inspect session message/context/cache status</td><td><code>show</code></td></tr><tr><td><code>/access</code></td><td>Inspect identity, role, and ACL context</td><td><code>show</code></td></tr><tr><td><code>/compact</code></td><td>Trigger immediate session context compaction</td><td><code>run</code></td></tr></tbody></table><hr><h2 id="session-commands" tabindex="-1">Session Commands <a class="header-anchor" href="#session-commands" aria-label="Permalink to &quot;Session Commands&quot;"></a></h2><h3 id="new" tabindex="-1"><code>/new</code> <a class="header-anchor" href="#new" aria-label="Permalink to &quot;`/new`&quot;"></a></h3><p>Creates a fresh session for the current conversation route. It is the fastest way to reset conversational context without deleting old history.</p><p>Supported forms:</p><ul><li><code>/new</code> — use the default session type for the current context</li><li><code>/new chat</code> — force a normal chat session</li><li><code>/new discuss</code> — force a discuss session</li></ul><p>Default behavior:</p><ul><li><strong>Web UI local chat</strong> defaults to <code>chat</code></li><li><strong>Direct messages</strong> default to <code>chat</code></li><li><strong>Group conversations on channel adapters</strong> default to <code>discuss</code></li></ul><p><code>/new discuss</code> is not supported in the built-in Web UI local channel. Use a channel adapter such as Telegram or Discord if you want explicit discuss sessions.</p><p>See <a href="/getting-started/sessions.html">Sessions</a> for how <code>chat</code> and <code>discuss</code> differ.</p><h3 id="stop" tabindex="-1"><code>/stop</code> <a class="header-anchor" href="#stop" aria-label="Permalink to &quot;`/stop`&quot;"></a></h3><p>Stops the current in-progress generation for the current conversation. This is useful when:</p><ul><li>the bot is still streaming and you already have what you need</li><li>a tool loop is taking too long</li><li>you want to interrupt the current turn before sending a follow-up</li></ul><hr><h2 id="status-and-inspection-commands" tabindex="-1">Status And Inspection Commands <a class="header-anchor" href="#status-and-inspection-commands" aria-label="Permalink to &quot;Status And Inspection Commands&quot;"></a></h2><h3 id="status" tabindex="-1"><code>/status</code> <a class="header-anchor" href="#status" aria-label="Permalink to &quot;`/status`&quot;"></a></h3><p>Shows session-level runtime stats for the current conversation:</p><ul><li>message count</li><li>current context usage</li><li>cache hit rate</li><li>cache read/write tokens</li><li>used skills in the session</li></ul><p>Actions:</p><table tabindex="0"><thead><tr><th>Action</th><th>Usage</th></tr></thead><tbody><tr><td><code>show</code></td><td><code>/status</code> or <code>/status show</code></td></tr><tr><td><code>latest</code></td><td><code>/status latest</code></td></tr></tbody></table><p>Use <code>show</code> for the currently active conversation route. Use <code>latest</code> when you want the newest session for the bot even if the current route has no active session.</p><h3 id="access" tabindex="-1"><code>/access</code> <a class="header-anchor" href="#access" aria-label="Permalink to &quot;`/access`&quot;"></a></h3><p>Shows the current identity and permission context that Memoh is using for the command:</p><ul><li>channel identity</li><li>linked user</li><li>bot role</li><li>whether write commands are allowed</li><li>channel / conversation / thread scope</li><li>evaluated chat ACL result</li></ul><p>Usage:</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>/access</span></span></code></pre></div><p>This command is useful when debugging ACL rules, linked accounts, or why a write command was denied.</p><h3 id="usage" tabindex="-1"><code>/usage</code> <a class="header-anchor" href="#usage" aria-label="Permalink to &quot;`/usage`&quot;"></a></h3><p>Shows token usage for the last 7 days.</p><p>Actions:</p><table tabindex="0"><thead><tr><th>Action</th><th>Usage</th></tr></thead><tbody><tr><td><code>summary</code></td><td><code>/usage</code> or <code>/usage summary</code></td></tr><tr><td><code>by-model</code></td><td><code>/usage by-model</code></td></tr></tbody></table><h3 id="heartbeat" tabindex="-1"><code>/heartbeat</code> <a class="header-anchor" href="#heartbeat" aria-label="Permalink to &quot;`/heartbeat`&quot;"></a></h3><p>Shows the most recent heartbeat execution logs.</p><p>Actions:</p><table tabindex="0"><thead><tr><th>Action</th><th>Usage</th></tr></thead><tbody><tr><td><code>logs</code></td><td><code>/heartbeat</code> or <code>/heartbeat logs</code></td></tr></tbody></table><h3 id="email" tabindex="-1"><code>/email</code> <a class="header-anchor" href="#email" aria-label="Permalink to &quot;`/email`&quot;"></a></h3><p>Shows email-related configuration data for the current bot.</p><p>Actions:</p><table tabindex="0"><thead><tr><th>Action</th><th>Usage</th></tr></thead><tbody><tr><td><code>providers</code></td><td><code>/email providers</code></td></tr><tr><td><code>bindings</code></td><td><code>/email bindings</code></td></tr><tr><td><code>outbox</code></td><td><code>/email outbox</code></td></tr></tbody></table><hr><h2 id="configuration-commands" tabindex="-1">Configuration Commands <a class="header-anchor" href="#configuration-commands" aria-label="Permalink to &quot;Configuration Commands&quot;"></a></h2><h3 id="settings" tabindex="-1"><code>/settings</code> <a class="header-anchor" href="#settings" aria-label="Permalink to &quot;`/settings`&quot;"></a></h3><p>Shows or updates core bot settings.</p><p>Actions:</p><table tabindex="0"><thead><tr><th>Action</th><th>Usage</th><th>Permission</th></tr></thead><tbody><tr><td><code>get</code></td><td><code>/settings</code> or <code>/settings get</code></td><td>All</td></tr><tr><td><code>update</code></td><td><code>/settings update [options]</code></td><td>Owner</td></tr></tbody></table><p>Supported <code>update</code> options:</p><table tabindex="0"><thead><tr><th>Option</th><th>Description</th></tr></thead><tbody><tr><td><code>--language</code></td><td>Bot language, such as <code>en</code> or <code>zh</code></td></tr><tr><td><code>--acl_default_effect</code></td><td><code>allow</code> or <code>deny</code></td></tr><tr><td><code>--reasoning_enabled</code></td><td><code>true</code> or <code>false</code></td></tr><tr><td><code>--reasoning_effort</code></td><td><code>low</code>, <code>medium</code>, or <code>high</code></td></tr><tr><td><code>--heartbeat_enabled</code></td><td><code>true</code> or <code>false</code></td></tr><tr><td><code>--heartbeat_interval</code></td><td>Minutes</td></tr><tr><td><code>--chat_model_id</code></td><td>Chat model UUID</td></tr><tr><td><code>--heartbeat_model_id</code></td><td>Heartbeat model UUID</td></tr></tbody></table><p>Example:</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>/settings update --language en --heartbeat_enabled true --heartbeat_interval 30</span></span></code></pre></div><h3 id="model" tabindex="-1"><code>/model</code> <a class="header-anchor" href="#model" aria-label="Permalink to &quot;`/model`&quot;"></a></h3><p>Shows or switches the bot&#39;s chat and heartbeat models.</p><p>Actions:</p><table tabindex="0"><thead><tr><th>Action</th><th>Usage</th><th>Permission</th></tr></thead><tbody><tr><td><code>list [provider_name]</code></td><td><code>/model list</code></td><td>All</td></tr><tr><td><code>current</code></td><td><code>/model current</code></td><td>All</td></tr><tr><td><code>set</code></td><td><code>/model set &lt;model_id&gt;</code> or <code>/model set &lt;provider_name&gt; &lt;model_name&gt;</code></td><td>Owner</td></tr><tr><td><code>set-heartbeat</code></td><td><code>/model set-heartbeat &lt;model_id&gt;</code> or <code>/model set-heartbeat &lt;provider_name&gt; &lt;model_name&gt;</code></td><td>Owner</td></tr></tbody></table><p>Examples:</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>/model list</span></span>\n<span class="line"><span>/model list OpenAI</span></span>\n<span class="line"><span>/model current</span></span>\n<span class="line"><span>/model set gpt-4o</span></span>\n<span class="line"><span>/model set OpenAI gpt-4o</span></span></code></pre></div><h3 id="memory" tabindex="-1"><code>/memory</code> <a class="header-anchor" href="#memory" aria-label="Permalink to &quot;`/memory`&quot;"></a></h3><p>Shows or switches the active memory provider.</p><p>Actions:</p><table tabindex="0"><thead><tr><th>Action</th><th>Usage</th><th>Permission</th></tr></thead><tbody><tr><td><code>list</code></td><td><code>/memory list</code></td><td>All</td></tr><tr><td><code>current</code></td><td><code>/memory current</code></td><td>All</td></tr><tr><td><code>set</code></td><td><code>/memory set &lt;name&gt;</code></td><td>Owner</td></tr></tbody></table><h3 id="search" tabindex="-1"><code>/search</code> <a class="header-anchor" href="#search" aria-label="Permalink to &quot;`/search`&quot;"></a></h3><p>Shows or switches the active search provider.</p><p>Actions:</p><table tabindex="0"><thead><tr><th>Action</th><th>Usage</th><th>Permission</th></tr></thead><tbody><tr><td><code>list</code></td><td><code>/search list</code></td><td>All</td></tr><tr><td><code>current</code></td><td><code>/search current</code></td><td>All</td></tr><tr><td><code>set</code></td><td><code>/search set &lt;name&gt;</code></td><td>Owner</td></tr></tbody></table><h3 id="browser" tabindex="-1"><code>/browser</code> <a class="header-anchor" href="#browser" aria-label="Permalink to &quot;`/browser`&quot;"></a></h3><p>Shows or switches the active browser context.</p><p>Actions:</p><table tabindex="0"><thead><tr><th>Action</th><th>Usage</th><th>Permission</th></tr></thead><tbody><tr><td><code>list</code></td><td><code>/browser list</code></td><td>All</td></tr><tr><td><code>current</code></td><td><code>/browser current</code></td><td>All</td></tr><tr><td><code>set</code></td><td><code>/browser set &lt;name&gt;</code></td><td>Owner</td></tr></tbody></table><h3 id="mcp" tabindex="-1"><code>/mcp</code> <a class="header-anchor" href="#mcp" aria-label="Permalink to &quot;`/mcp`&quot;"></a></h3><p>Shows or deletes MCP connections configured for the bot.</p><p>Actions:</p><table tabindex="0"><thead><tr><th>Action</th><th>Usage</th><th>Permission</th></tr></thead><tbody><tr><td><code>list</code></td><td><code>/mcp list</code></td><td>All</td></tr><tr><td><code>get</code></td><td><code>/mcp get &lt;name&gt;</code></td><td>All</td></tr><tr><td><code>delete</code></td><td><code>/mcp delete &lt;name&gt;</code></td><td>Owner</td></tr></tbody></table><hr><h2 id="automation-and-filesystem-commands" tabindex="-1">Automation And Filesystem Commands <a class="header-anchor" href="#automation-and-filesystem-commands" aria-label="Permalink to &quot;Automation And Filesystem Commands&quot;"></a></h2><h3 id="schedule" tabindex="-1"><code>/schedule</code> <a class="header-anchor" href="#schedule" aria-label="Permalink to &quot;`/schedule`&quot;"></a></h3><p>Manages scheduled tasks for the bot.</p><p>Actions:</p><table tabindex="0"><thead><tr><th>Action</th><th>Usage</th><th>Permission</th></tr></thead><tbody><tr><td><code>list</code></td><td><code>/schedule list</code></td><td>All</td></tr><tr><td><code>get</code></td><td><code>/schedule get &lt;name&gt;</code></td><td>All</td></tr><tr><td><code>create</code></td><td><code>/schedule create &lt;name&gt; &lt;pattern&gt; &lt;command&gt;</code></td><td>Owner</td></tr><tr><td><code>update</code></td><td><code>/schedule update &lt;name&gt; [--pattern P] [--command C]</code></td><td>Owner</td></tr><tr><td><code>delete</code></td><td><code>/schedule delete &lt;name&gt;</code></td><td>Owner</td></tr><tr><td><code>enable</code></td><td><code>/schedule enable &lt;name&gt;</code></td><td>Owner</td></tr><tr><td><code>disable</code></td><td><code>/schedule disable &lt;name&gt;</code></td><td>Owner</td></tr></tbody></table><p>Examples:</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>/schedule list</span></span>\n<span class="line"><span>/schedule create morning-news &quot;0 9 * * *&quot; &quot;Summarize today&#39;s top tech news&quot;</span></span>\n<span class="line"><span>/schedule disable morning-news</span></span></code></pre></div><h3 id="skill" tabindex="-1"><code>/skill</code> <a class="header-anchor" href="#skill" aria-label="Permalink to &quot;`/skill`&quot;"></a></h3><p>Lists the currently available bot skills.</p><p>Actions:</p><table tabindex="0"><thead><tr><th>Action</th><th>Usage</th></tr></thead><tbody><tr><td><code>list</code></td><td><code>/skill</code> or <code>/skill list</code></td></tr></tbody></table><h3 id="fs" tabindex="-1"><code>/fs</code> <a class="header-anchor" href="#fs" aria-label="Permalink to &quot;`/fs`&quot;"></a></h3><p>Browses the bot container filesystem.</p><p>Actions:</p><table tabindex="0"><thead><tr><th>Action</th><th>Usage</th></tr></thead><tbody><tr><td><code>list</code></td><td><code>/fs list [path]</code></td></tr><tr><td><code>read</code></td><td><code>/fs read &lt;path&gt;</code></td></tr></tbody></table><p>Examples:</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>/fs list /</span></span>\n<span class="line"><span>/fs list /home</span></span>\n<span class="line"><span>/fs read /home/bot/IDENTITY.md</span></span></code></pre></div><p>Read output is truncated when the file is very large.</p><hr><h2 id="context-compaction-command" tabindex="-1">Context Compaction Command <a class="header-anchor" href="#context-compaction-command" aria-label="Permalink to &quot;Context Compaction Command&quot;"></a></h2><h3 id="compact" tabindex="-1"><code>/compact</code> <a class="header-anchor" href="#compact" aria-label="Permalink to &quot;`/compact`&quot;"></a></h3><p>Triggers immediate <strong>session context compaction</strong> for the current session. This is different from memory compaction:</p><ul><li><strong>context compaction</strong> reduces the active prompt/history footprint of one session</li><li><strong>memory compaction</strong> rewrites long-term memory entries in the memory provider</li></ul><p>Actions:</p><table tabindex="0"><thead><tr><th>Action</th><th>Usage</th></tr></thead><tbody><tr><td><code>run</code></td><td><code>/compact</code> or <code>/compact run</code></td></tr></tbody></table><p>Use this when the current conversation has grown long and you want Memoh to summarize older turns before continuing. See <a href="/getting-started/compaction.html">Context Compaction</a>.</p>',134)])])}const m=e(s,[["render",c]]);export{u as __pageData,m as default};