Created greet tool extension returning 'hi'.
BuildUsed greet tool and confirmed output.
VerifyAdded custom tool call and result renderer with /reads command.
Buildi want you to create an extension .pi/extensions, called greet.ts. it should have a custom tool "greet" that just returns hi when called.
Created .pi/extensions/greet.ts with a greet tool that returns "hi" when called. The tool takes no parameters and will be auto-discovered when you run pi.
ok, use the tool
Done. The greet tool returned "hi".
ok, add a custom tool call and result renderer, just think about something simple
Updated the extension with custom renderers:
use the tool agian
Done. You should see the custom rendering with the 👋 and ✓ styled output.
add a /reads slash command, that goes through the active branch entries, and finds all assistant messages and the tool calls in them. and list the read files read via the read tool. you can find the types in @packages/ai/src/types.ts
Now I have the info I need. Let me update the extension:
Added the /reads command. It:
ctx.sessionManager.getBranch()Try it with /reads to see all files read in this session.