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-extension-diffs

v0.1.0

Published

Pi extension — /diffs command to view git changes in a native window

Downloads

97

Readme

pi-extension-diffs

A pi extension that adds a /diffs command to view git changes in a native macOS window.

Browse staged, unstaged, and untracked changes alongside branch commits — all rendered with syntax-highlighted diffs in a fast, native WKWebView window powered by Glimpse.

Features

  • /diffs command — opens a native macOS window showing all git changes
  • Commit navigator — browse up to 5 commits on your branch, or last 5 on main
  • Working changes — staged, unstaged, and untracked files grouped by section
  • Sidebar + tabs — click files to open as tabs, switch between them instantly
  • Syntax highlighting — full Shiki-powered highlighting via @pierre/diffs
  • Prewarm — hidden window pre-loads the viewer on startup for near-instant /diffs
  • Persistent window — updates in place if already open, re-preloads after close

Install

pi install pi-extension-diffs

Or add to your pi settings manually:

// ~/.pi/agent/settings.json
{
  "packages": [
    "pi-extension-diffs"
  ]
}

Then restart pi or run /reload.

Requirements

  • macOS — uses native WKWebView windows via Glimpse
  • git — must be in a git repository
  • bun — required for building the viewer bundle (runs automatically on install)

Usage

/diffs

That's it. The window shows:

  1. Commit list at the top of the sidebar — your branch's commits (vs main/master) or last 5 if on main
  2. Working Changes entry if you have uncommitted changes (staged/unstaged/untracked)
  3. File list below — click to open files as tabs with syntax-highlighted diffs

Switching between commits updates the file list. Tabs clear when you change commits.

Development

git clone https://github.com/HazAT/pi-extension-diffs.git
cd pi-extension-diffs
npm install  # installs deps + builds viewer bundle

To rebuild the viewer after making changes to src/viewer.tsx:

npm run build

Then point pi at your local clone:

// ~/.pi/agent/settings.json
{
  "packages": [
    "/path/to/pi-extension-diffs"
  ]
}

How it works

The extension has two parts:

  • src/index.ts — pi extension that registers /diffs, gathers git data, manages the Glimpse window, and injects data into the viewer
  • src/viewer.tsx — React app bundled into dist/viewer.js at build time, rendering diffs with @pierre/diffs components

On startup, a hidden window pre-loads the 10MB viewer bundle (which includes Shiki grammars for syntax highlighting). When you run /diffs, git data is injected and the window appears instantly.

License

MIT