Skip to main content
Pi extension tools and commands are the primary way to extend what the Aether agent can do. Tools are called by the LLM during an agent turn; commands are invoked by the user with a / prefix.

Registering a command

Use pi.registerCommand to add a slash command. The handler receives the parsed arguments and a context object that exposes, among other things, ctx.ui.notify for surfacing feedback to the user.
agent.ts

Registering a tool

Use pi.registerTool to expose a callable function to the LLM. Provide a JSON-Schema parameters block so the model knows what arguments to supply, and return any serialisable value from the handler.
Name tools descriptively — the LLM reads the description field to decide when to invoke a tool, so a precise, action-oriented description directly affects how reliably the tool is used.
agent.ts
Pi tools registered by an extension become available to the LLM in every agent turn where the extension is loaded.

Combined Pi + Aether extension

A single package can serve both Pi (agent tools and commands) and Aether (Android UI and app logic). Keep the Pi factory as the default export and export the Aether factory as activateAether. The example below is drawn directly from the bundled aether-extension sample.
agent.ts
The Pi command (aether-example) is active whenever the package is loaded in a Pi session. The Aether factory runs inside the Android host and has access to the full AetherExtensionAPI — surfaces, pages, state, storage, actions, and host bridges — while the Pi factory is limited to Pi’s agent-turn API.