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

@zenspc/pi-devtools

v0.4.0

Published

Context usage report, cwd switching (/cd), markdown preview (/preview), richer session footer, welcome header, and Dracula theme for Pi

Downloads

246

Readme

@zenspc/pi-devtools

Context usage report, working-directory switching, markdown preview, richer session footer, custom welcome header, and Dracula theme for Pi.

Install

pi install npm:@zenspc/pi-devtools

Local development:

pi -e ./packages/pi-devtools
pi install ./packages/pi-devtools

What you get

/cd and /pwd

Change Pi's project working directory without quitting the process.

Pi binds tools, project context (AGENTS.md), project settings/extensions (after trust), and the footer cwd to the session cwd. /cd prepares a session for the target directory and switches to it so the host rebuilds that runtime state (same idea as quit → cd → open Pi again).

/pwd
/cd
/cd <path>
/cd <path> --new
/cd <path> --fork

Behavior:

  • Default - resume the most recent session for <path> if one exists; otherwise create a new session there.
  • --new - always create a fresh session in <path> (still records the previous session as parentSession when available).
  • --fork - copy the current session history into a new session under <path> (requires a persisted current session file).
  • /cd with no path - print the current cwd and usage.
  • /pwd - print cwd and the active session file path.

Notes:

  • Paths may be absolute, relative to the current cwd, or start with ~.
  • The target must already exist and be a directory.
  • Switching into a project with local .pi / .agents resources may prompt for project trust (same as resume).
  • This is one active cwd at a time, not a multi-root workspace.
  • There is no LLM tool for /cd (command only).

/context

Detailed context usage report.

Shows startup context (system prompt, tools, context files, skills) and, once a conversation exists, LLM-facing entries with content-block breakdown.

Subcommands:

  • help
  • prompt - system prompt size (chars / tokens / lines)
  • prompt full - dump full system prompt text
  • memory [substr]
  • tools
  • json

In the TUI, /context prompt starts collapsed. Press e or space to expand or collapse the body.

Context overlays scroll inside the component (not via terminal scrollback), so they keep working when other extensions (for example sticky editor) own transcript scrolling:

  • ↑ / ↓, j / k, Ctrl+N / Ctrl+P - line scroll
  • PgUp / PgDn - page scroll
  • g / Home, G / End - jump top/bottom
  • Esc / Enter - close

Overlay content is never added to the model context.

Security note:

  • Default /context and /context prompt are size/metadata oriented (no full bodies).
  • prompt full, expanded TUI prompt view, and memory <substr> dump raw local content (system prompt and memory file bodies).
  • Those dumps can contain secrets, tokens, paths, or PII.
  • Overlay output is never added to the model context.
  • Prefer /context json when sharing a report.
  • Redact dumps before pasting into chats, tickets, or GitHub issues.
  • Large dumps are truncated for display (print mode and UI).

/context help repeats the same warnings.

/preview

Render a markdown file inside a scrollable overlay using Pi's own markdown renderer and the active theme. What you see matches how Pi renders assistant output.

/preview <path>
  • <path> may be relative to the cwd, absolute, or start with ~.
  • If the final path segment has no extension, .md is appended (/preview CONTRIBUTING finds CONTRIBUTING.md).

Key bindings:

  • ↑ / ↓, j / k - line scroll
  • PgUp / PgDn - page scroll
  • g / Home, G / End - jump top/bottom
  • r - reload the file from disk
  • Esc / q - close

Limits:

  • Files over 512 KiB are rejected.
  • TUI mode only.
  • Read-only; overlay content is never added to the model context.

Custom footer

Richer footer status for the active session, including response timing and cache-freshness heuristics.

PI_CACHE_RETENTION=long switches the cache TTL heuristic to the longer retention window.

Welcome header

Replaces the stock TUI header with the pi logo, key tips, the active model, and loaded resources (context, skills, prompts, extensions, themes). Stock resource-panel sections are hidden so they are not listed twice.

TUI mode only. Use the expand-tools binding (ctrl+o by default) to show the full resource lists.

Dracula theme

Ships the dracula theme. Select it with /settings or in settings:

{
  "theme": "dracula"
}

If you already have a local dracula theme, remove or rename that file so the package copy is the one pi loads.

Install only one extension

{
  "packages": [
    {
      "source": "npm:@zenspc/pi-devtools",
      "extensions": ["extensions/cd-command.ts"]
    }
  ]
}
{
  "packages": [
    {
      "source": "npm:@zenspc/pi-devtools",
      "extensions": ["extensions/context-command.ts"]
    }
  ]
}

Or:

{
  "packages": [
    {
      "source": "npm:@zenspc/pi-devtools",
      "extensions": ["extensions/custom-footer.ts"]
    }
  ]
}
{
  "packages": [
    {
      "source": "npm:@zenspc/pi-devtools",
      "extensions": ["extensions/welcome-header.ts"]
    }
  ]
}

Theme only:

{
  "packages": [
    {
      "source": "npm:@zenspc/pi-devtools",
      "extensions": [],
      "themes": ["themes/dracula.json"]
    }
  ]
}

Source

extensions/cd-command.ts
extensions/cd-helpers.mjs
extensions/context-command.ts
extensions/context-scroll.mjs
extensions/custom-footer.ts
extensions/preview-command.ts
extensions/welcome-header.ts
extensions/welcome-header-helpers.mjs
themes/dracula.json