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-cny-cost

v0.1.4

Published

Pi extension to display model costs in CNY (Chinese Yuan)

Readme

pi-cny-cost

A Pi extension that displays model token costs in CNY (Chinese Yuan) instead of USD.

Features

  • Adds a cny-cost command to toggle a widget showing total cost in ¥ (below the editor, doesn't replace the footer)
  • Built-in footer with token stats and context usage remains intact
  • Built-in CNY prices for:
    • DeepSeek — deepseek-v4-flash, deepseek-v4-pro
    • MiniMax — MiniMax-M2, M2.1, M2.5, M2.7 and highspeed variants
    • Xiaomi MiMo — mimo-v2.5-pro, mimo-v2-pro, mimo-v2.5, mimo-v2-omni, mimo-v2-flash
  • Customizable via ~/.pi/agent/cny.json:
    • Override the USD→CNY exchange rate (default: 7.25)
    • Add or override per-model CNY prices
    • Set rate to 0 to disable USD conversion entirely
  • Falls back to USD cost × exchange rate for models without built-in CNY prices

Installation

Via Pi (recommended)

Install the package globally using pi:

pi install npm:pi-cny-cost

Or install it for your project (adds to .pi/settings.json):

pi install -l npm:pi-cny-cost

Manual installation

Then add the extension to your Pi config (e.g. ~/.pi/agent/config.json):

{
  "extensions": ["path/to/pi-cny-cost"]
}

Or if you have it in your project's package.json:

{
  "pi": {
    "extensions": ["./index.ts"]
  }
}

Usage

In the Pi TUI, run:

/cny-cost

This toggles a widget below the editor showing:

CNY cost: ¥1.23

The built-in footer with token stats and context usage remains unchanged:

↑273k ↓13k R172k 12.9%/262k (auto)   model-name

Configuration

Create or edit ~/.pi/agent/cny.json:

{
  "rate": 7.25,
  "providers": {
    "openai": {
      "modelOverrides": {
        "gpt-4o": {
          "cnyCost": {
            "input": 18.125,
            "output": 72.5,
            "cacheRead": 3.625,
            "cacheWrite": 18.125
          }
        }
      }
    },
    "anthropic": {
      "models": [
        {
          "id": "claude-sonnet-4-20250514",
          "cnyCost": {
            "input": 22.5,
            "output": 112.5,
            "cacheRead": 2.25,
            "cacheWrite": 22.5
          }
        }
      ]
    }
  }
}

Config options

| Field | Type | Default | Description | |-------|------|---------|-------------| | rate | number | 7.25 | USD→CNY exchange rate for automatic conversion. Set to 0 to disable. | | providers | object | {} | Per-provider model overrides. |

Resolution priority

  1. cny.json explicit cnyCost (per provider, matching provider:modelId)
  2. Built-in CNY prices (exact values from vendor, scoped to provider)
  3. Model's USD cost × exchange rate (skipped if rate is 0)
  4. No cost shown

License

MIT