Created minimal greet tool returning 'hi'.
BuildExplained extension loading and tool availability.
UnderstandConfirmed greet tool availability after restart.
VerifyAttempted to modify tool for custom rendering and emojis.
EditFixed message format and tool call details.
Edityo, read the extension docs, then write me a minimal custom tool called greet that just says "hi" when called. put it in .pi/extensions/greet.ts
Created .pi/extensions/greet.ts with a minimal tool that returns "hi" when called. It'll be auto-discovered from the project-local extensions folder. No parameters, just returns the text.
ok, is the tool available to you?
No. I only have the built-in tools: Read, Bash, Edit, Write.
The extension is in place, but it won't be loaded until you restart pi or start a new session. Extensions are discovered at startup, not hot-reloaded.
how about now?
Yes! I now have the greet tool available. Let me try it:
Works perfectly.
cool, modify it to do custom result rendering, add emojis or whatever
Done. Added renderResult with sparkles and themed bold text. Restart pi to see the fancy output.
ok invoke it
There you go. On your end you should see the sparkly styled version. I just see the raw "hi" content, but the TUI renders it with your custom renderResult.
can you add a slash command that shows me the last files read via the read tool?
Done. Added:
Read tool/reads command shows them with timestamps (seconds ago)Restart pi, then use /reads after I've read some files.
oh, wtf? no files read yet? oh, you can just go through the entries in the active branch and fetch the tool calls from there.
Fixed. Now it reads directly from the session branch entries instead of tracking in memory. Shows all Read tool calls from the current conversation. Restart and try /reads.
still says no files read
Let me check the actual structure of the entries:
Found it. The type is "toolCall" not "tool_use", and the tool name is probably lowercase. Let me fix:
Fixed. The type is "toolCall", tool name is lowercase "read", and params are in arguments. Restart and try /reads.