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

pi-colours

v0.1.0

Published

Compact rich Markdown and active-theme syntax highlighting for Pi

Readme

Pi Colours

Compact Markdown and active-theme syntax colors for Pi.

npm version Pi package CI license

Pi Colours makes assistant messages, user Markdown, code blocks, and source-like Bash results easier to scan. It uses the active Pi theme. It does not force a dark or light palette.

Preview

Dark Pi theme

Pi Colours with the dark Pi theme

Light Pi theme

Pi Colours with the light Pi theme

The screenshots use the real Pi Markdown component and syntax highlighter. The preview includes compact Markdown and Go syntax colors for keywords, strings, and comments.

Install

Install from npm:

pi install npm:pi-colours

Or test the GitHub release without installation:

pi -e git:github.com/kevinpita/[email protected]

Restart Pi after installation. Use /reload after you change a local copy.

Try the built-in preview

Run this command in Pi:

/colours-preview

The preview shows:

  • compact Markdown headings;
  • links, emphasis, lists, quotes, and inline code;
  • labeled TypeScript and Go code;
  • automatic Python language detection;
  • dark or light colors from the active Pi theme.

Press Enter or Esc to close it.

What changes

| Output | Pi Colours behavior | | --- | --- | | Markdown headings | Uses compact ▌, ▸, •, and · markers. | | Fenced code | Uses a clean language frame instead of raw backticks. | | Labeled code | Supports aliases such as ts, tsx, py, sh, yml, c++, and c#. | | Unlabeled code | Detects a language only when the code has a clear structure. | | Bash results | Adds syntax colors when the command or output gives a safe language hint. | | Normal text | Keeps prose and normal command output plain. |

Pi already gives syntax colors to read and write previews and semantic colors to diffs. Pi Colours keeps that behavior.

Theme support

Pi Colours calls the syntax color functions from the active Pi theme. Select a theme with /settings.

For the best result, a custom theme must give different values to these Pi tokens:

  • syntaxComment
  • syntaxKeyword
  • syntaxFunction
  • syntaxVariable
  • syntaxString
  • syntaxNumber
  • syntaxType
  • syntaxOperator
  • syntaxPunctuation

If these tokens use the same color, code will look monochrome.

Highlighter choice

Pi 0.83 uses highlight.js in its Markdown renderer. Pi Colours uses this engine because it:

  • runs synchronously in the TUI;
  • supports many languages;
  • uses the active Pi theme;
  • does not need grammar downloads or native modules.

Tree-sitter needs many grammar files and a separate token-to-theme layer. TextMate and Shiki add a large fixed-theme system. They do not give a clear benefit for this terminal extension.

Coverage and limits

Pi Colours changes the shared Pi Markdown component. It applies to:

  • assistant Markdown;
  • user Markdown;
  • Pi components and extension results that use Markdown.

It also replaces the built-in Bash display renderer. It does not change Bash execution.

The public Pi API has no global renderer hook for plain results from every third-party tool. A third-party tool that uses its own Text component keeps its own display. That tool can use Pi's exported highlightCode() function.

Pi Colours patches one private method in the Pi TUI Markdown class because Pi has no public hook for standard assistant and user renderers. The extension checks that the method exists. If a later Pi version changes it, Pi Colours shows a warning and does not change message data.

Security

Pi extensions run with full user permissions. Review extension code before installation.

Pi Colours does not use the network, read project files, write project files, or start a background process. Its Bash override delegates execution to Pi's original Bash tool.

Development

Requirements:

  • Pi 0.83 or later
  • Node.js 22.19 or later
  • Chromium only when you regenerate screenshots

Run all checks:

npm install
npm run check
npm test
npm pack --dry-run

Regenerate the dark and light screenshots:

npm run screenshots

License

MIT