pi-codex-style-tools
v0.1.0
Published
Codex-style inline rendering for Pi's built-in tools
Maintainers
Readme
pi-codex-style-tools
Codex-like inline rendering for Pi's built-in tools.
pi-codex-style-tools is a Pi package that keeps tool execution unchanged
while rendering it with a Codex-like presentation: inline bullets, Running/Ran
labels, shell highlighting, │ and └ gutters, compact output previews, and
expandable details. Search results from extensions are normalized to source URLs.
Installation
After the package is published to npm:
pi install npm:pi-codex-style-toolsOr install it directly from the public repository:
pi install git:github.com/DanielSuhett/pi-codex-styleFor local development:
pi -e ./index.tsRestart Pi or run /reload after installing the package.
What it changes
The extension overrides only the visual renderer for bash, read, grep,
find, ls, edit, and write. Tool execution remains delegated to Pi's
original built-in implementations. Search-like tool results from extensions are
compactly rewritten to source links while preserving their details.
- Consecutive file operations are grouped into one row.
- Read and grep previews stay inline.
- Read content gets a bordered, path-aware syntax highlight with a 10-line preview.
- Short diffs up to 20 lines are shown inline; longer diffs remain expandable.
- Bash output follows the tail, up to 10 lines, and highlights Git statistics.
- Empty successful output stays hidden to keep the transcript compact.
- Search results from Firecrawl, Tavily, Brave, SerpAPI, and similar tools show only source URLs.
Performance
Renderer output is cached by tool result and theme. Syntax highlighting is limited to the visible read preview, and expanded output is capped at 200 lines with an expansion hint. This keeps repeated TUI redraws cheap and avoids large tool results blocking Pi's event loop.
Development
Requirements: Node.js >=22.6.0, npm, and a compatible Pi installation.
npm ci
npm run verifyRun the Pi-hosted renderer benchmark separately:
npm run benchThe benchmark reports cold and steady render times for the overridden tools and event-loop lag.
Package structure
index.ts Pi extension entry point
bench/renderer-bench.ts renderer benchmark
.github/workflows/ci.yml tests, types, packaging, and Pi installation smoke testThe package manifest declares index.ts under pi.extensions, includes the
pi-package keyword for package discovery, and keeps Pi core packages as peer
dependencies as required by the Pi package documentation.
Contributing
See CONTRIBUTING.md for the development workflow and
standards. The project also includes a code of conduct and issue templates.
Security
See SECURITY.md for private vulnerability reporting.
License
MIT © 2026 Suhett.
