npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dihak/pix-pretty

v1.7.23

Published

Enhanced tool output rendering with syntax highlighting, file icons, tree views, diff rendering, and FFF search

Readme

pix-pretty

Rendering and formatting library for Pi Coding Agent with syntax highlighting, file icons, tree views, FFF search integration, and gate-dialog overlay.

What it does

This package is a library + a small extension that other pix packages consume. It does not register user-facing tools itself — the tool renderers (pix-read, pix-bash, pix-ls, pix-find, pix-grep, pix-edit, pix-write) import from it. The extension entry point (src/index.ts) only initializes the syntax-highlight theme from Pi settings, clears the highlight cache, seeds the icon mode from pix.json, and registers two FFF slash commands (/fff-health, /fff-rescan) once pix-grep has brought the FFF finder online. The /pix settings command lives in pix-data. (Activated by pix-core; not a standalone extension.)

Rendering

  • Syntax highlightingcli-highlight (highlight.js-backed)
  • File icons — type-aware icons in ls/find output
  • Tree views — hierarchical directory display for ls
  • Diff rendering — side-by-side split diff for edit/write
  • Bash exit summary — colored status, line count, truncation notice

Icon catalog (l10n-style)

Icons are treated like a localization catalog: packages never hardcode glyph codepoints — they ask for a semantic role and the catalog resolves it against one global icon mode. Reskinning, or fixing a missing-glyph (“tofu”) problem on terminals without a Nerd Font, becomes a one-file edit here.

  • ./icon-catalogicon(key) resolves a semantic key ("cwd", "model", "paste.image", …) to a glyph for the active mode. Modes: nerd (Nerd Font PUA, default), unicode (standard BMP glyphs, no patched font needed), ascii (plain letters). Also iconFor(key, mode), getIconMode(), setIconMode(), ICON_KEYS, ICON_MODES.
  • ./icon-persist — reads/writes the icon mode via pix.json (pretty.icons); initIconMode() applies it on load.
  • /pix (in pix-data) — unified settings overlay that includes the icon mode switch. One global knob governs every pix-* package (footer, paste chips, model picker, welcome banner). Seeded from PRETTY_ICONS (none/offascii) when no choice is saved.

Shared overlay

  • Gate overlay (./gate-overlay) — the one permission-dialog component shared by pix-gate and pix-sudo. Two modes: confirm (SelectList) and sudo (SelectList + masked password). Returns { action: "approved" | "denied" | "timeout", password? }. Padded with Box paddingX=2, paddingY=1. The simpler ./confirm export is the plain boolean Yes/No dialog.

UI features that used to live here have moved to pix-display: paste chip rendering and reasoning-tag (<think>/<thinking>) → native thinking content blocks.

Install

pi install npm:@dihak/pix-pretty

Configuration

Configuration is read from ~/.pi/agent/pix.json (the unified config file hosted by @dihak/pix-data/pix-config). The pretty section of that file sets the defaults for theme, icon mode, and preview lines. Environment variables still override pix.json values.

Note: pix-config.ts and collapse.ts previously shipped with pix-pretty — they have moved to pix-data (@dihak/pix-data/pix-config and @dihak/pix-data/collapse). Update any direct imports.

pix.jsonpretty section

{
  "pretty": {
    "syntaxTheme": "monokai",       // syntax-highlight theme
    "icons": "nerd",          // nerd | unicode | ascii
    "maxPreviewLines": 50,
    "diffColors": true
  }
}

Environment Variables (override pix.json)

  • PRETTY_THEME — color theme for syntax highlighting
  • PRETTY_MAX_HL_CHARS — max characters to highlight (default: 80000)
  • PRETTY_MAX_PREVIEW_LINES — max lines in preview output
  • PRETTY_CACHE_LIMIT — FFF cache size limit
  • PRETTY_ICONS — default icon mode when none is persisted: nerd (default), unicode, ascii, or none/off (→ ascii). Note: this seeds the file-icon helpers AND the semantic icon catalog. Overridden by the /pix settings command.
  • PRETTY_MAX_RENDER_LINES — max lines in edit/write diff render (default: 150)
  • PRETTY_FFF_DIR — override FFF state dir (default: ~/.cache/pi/fff)

Public exports

The package exposes its sub-modules via exports:

@dihak/pix-pretty            (default — extension entry)
@dihak/pix-pretty/ansi
@dihak/pix-pretty/confirm
@dihak/pix-pretty/progress
@dihak/pix-pretty/config
@dihak/pix-pretty/diff
@dihak/pix-pretty/diff-render
@dihak/pix-pretty/highlight
@dihak/pix-pretty/lang
@dihak/pix-pretty/icons
@dihak/pix-pretty/icon-catalog
@dihak/pix-pretty/icon-persist
@dihak/pix-pretty/renderers
@dihak/pix-pretty/fff
@dihak/pix-pretty/types
@dihak/pix-pretty/utils
@dihak/pix-pretty/resize
@dihak/pix-pretty/context
@dihak/pix-pretty/gate-overlay
@dihak/pix-pretty/modal-frame

Full distro

Source: github.com/dihak/pix-mono

To install the complete pix suite (all packages + Pi itself):

curl -fsSL https://raw.githubusercontent.com/dihak/pix-mono/main/scripts/install.sh | sh

License

MIT