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-discord-activity

v0.1.3

Published

Discord activity extension and helper for the Pi coding agent.

Readme

pi-discord-activity

A repo-ready package for adding Discord activity support to the Pi coding agent.

This project is split into two pieces:

  • a Pi extension that listens to real Pi session and activity events
  • a local helper daemon that owns the Discord RPC connection and updates your Discord activity

What this starter pack includes

  • package.json
  • TypeScript build config
  • Pi extension implementation in src/extension
  • Discord helper implementation in src/helper
  • shared types/config in src/shared
  • example local settings in .pi/example-settings.json
  • install, setup, service, and verification docs

Quick Start

Published package install

For most users, the simplest path is to install the published package into Pi and let the extension auto-start the helper when Pi activity is first published.

  1. Install the Pi package

    pi install npm:pi-discord-activity
  2. Open Pi and use it normally

    With the default configuration, the extension will auto-start the helper the first time it needs to publish Discord activity.

  3. Verify the integration

    Follow docs/verification.md for the Discord-side checks.

If you prefer explicit process management, you can still start the helper manually:

pi-discord-activity-helper
# or
npx pi-discord-activity-helper

Direct npm install

If you want the helper binary available directly from npm on your PATH:

npm install -g pi-discord-activity

You should still install the Pi package so Pi loads the extension:

pi install npm:pi-discord-activity

Then either let Pi auto-start the helper, or run it yourself:

pi-discord-activity-helper

Local repo / development install

  1. Configure Discord (optional)

    The package already ships with a working default Discord application ID, so custom setup is optional.

    # optional: override the built-in default app
    export DISCORD_RPC_CLIENT_ID="your_discord_client_id"

    For a custom Discord application, see docs/discord-setup.md.

  2. Install dependencies and build

    npm install
    npm run build
  3. Install the Pi extension

    pi install .

    Manual fallback:

    mkdir -p ~/.pi/agent/extensions
    ln -s "$(pwd)/dist/extension/index.js" ~/.pi/agent/extensions/pi-discord-activity.js
  4. Start Pi and let the helper auto-start

    The extension will start the helper automatically on the first publish attempt. If you prefer to run it yourself during development, you can still use:

    npm start
  5. Verify the integration

    ./scripts/verify-installation.sh

    Then follow docs/verification.md for the manual Discord-side checks.

Status

This is a working Pi extension/helper package with:

  • ✅ real Pi extension integration
  • ✅ Discord activity transport and reconnect handling
  • ✅ a built-in default Discord application ID for low-friction setup
  • pi install . package installation support
  • ✅ setup, service, and verification documentation

Typical next steps for a new user:

  1. follow INSTALL.md
  2. optionally configure a custom Discord application
  3. optionally set up a background service using docs/service-recipes.md
  4. verify the full flow with docs/verification.md

Requirements

  • Node.js 20+
  • npm 10+
  • Discord desktop app running locally
  • Pi coding agent installed locally

Install

For the full guided flow, see INSTALL.md.

Install from the published package

Recommended for most users:

pi install npm:pi-discord-activity

Then open Pi and let the extension auto-start the helper on first use.

Manual helper startup is still available if you want it:

pi-discord-activity-helper
# or
npx pi-discord-activity-helper

If you want the helper installed globally through npm as well:

npm install -g pi-discord-activity

Install from the local repo

npm install
npm run build
pi install .

Then open Pi and let the extension auto-start the helper, or run npm start manually if you prefer.

Guided setup scripts

The repo also includes automation scripts that can write .env, build the project, optionally run pi install ., and create a background service:

./setup.sh
# or on Windows
pwsh ./setup.ps1

Local development

Run the helper daemon:

npm run dev:helper

In another terminal, build and install the extension or use pi install . again after making changes.

If you want to test the HTTP transport without Pi, keep the helper running and POST a payload to:

http://127.0.0.1:42666/presence

Environment variables

The package ships with a built-in default Discord RPC client ID:

  • 1495329514417426522

So DISCORD_RPC_CLIENT_ID is optional for normal use. The helper also reads .env and .env.local from the project root.

Common configuration:

DISCORD_RPC_CLIENT_ID=1495329514417426522
PI_PRESENCE_PORT=42666
PI_PRESENCE_HOST=127.0.0.1
PI_PRESENCE_PRIVACY_MODE=true
PI_PRESENCE_INCLUDE_PROJECT=false
PI_PRESENCE_DEBOUNCE_MS=2000
PI_PRESENCE_AUTOSTART_HELPER=true
PI_PRESENCE_DEBUG=false

Set PI_PRESENCE_AUTOSTART_HELPER=false if you want to disable auto-start and manage the helper manually or through an OS service.

Privacy defaults

Default behavior is privacy-first:

  • project name is hidden unless explicitly enabled
  • prompt content is never sent to Discord
  • filenames are not sent to Discord

To allow project names in the Discord state line, set both:

export PI_PRESENCE_PRIVACY_MODE="false"
export PI_PRESENCE_INCLUDE_PROJECT="true"

Example Discord activity mapping

  • Details: Using Pi Coding Agent
  • State: <model> • <activity>
  • Large image: pi
  • Small image: provider key such as openai

Common activities:

  • Starting
  • Thinking
  • Running Tools
  • Editing Files
  • Idle
  • Error

Documentation

License

MIT