docs: add /config get alias

This commit is contained in:
Peter Steinberger
2026-01-10 03:02:39 +01:00
parent 2dc7872ad1
commit 5a6ae2624e
3 changed files with 8 additions and 1 deletions

View File

@@ -39,7 +39,7 @@ Text + native (when enabled):
- `/status` - `/status`
- `/status` (show current status; includes a short usage line when available) - `/status` (show current status; includes a short usage line when available)
- `/usage` (alias: `/status`) - `/usage` (alias: `/status`)
- `/config show|set|unset` (persist config to disk, owner-only) - `/config show|get|set|unset` (persist config to disk, owner-only)
- `/debug show|set|unset|reset` (runtime overrides, owner-only) - `/debug show|set|unset|reset` (runtime overrides, owner-only)
- `/cost on|off` (toggle per-response usage line) - `/cost on|off` (toggle per-response usage line)
- `/stop` - `/stop`
@@ -92,6 +92,7 @@ Examples:
``` ```
/config show /config show
/config show messages.responsePrefix /config show messages.responsePrefix
/config get messages.responsePrefix
/config set messages.responsePrefix="[clawdbot]" /config set messages.responsePrefix="[clawdbot]"
/config unset messages.responsePrefix /config unset messages.responsePrefix
``` ```

View File

@@ -10,6 +10,10 @@ describe("parseConfigCommand", () => {
action: "show", action: "show",
path: "foo.bar", path: "foo.bar",
}); });
expect(parseConfigCommand("/config get foo.bar")).toEqual({
action: "show",
path: "foo.bar",
});
expect(parseConfigCommand("/config unset foo.bar")).toEqual({ expect(parseConfigCommand("/config unset foo.bar")).toEqual({
action: "unset", action: "unset",
path: "foo.bar", path: "foo.bar",

View File

@@ -20,6 +20,8 @@ export function parseConfigCommand(raw: string): ConfigCommand | null {
switch (action) { switch (action) {
case "show": case "show":
return { action: "show", path: args || undefined }; return { action: "show", path: args || undefined };
case "get":
return { action: "show", path: args || undefined };
case "unset": { case "unset": {
if (!args) if (!args)
return { action: "error", message: "Usage: /config unset path" }; return { action: "error", message: "Usage: /config unset path" };