Shape the harness in C#
Add tools, slash commands, shortcuts, renderers and lifecycle hooks with a plain C# class. Package it for NuGet and share it.
Native C# extensions
Implement IPiSharpExtension, register what you need, and ship a NuGet package. In-process, typed, no Node.
Pi extensions via the Node bridge
Run existing TypeScript extensions in a supervised Node worker. Support is tiered, and anything unsupported is reported at startup instead of being silently ignored.
Bridge compatibility →Same extension, two languages
The sample todo extension is ported from Pi's own example. If you've written one for Pi, you already know the shape.
export default function (pi: ExtensionAPI) { pi.registerTool({ name: "todo", label: "Todo", description: "Manage a todo list. …", parameters: TodoParams, async execute(_id, params, …) { switch (params.action) { /* … */ } }, }); }
public sealed class StatefulTodoExtension : IPiSharpExtension { public ValueTask InitializeAsync( IExtensionRegistry registry, CancellationToken ct) { registry.RegisterTool(new("todo", "todo", Description, JsonData.Parse(ParametersJson), ExecuteAsync)); return ValueTask.CompletedTask; } }
Samples
A todo tool whose state is rebuilt from the current session branch, so it stays correct when you branch.
PORTED FROM PI · TOOLRegisters a /checkpoint command, a session-start observer and a pre-switch handler that saves and restores session checkpoints.
Community extensions
A catalog of community extensions published to NuGet will appear here. Building one? Open an issue on GitHub so it can be listed.