diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-20 20:49:39 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-20 20:49:39 +0200 |
| commit | 097afe5a81849ea8a921286c887014e242fa3794 (patch) | |
| tree | 09b035931cbca6793b370c33a490f094d8315b37 /pi/agent/extensions/session-name/index.ts | |
| parent | e66e46fcc27aee1246f40b76fedd87d2138e6d15 (diff) | |
Add Pi extensions and usage docs
Diffstat (limited to 'pi/agent/extensions/session-name/index.ts')
| -rw-r--r-- | pi/agent/extensions/session-name/index.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pi/agent/extensions/session-name/index.ts b/pi/agent/extensions/session-name/index.ts new file mode 100644 index 0000000..330a1ee --- /dev/null +++ b/pi/agent/extensions/session-name/index.ts @@ -0,0 +1,18 @@ +import type { ExtensionAPI } from "@mariozechner/pi-coding-agent"; + +export default function (pi: ExtensionAPI) { + pi.registerCommand("session-name", { + description: "Set or show session name (usage: /session-name [new name])", + handler: async (args, ctx) => { + const name = args.trim(); + + if (name) { + pi.setSessionName(name); + ctx.ui.notify(`Session named: ${name}`, "info"); + } else { + const current = pi.getSessionName(); + ctx.ui.notify(current ? `Session: ${current}` : "No session name set", "info"); + } + }, + }); +} |
