@giladbarnea/pi-pretty-bash

Rich Bash command and result displays with syntax-colored commands and JSON output.

Packages

Package details

extension

Install @giladbarnea/pi-pretty-bash from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@giladbarnea/pi-pretty-bash
Package
@giladbarnea/pi-pretty-bash
Version
1.0.5
Published
Nov 2, 2026
Downloads
473/mo · 75/wk
Author
giladbarnea
License
MIT
Types
extension
Size
154.2 KB
Dependencies
1 dependency · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README


last_updated: 2026-11-02T20-46

pi-pretty-bash

Bash tool calls should look like Bash.

pi extension npm version license TypeScript

pi-pretty-bash gives Bash commands and results a compact boxed display with theme-aware syntax colors.

Install

pi install npm:@giladbarnea/pi-pretty-bash

Alternatively, install from Git with pi install git:github.com/giladbarnea/pi-pretty-bash, or use pi install /path/to/pi-pretty-bash for development. Enable only one copy, then start a new Pi session or run /reload.

Rich Bash layout without replacing the Bash tool

Short commands get syntax colors in the header. Multiline commands get numbered boxes, and long commands wrap without losing their end. Result boxes show status, elapsed time and line counts. Collapsed results show ten visual tail rows; expansion shows the complete returned text.

The Bash palette preserves the former personal bash-rich-highlight choices, including function colors for built-ins. It uses cli-highlight with Pi theme colors, not the former HTML parser or hardcoded installation paths.

Complete valid JSON up to 200 KiB gets Pi's JSON colors without reformatting. Larger JSON, partial output and unrecognized formats stay plain. Rendering never cuts or changes the result sent to the model. Failure captions use Pi's error flag, not text that merely resembles an exit-status message.

Source-provided terminal formatting and control characters are removed before display. The renderer then applies its own colors; tool results and programmatic data remain unchanged.

The extension uses registerToolRenderer() without replacing Bash parameters or execution. Timers stop when calls finish, the agent run ends or the session shuts down.

Compatibility

pi-pretty-bash supports Pi 1.4.* and 1.5.*. Other extensions can own the Bash tool and add parameters without changing this rendering. If another extension also draws Bash, load pretty-bash first to select this display. Broader terminal-layout extensions may still style the surrounding tool block.

License

MIT