Install
Install with PiG
pig install npm:pi-content-compactInstall with Pi
pi install npm:pi-content-compactPackages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.
Pi manifest JSON
The pi field of package.json.
{
"extensions": [
"./extensions/pi-content-compact.ts"
]
}README
Written by the package's publisher, shown as published in version 0.2.2 (README.md). PiG does not review it.
pi-content-compact
pi-content-compact is a small Pi package that makes assistant Markdown easier to scan while preserving separate code blocks and Pi's native syntax highlighting.
Key features
- Assistant-only display — changes terminal presentation without modifying session files, model context, exports, or original messages.
- Compact single-line values — turns path, command, PID, and log values in complete single-line fences into inline code.
- Fence-free code blocks — hides
```json,```text, and similar wrapper rows while preserving separate blocks and Pi's native syntax highlighting. - Safe private patch — wraps
Markdown.prototype.renderTokenonly for assistant content, restores the original renderer on shutdown/reload, and falls back gracefully when Pi changes its internals. - Small, focused package — uses no runtime dependencies and does not replace tools, Bash, header, footer, or editor rendering.
For example, this assistant output:
- 工作目录:
```text
/Users/xiaomi/works/gd-ai-fde
```
- stdout:
```text
/tmp/service.stdout.log
```
is displayed as:
- 工作目录:`/Users/xiaomi/works/gd-ai-fde`
- stdout:`/tmp/service.stdout.log`
Multi-line and language-labeled blocks remain separate while the comparison image shows how the renderer hides their fence rows.
Install from GitHub
pi install git:github.com/laoshu133/pi-content-compact
After updating the package while Pi is running, use /reload.
For local development:
pi install .
npm test
npm run check
The package is discovered through package.json, which exposes extensions/pi-content-compact.ts as its Pi extension entry point.