diff --git a/src/resources/extensions/slash-commands/clear.ts b/src/resources/extensions/slash-commands/clear.ts new file mode 100644 index 000000000..75e21f878 --- /dev/null +++ b/src/resources/extensions/slash-commands/clear.ts @@ -0,0 +1,10 @@ +import type { ExtensionAPI, ExtensionCommandContext } from "@mariozechner/pi-coding-agent"; + +export default function clearCommand(pi: ExtensionAPI) { + pi.registerCommand("clear", { + description: "Alias for /new — start a new session", + async handler(_args: string, ctx: ExtensionCommandContext) { + await ctx.newSession(); + }, + }); +} diff --git a/src/resources/extensions/slash-commands/index.ts b/src/resources/extensions/slash-commands/index.ts index 6ea3c683a..8d3be0e02 100644 --- a/src/resources/extensions/slash-commands/index.ts +++ b/src/resources/extensions/slash-commands/index.ts @@ -3,10 +3,12 @@ import createSlashCommand from "./create-slash-command.js"; import createExtension from "./create-extension.js"; import auditCommand from "./audit.js"; import gsdRun from "./gsd-run.js"; +import clearCommand from "./clear.js"; export default function slashCommands(pi: ExtensionAPI) { createSlashCommand(pi); createExtension(pi); auditCommand(pi); gsdRun(pi); + clearCommand(pi); }