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-canvas

v0.1.1

Published

Live web preview, UI mockup, and Mermaid canvas extension for Pi Coding Agent

Readme


🎨 Overview

pi-canvas brings the visual power of Claude Artifacts and v0.dev live UI previews directly to Pi Coding Agent sessions in your terminal.

Pi Agent is minimal by design, but software development is fundamentally visual. pi-canvas bridges the gap by spinning up an ultra-lightweight, zero-dependency local loopback web server (127.0.0.1) that receives diagrams, prototypes, and vector graphics pushed by the AI agent in real time via Server-Sent Events (SSE).

┌──────────────┐          render_canvas          ┌───────────────────────┐
│              │ ──────────────────────────────> │                       │
│   Pi Agent   │                                 │   pi-canvas (127.0.0.1)│
│  (Terminal)  │ <────────────────────────────── │      (SSE Stream)     │
└──────────────┘          user feedback          └───────────┬───────────┘
                                                             │
                                                             ▼
                                                 ┌───────────────────────┐
                                                 │   Browser Artifact    │
                                                 │ (Mermaid / HTML / SVG)│
                                                 └───────────────────────┘

✨ Features

  • Live Hot-Reload via SSE: Instant push updates whenever Pi creates or refines an artifact.
  • 📊 Native Mermaid 11 Diagrams: Flowcharts, sequence diagrams, class models, and state diagrams.
  • 💻 Interactive HTML/Tailwind Sandbox: Isolated iframe stage to preview web components, forms, and pages.
  • 🖼️ SVG Inspector: Vector graphics with dark-mode canvas integration.
  • 📜 Session History Sidebar: Switch between artifacts generated during your session.
  • 🔒 Loopback Security: Binds strictly to 127.0.0.1 and rejects external network requests.

🚀 Installation

Via Pi Package Registry (Recommended)

pi install npm:pi-canvas

Direct from GitHub

pi install git:https://github.com/lleontor705/pi-canvas.git

From Local Clone

git clone https://github.com/lleontor705/pi-canvas.git
cd pi-canvas
npm install && npm run build
pi install ./

📖 Usage & Commands

Slash Commands

| Command | Description | | :--- | :--- | | /canvas | Starts the server (if not already running) and opens your browser. | | /canvas stop | Stops the background loopback HTTP server. | | /canvas clear | Clears all active artifacts from the sidebar. | | /preview <path> | Previews an existing .html, .svg, .mmd, or .md file directly. |

Agent Autonomous Tool (render_canvas)

When pi-canvas is installed, Pi gains the ability to display visual content autonomously:

// Example prompt:
"Design a sequence diagram showing our OAuth2 authentication flow with refresh tokens."

Pi will invoke render_canvas with:

  • title: "OAuth2 Auth Flow"
  • type: "mermaid"
  • content: Flowchart syntax
  • autoOpen: true

Your default browser automatically opens displaying the rendered diagram with dark mode styling!


🏗️ Architecture & Development

# Clone the repository
git clone https://github.com/lleontor705/pi-canvas.git
cd pi-canvas

# Install dependencies
npm install

# Compile TypeScript
npm run build

Project Structure:

pi-canvas/
├── assets/
│   └── banner.svg         # SVG vector banner
├── dist/                  # Compiled ESM JavaScript & Type definitions
├── skills/
│   └── canvas/SKILL.md    # Pi Agent Skill instructions
├── src/
│   ├── index.ts           # Extension entry point & tool definitions
│   ├── server.ts          # Loopback HTTP + SSE server & embedded web app
│   └── types.ts           # Type definitions
├── .github/workflows/
│   ├── ci.yml             # Build & validation workflow
│   └── release.yml        # Tagged release & npm publish
├── package.json           # Pi manifest declaration
└── tsconfig.json          # TypeScript NodeNext configuration

📄 License

MIT © Luis Leon