Add clear command to Pi

This commit is contained in:
Nicholas Novak
2026-10-08 22:28:32 +00:00
parent 89d5b993d5
commit b418c31211
+16
View File
@@ -0,0 +1,16 @@
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
/**
* /clear — alias for /new.
*
* Starts a new session, discarding the current conversation history
* (the same behaviour as the built-in `/new`).
*/
export default function (pi: ExtensionAPI) {
pi.registerCommand("clear", {
description: "Start a new session (alias for /new)",
handler: async (_args, ctx) => {
await ctx.newSession();
},
});
}