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

@marshal/pi-turn-stats

v0.1.11

Published

pi extension: per-exchange duration, token & cost stats for conversations (stream card + status bar + /turnstats command)

Readme

@marshal/pi-turn-stats

A pi extension that automatically tracks per-exchange duration, token usage (input / output / cache read / cache write), and cost after every conversation turn.

Features

  • Stats card in conversation stream — After each reply, a stats card is appended to the stream (does not enter LLM context).
  • Real-time status bar — The bottom status bar shows the last exchange's duration, throughput, token count, and cost.
  • /turnstats command — Appends a session cumulative stats card (total exchanges, total LLM calls, total tokens, total cost).
  • Auto i18n — UI labels automatically switch between Chinese and English based on your system locale (LANG / LC_ALL / Intl).

Demo

Turn Stats Demo

Screenshots

Chinese (default)

Turn Stats

English (auto-detected from LANG=en)

Turn Stats EN

Installation

Recommended: Install via npm for stable access and install statistics.

# Install directly with pi
pi install npm:@marshal/pi-turn-stats

Or standard npm install:

npm install -g @marshal/pi-turn-stats

Note: pi install npm:... registers the extension globally. Plain npm install -g only downloads the package without registering it as a pi extension.

Alternative: Install from GitHub (for source access or custom modifications).

# Install from GitHub repo (SSH)
pi install git:[email protected]:MarshalW/pi-turn-stats

Users in China are encouraged to use the npm method, as GitHub access may be unreliable.

Notes

Statistics are stored locally only and are not uploaded to any server. Data is read from the running pi process's turn_end events and wall-clock timing.

Development

git clone [email protected]:MarshalW/pi-turn-stats.git
cd pi-turn-stats
pi install ./        # local install for testing

Release Process

git tag vX.Y.Z && git push origin main --tags
# Publish to npm: npm version patch && npm publish --access public
# Consumer install:
#   npm (recommended): pi install npm:@marshal/pi-turn-stats
#   git (fallback):    pi install git:[email protected]:MarshalW/[email protected]