Skip to content

Instantly share code, notes, and snippets.

@alexcamlo
Created June 12, 2026 07:43
Show Gist options
  • Select an option

  • Save alexcamlo/2393aeb9a1339255a10d4146e79e3321 to your computer and use it in GitHub Desktop.

Select an option

Save alexcamlo/2393aeb9a1339255a10d4146e79e3321 to your computer and use it in GitHub Desktop.
Pi extension: quit with :q
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
export default function (pi: ExtensionAPI) {
pi.on("input", async (event, ctx) => {
if (event.source === "extension") return { action: "continue" };
if (event.text.trim() !== ":q") return { action: "continue" };
ctx.shutdown();
return { action: "handled" };
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment