From 08caf7b9fc50890a2f99b410051f1df9aee22b70 Mon Sep 17 00:00:00 2001 From: LK Date: Thu, 8 Jan 2026 13:41:32 +0100 Subject: [PATCH] feat(commands): add /usage alias for /status --- docs/cli/index.md | 2 +- docs/tools/slash-commands.md | 23 ++--------------------- src/auto-reply/command-detection.test.ts | 2 ++ src/auto-reply/commands-registry.test.ts | 2 ++ src/auto-reply/commands-registry.ts | 2 +- 5 files changed, 8 insertions(+), 23 deletions(-) diff --git a/docs/cli/index.md b/docs/cli/index.md index 272a3a64f..5abfdf62c 100644 --- a/docs/cli/index.md +++ b/docs/cli/index.md @@ -377,7 +377,7 @@ Options: Clawdbot can surface provider usage/quota when OAuth/API creds are available. Surfaces: -- `/status` (adds a short usage line when available) +- `/status` (alias: `/usage`; adds a short usage line when available) - `clawdbot status --usage` (prints full provider breakdown) - macOS menu bar (Usage section under Context) diff --git a/docs/tools/slash-commands.md b/docs/tools/slash-commands.md index f35c0db70..d8e29444f 100644 --- a/docs/tools/slash-commands.md +++ b/docs/tools/slash-commands.md @@ -35,8 +35,7 @@ Directives (`/think`, `/verbose`, `/reasoning`, `/elevated`) are parsed even whe Text + native (when enabled): - `/help` -- `/status` -- `/debug show|set|unset|reset` (runtime overrides, owner-only) +- `/status` (alias: `/usage`) - `/cost on|off` (toggle per-response usage line) - `/stop` - `/restart` @@ -47,7 +46,7 @@ Text + native (when enabled): - `/verbose on|off` (alias: `/v`) - `/reasoning on|off|stream` (alias: `/reason`; `stream` = Telegram draft only) - `/elevated on|off` (alias: `/elev`) -- `/model ` (or `/` from `agents.defaults.models.*.alias`) +- `/model ` (or `/` from `agent.models.*.alias`) - `/queue ` (plus options like `debounce:2s cap:25 drop:summarize`; send `/queue` to see current settings) Text-only: @@ -60,24 +59,6 @@ Notes: - `/verbose` is meant for debugging and extra visibility; keep it **off** in normal use. - `/reasoning` (and `/verbose`) are risky in group settings: they may reveal internal reasoning or tool output you did not intend to expose. Prefer leaving them off, especially in group chats. -## Debug overrides - -`/debug` lets you set **runtime-only** config overrides (memory, not disk). Owner-only. - -Examples: - -``` -/debug show -/debug set messages.responsePrefix="[clawdbot]" -/debug set whatsapp.allowFrom=["+1555","+4477"] -/debug unset messages.responsePrefix -/debug reset -``` - -Notes: -- Overrides apply immediately to new config reads, but do **not** write to `clawdbot.json`. -- Use `/debug reset` to clear all overrides and return to the on-disk config. - ## Surface notes - **Text commands** run in the normal chat session (DMs share `main`, groups have their own session). diff --git a/src/auto-reply/command-detection.test.ts b/src/auto-reply/command-detection.test.ts index e8a14a898..fe8ec2f92 100644 --- a/src/auto-reply/command-detection.test.ts +++ b/src/auto-reply/command-detection.test.ts @@ -44,6 +44,8 @@ describe("control command parsing", () => { expect(hasControlCommand("help")).toBe(false); expect(hasControlCommand("/status")).toBe(true); expect(hasControlCommand("/status:")).toBe(true); + expect(hasControlCommand("/usage")).toBe(true); + expect(hasControlCommand("/usage:")).toBe(true); expect(hasControlCommand("status")).toBe(false); }); diff --git a/src/auto-reply/commands-registry.test.ts b/src/auto-reply/commands-registry.test.ts index fc270ab08..3d0a8eae6 100644 --- a/src/auto-reply/commands-registry.test.ts +++ b/src/auto-reply/commands-registry.test.ts @@ -24,6 +24,8 @@ describe("commands registry", () => { expect(detection.exact.has("/help")).toBe(true); expect(detection.regex.test("/status")).toBe(true); expect(detection.regex.test("/status:")).toBe(true); + expect(detection.regex.test("/usage")).toBe(true); + expect(detection.regex.test("/usage:")).toBe(true); expect(detection.regex.test("/stop")).toBe(true); expect(detection.regex.test("/send:")).toBe(true); expect(detection.regex.test("/debug set foo=bar")).toBe(true); diff --git a/src/auto-reply/commands-registry.ts b/src/auto-reply/commands-registry.ts index 4f3ec4ef4..bbdda249f 100644 --- a/src/auto-reply/commands-registry.ts +++ b/src/auto-reply/commands-registry.ts @@ -25,7 +25,7 @@ const CHAT_COMMANDS: ChatCommandDefinition[] = [ key: "status", nativeName: "status", description: "Show current status.", - textAliases: ["/status"], + textAliases: ["/status", "/usage"], }, { key: "debug",