feat: add /clear as alias for /new slash command (#59)
Registers /clear as a command that calls ctx.newSession(), identical to /new. Shows in autocomplete when typing /cl with 'Alias for /new' description.
This commit is contained in:
parent
7b28162ade
commit
3b9a8c1c63
2 changed files with 12 additions and 0 deletions
10
src/resources/extensions/slash-commands/clear.ts
Normal file
10
src/resources/extensions/slash-commands/clear.ts
Normal file
|
|
@ -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();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue