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

agent-daemon

v0.5.1

Published

Discord-to-Pi-coding-agent bridge daemon

Readme

agent-daemon

agent-daemon connects a Discord bot to a Pi coding agent. You message the bot in a Discord channel, and it runs the agent against a project directory and replies in the channel. Each Discord channel maps to one project folder on disk.

Requirements

  • Node.js 18 or newer
  • pm2, installed globally: npm install -g pm2
  • A Discord bot token and the Discord user ID of the person who should have admin control

Installation

  1. Install dependencies and build:
npm install
npm run build
  1. Run the install wizard. This asks for your Discord bot token, your admin Discord user ID, and the folder where project directories should live, then saves that as the daemon's configuration.
node dist/src/cli.js install

The wizard also starts the daemon under pm2 once configuration is saved.

  1. Optionally install agent-daemon globally so you can run the CLI by name instead of the full path:
npm link

After this, the commands below can be run as agent-daemon <command> instead of node dist/src/cli.js <command>.

Commands

agent-daemon start      start the daemon
agent-daemon stop       stop the daemon
agent-daemon restart    restart the daemon, picking up new config or code
agent-daemon status     show whether the daemon is running
agent-daemon logs       tail the daemon's logs
agent-daemon install    run the setup wizard

Mapping a channel to a project

When you message the bot in a channel it doesn't recognize, it starts an ephemeral session so you get a reply right away, and asks whether to create a new project folder or attach the channel to an existing one.

You can also map a channel manually by sending this in the channel:

/pi map <category>/<channel-name>

This creates (or attaches to) a folder at <projects-root>/<category>/<channel-name> and routes all future messages in that channel there.

Attachments

Attachments work only in mapped channels. The daemon accepts opaque files up to 10 MiB total per message (up to five files), downloads them to <project>/uploads/, and tells Pi their paths. Uploads are retained; cleanup is intentionally not implemented yet.

To send one generated file back, Pi ends its response with a line like [[discord-file:report.pdf]]. The file must be a regular file under the project, outside dot-directories, and no larger than 10 MiB.

Configuration file

Settings are stored in ~/.pi/agent/gateway/state.json. This includes the Discord token, the admin user ID, the project root path, channel-to-folder routing, and access rules. config.allowedChannels restricts which channel ids the bot will respond in — defaults to ["*"] (all channels). You normally do not need to edit this file directly. The install wizard and the /pi map command manage it for you.

Running at startup on your machine

To have the daemon start automatically when you log in:

pm2 startup
pm2 save

pm2 startup prints a command you need to run once with sudo. pm2 save freezes the current list of running processes so pm2 restores them on the next login.

Development

npm run typecheck   check types without building
npm test            run the test suite
npm run lint        check code style