Whistle
Define one command once and get a key binding, palette entry, slash command, and AI-agent tool for it, all calling the same typed function and failing the same way.
Fastest path
Install
Add it to your project with npm, pnpm, Yarn or Bun.
TERMINAL npm install @fungi.computer/whistle @opentui/keymapExecute a contributed command
Contributes one command, runs it through execute, and prints its handled outcome.
home.ts import { createWhistle } from "@fungi.computer/whistle";const whistle = createWhistle();whistle.contribute({sourceId: "editor",namespace: "editor",commands: [{id: "save",title: "Save file",category: "File",handler: () => ({ saved: true }),},],});const outcome = await whistle.execute({ namespace: "editor", id: "save" },{ origin: "palette" },);if (outcome.status === "handled") console.log(outcome.result); // { saved: true }whistle.close();