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

@threahq/bot

v0.2.1

Published

Run any command as a Threa bot: `threa-bot run -- <command>` links a scratchpad (or answers mentions) and pipes each turn into the command, posting its output as the reply.

Readme

@threahq/bot

Run any command as a Threa bot.

npx @threahq/bot connect
npx @threahq/bot run -- my-agent --answer

connect prints a URL and a code. Open it, pick a workspace, confirm, and the bot plus its key are created for you; the key lands in ~/.threa/bot.json. run then executes my-agent --answer once per turn with the message text on stdin. Whatever it prints to stdout is posted as the reply; stderr lines appear as trace steps while it works. That is the whole contract, so a shell script, a Python program, or an agent CLI all qualify.

Node 20+ or Bun, on macOS or Linux (the agent runs in its own process group and is stopped with POSIX signals; Windows is not supported yet).

Credentials without connect

run also reads THREA_WORKSPACE_ID and THREA_API_KEY from the environment (THREA_BASE_URL defaults to https://app.threa.io), or a JSON file passed with --config. The key has to be a threa_bk_ bot key with bot-runtime:write, bot-invocations:write, messages:write, messages:read, streams:read, attachments:read. THREA_BOT_CONFIG moves the file connect writes.

Two modes

threa-bot run -- <command> links a scratchpad for the directory you run it in and prints its URL. --session <name> runs several side by side in one directory, each with its own scratchpad; the same name resumes the same one. Every message in that scratchpad is a turn; /stop kills the running command; a message sent meanwhile waits for it to finish, and /enqueue <text> does the same explicitly. Restarting in the same directory returns to the same scratchpad.

threa-bot run --mention -- <command> owns nothing. Whenever someone @mentions the bot in any stream, the command runs with that message and the reply lands in the same stream.

What the command sees

  • stdin: the turn's text. In scratchpad mode this includes recent scratchpad history after the message, formatted the way the SDK hands it to any connector.
  • THREA_INVOCATION_ID, THREA_STREAM_ID, THREA_SOURCE_MESSAGE_ID in the environment. The bot key is not passed on: everything the command writes to stderr becomes trace visible to the stream, so a command that needs the API gets its own key.
  • Output over 48 000 characters is cut with a note; a non-zero exit posts the exit code and the last lines of stderr as the reply; --timeout <ms> kills a turn that runs too long.

Options

connect --base-url <url>   Threa origin (default https://app.threa.io)
connect --name <name>      shown to whoever approves

run --mention      answer @mentions instead of owning a scratchpad
run --session <s>  run several sessions in one directory; same name = same scratchpad
--name <prefix>    scratchpad name prefix (default: the command's basename)
--config <file>    JSON config; environment variables win over it
--timeout <ms>     kill the command after this long per turn

Built on @threahq/remote-session; a connector that needs more than stdin/stdout (mid-turn steering, interim messages, attachments) starts from that package instead.