Pilot CLI
A terminal AI coding agent in TypeScript, with tool calling, an approval prompt and an eval suite that scores how well it picks tools.
- 0.778 → 1.0tool-selection scorefile-tools eval set
- Solobuilt end to endloop, tools, UI, evals
- Tracedevery eval runin Laminar
Why I built it
AI coding assistants feel like black boxes. I wanted to build one myself to understand how an agent decides which tool to call, and to measure whether it calls the right one.
All of it, solo
- 1Agent loop
- 2Tool definitions
- 3Terminal UI
- 4Approval prompt
- 5Eval suite
How a prompt moves through Pilot
- Ink terminaluser prompt
- AgentAI SDK + Gemini
- Approvaly / n prompt
- ToolsZod schemas
The agent sends the prompt and Zod-typed tool schemas to Gemini through the Vercel AI SDK. Tool calls go through an approval prompt in the Ink UI before they run. The eval suite replays a dataset against mocked tools and scores tool selection with a precision/recall (F1-style) evaluator.
The model kept picking the wrong file tool
My file-tools eval scored tool selection at 0.778. The cause was vague tool descriptions, not the model: after rewriting the readFile and listFiles descriptions so each one says exactly when to use it, the score went to 1.0. Try it.
Press exact to rewrite readFile and listFiles.
› show me src/agent.tsEvery run is traced in Laminar, so a regression shows up as a lower score.
Cables not plugged in yet
- Make the loop multi-turn
- Approval prompt on every file and shell tool
- Evals for tool ordering and forbidden-tool avoidance