@xynogen/pix-pretty
Enhanced tool output rendering with syntax highlighting, file icons, tree views, FFF search, and paste chip formatting
Package details
Install @xynogen/pix-pretty from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@xynogen/pix-pretty- Package
@xynogen/pix-pretty- Version
1.3.3- Published
- Jun 12, 2026
- Downloads
- not available
- Author
- xynogen
- License
- MIT
- Types
- extension
- Size
- 177.9 KB
- Dependencies
- 3 dependencies · 2 peers
Pi manifest JSON
{
"extensions": [
"./src/index.ts",
"./src/paste-chips.ts",
"./src/thinking.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pix-pretty
Complete rendering and formatting solution for Pi Coding Agent with syntax highlighting, file icons, tree views, FFF search, paste chip formatting, and reasoning tag cleanup.
Features
Tool Output Rendering
- Syntax highlighting - Uses
cli-highlight(highlight.js-backed) for code blocks - File icons - Visual file type indicators in ls/find output
- Tree views - Hierarchical directory display
- FFF search - Fast full-text search integration with
@ff-labs/fff-node - Diff rendering - Enhanced git diff and edit/write tool output
- Image metadata - Display image dimensions and format info
- Bash exit summary - Command status and timing info
Paste Chip Formatting
- Image path collapsing - Converts
/tmp/pi-clipboard-abc.png→[paste image #1] - Text paste markers - Long pasted text →
[paste text +42 lines] - Atomic deletion - Delete entire paste markers as single units
- Type-aware labels - Visual distinction between image and text pastes
Reasoning Tag Rendering
- Collapsible display - Renders leaked
<think>/<thinking>tags as collapsible HTML details blocks - Visual distinction - Uses ⚙ icon to clearly mark reasoning content
- Non-intrusive - Only processes finalized messages, no live mutation
- Context-efficient - Collapsible format minimizes visual clutter (toggle with ctrl+o in Pi agent)
Installation
pi install git:github.com/xynogen/pix-pretty
Configuration
Environment Variables
Tool rendering:
PRETTY_THEME- Color theme for syntax highlightingPRETTY_MAX_HL_CHARS- Max characters to highlight (default: 50000)PRETTY_MAX_PREVIEW_LINES- Max lines in preview outputPRETTY_CACHE_LIMIT- FFF cache size limitPRETTY_ICONS- Enable/disable file iconsPRETTY_DISABLE_TOOLS- Comma-separated list of tools to skip renderingPRETTY_IMAGE_PROTOCOL- Protocol for image display (tmux passthrough)PRETTY_FFF_DIR- Override FFF state dir (default:~/.cache/pi/fff)
Architecture
This package combines two rendering systems:
- Tool output rendering (
src/index.ts) - Intercepts read/bash/ls/find/grep/multi_grep tools - Paste chip formatting (
src/paste-chips.ts) - Custom editor component for paste markers
Both work independently but complement each other for a cohesive visual experience.
Origin
Tool rendering replaced npm:@heyhuynhgiabuu/pi-pretty (which was previously replaced by npm:@heyhuynhgiabuu/pi-diff). This package is a clean reimplementation — no code was copied directly. Developed independently; changes are not submitted back and upstream changes are not pulled in.
Key divergences from upstream:
- Highlight engine: shiki → cli-highlight - Simpler, no WASM, synchronous
- FFF state dir -
~/.pi/agent/pi-pretty/fff→~/.cache/pi/fff(XDG cache) - Split diff view for edit/write tools - Full side-by-side diff with gutter, line numbers, syntax highlighting
- Paste chip formatting - Custom editor component for Pi's paste marker system (not in upstream)
- Reasoning tag rendering - Collapsible
<think>/<thinking>blocks (not in upstream)
Paste chip formatting and reasoning tag rendering are original additions with no upstream equivalent.
License
MIT - See LICENSE file