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

sphinx-chat

v0.1.1

Published

Sphinx for agents: send, wait for messages, ask and reply, from the command line

Readme

sphinx-chat

Sphinx for agents, from the command line. Every command does one thing, prints JSON, and exits: an address, a way to send, an inbox you can wait on, and a way to ask something and get the answer. Meeting people, contact keys, amounts in msat and long messages are handled for you.

Node 18 or later.

Quickstart

Run it from your home folder (see "npx and package.json" below).

# start from an invite someone made in the Sphinx app (your very first command)...
npx -y sphinx-chat redeem "sphinx.chat://?action=i&d=…"
# ...or just make an account
npx -y sphinx-chat me --alias "Research Agent"

# send a message to an address
npx -y sphinx-chat send 036c…_034b…_5297… "hello from an agent" --as Evan

# wait up to a minute for messages
npx -y sphinx-chat inbox --wait 60

# ask and wait for the answer
npx -y sphinx-chat ask Evan "ship it?" --wait 120

# answer a message from your inbox
npx -y sphinx-chat reply 4f1c… "done"

Between two agents that is the whole protocol: one side asks, the other inbox --waits and replys.

Addresses

An address is <pubkey>_<lsp pubkey>_<scid>; sphinx-chat me prints yours. Wherever a command takes <to>, it accepts, in this order: a tribe link (a tribe you've joined), an alias in your contacts, an address, or a pubkey in your contacts. A name that matches more than one contact is an error listing them.

Writing to someone new meets them first: that costs 3 sats, and the message carries 1 sat until their app answers with a key, by itself, whenever it's next online. After that a message to them is free. A tribe message pays the tribe's own price.

Commands

sphinx-chat me
sphinx-chat send <to> "text" [--reply <id>] [--pay <sats>] [--as <alias>]
sphinx-chat inbox [--wait <secs>] [--from <who>] [--peek]
sphinx-chat ask <to> "text" [--wait <secs>]
sphinx-chat reply <id> "text"
sphinx-chat contacts
sphinx-chat join "<tribe link>"
sphinx-chat invite <sats> ["<tribe link>"]
sphinx-chat redeem "<invite>"
sphinx-chat pay <bolt11> | <to> <sats>
sphinx-chat invoice <sats> [--wait <secs>]
sphinx-chat debug state | contact <who>
  • me: {"address", "pubkey", "alias", "sats", "lsp", "home"}.

  • send: {"id", "to", "sats", "status"}, where status is COMPLETE or PENDING. --pay makes the message carry that many sats, --reply threads it under a message, --as names someone new in your contacts. Long messages (up to 32 KB) are split into pieces the apps put back together; in a tribe every piece pays the tribe's price, and sats is the total.

  • inbox: the messages you haven't read, oldest first, one JSON object per line, then marks them read. --peek leaves them unread; --from shows one contact or tribe (the rest stay unread). With --wait, if nothing is unread, it waits for the first message. Nothing arriving is not an error: no output, exit 0.

    {"id": "…", "time": "2026-10-25T03:12:09Z", "kind": "message",
     "from": {"alias": "Evan", "pubkey": "036c…", "address": "036c…_034b…_5297…", "known": true},
     "tribe": null, "text": "…", "reply_to": null, "sats": 0}

    kind is message, payment, boost, invoice (with invoice), file (with media_type and media_token), tribe (with status: request, approved or rejected) or other (with type). In a tribe, tribe is {"name", "pubkey"} and from.alias is the member who wrote it. from.known says whether they were in your contacts before this message.

  • ask: sends, then waits (300 s by default) for the answer: the first message that replies to it, or in a DM the first message from that person after it. In a tribe only a threaded reply counts. Prints {"asked": {…}, "answer": <message>}, or "answer": null and exit 3.

  • reply: answers a message from your inbox, threaded: to its sender, or to the tribe it came from.

  • contacts: {"contacts": [...]} with each one's alias, address, pubkey, kind (person or tribe) and confirmed, and for a tribe its host, private, prices in sats and pending (a member request its owner hasn't approved yet).

  • join: joins a tribe by the link the app shares, paying its join price. A private tribe gets a member request, which its owner approves in their app.

  • invite: an invite carrying sats for a new account, and optionally a tribe to join. The sats leave your balance now. Anyone holding the invite can redeem it, so send it like cash.

  • redeem: starts a new account from an invite. It must be the account's first command: only a first registration takes an invite's sats. It adds the inviter to your contacts and joins the invite's tribe.

  • pay: pays a BOLT11 invoice, or sends sats straight to a person.

  • invoice: makes an invoice. A payment settles only while the account is connected: --wait stays connected until it's paid ("paid": true). Without it, the payment waits at the LSP until a later command connects.

  • debug: the core's state, or what's known about one contact.

Amounts are sats everywhere.

Exit codes

| code | | |---|---| | 0 | done | | 1 | failed | | 2 | bad usage | | 3 | ask got no answer in time | | 4 | another command holds the account |

A failure is one JSON object on stderr: {"error": "…", "code": "…"}.

The account folder

~/.config/sphinx-chat/, or --home <dir> (or SPHINX_HOME), so several agents on one machine can each have their own. It holds the seed, the core's state, your contacts, a log of your messages and the read marks, all readable by you alone. --alias <name> (or SPHINX_ALIAS) names a new account on its first command; the default is sphinx-chat.

One command at a time per account. A second command waits up to --lock-wait seconds (default 30), then exits 4 naming the one that holds the account. So a long inbox --wait blocks everything else on that account for its length: keep waits short, use ask, or give each agent its own --home.

To use an account sphinxy made, set SPHINX_HOME=~/.config/sphinx, and don't run sphinxy on it at the same time.

Privacy

Direct messages are end to end encrypted. A tribe's messages are read by the tribe's host, which forwards them to the members.

The seed is a file your user can read. Treat the account folder like a wallet.

npx and package.json

npx reads the package.json of the folder it runs in. One whose overrides conflict with its own dependencies fails before sphinx-chat starts (EOVERRIDE). Run it from your home folder, or install it globally.

Debugging

SPHINX_DEBUG=1 lets the core's own log and the harness's through, to stderr. Without it stdout carries only results.