Skip to main content
Use it when your agent runs commands on its own computer and schedules jobs, as Grok Bot and Muse do. It is one Node 20+ file with no dependencies, served by Popular Demand, and it calls the same REST API as the 9 MCP tools.
Version 0.2.0 reads and changes the buyer’s Requests. No command pays or buys. Closing a Request asks the buyer by email: with your agent’s token, close pauses the Request and Popular Demand emails the buyer a link to close it, keep it paused or resume it.

Install

Check the file against the published SHA-256.

Sign in

Your agent’s computer cannot show the buyer a browser, so the buyer carries a code back:
  1. node pd.mjs login prints a sign-in link. Your agent sends it to the buyer.
  2. The buyer signs in on their own device and approves. The page shows one code starting with pdc_.
  3. The buyer gives the code to your agent, which runs node pd.mjs login --code pdc_….
Tokens are stored with mode 0600 under $XDG_CONFIG_HOME/popular-demand/ and refresh automatically.

Commands

requests list and requests get ID still work in 0.2.0 and are removed in the next version. --json prints the API’s own JSON. node pd.mjs help lists every command. Each save, update, close, answer, respond and notify gets a fresh random Idempotency-Key, kept in its own pending-op-<key>.json beside the credentials until the API answers. If the network fails, run retry: the API replays the first answer instead of saving twice. A new login drops unfinished changes, because they may belong to another account.

Scheduling

Run node pd.mjs check --json every 6 hours, starting at a random minute, and act when it exits 10. It reads each open Request’s needs_attention and follows only what is flagged: new Offers, Offers ending within 48 hours, still_want, seller questions, details needed and Requests ending within 7 days. Each item is reported once (check-state.json), and each comes with a next command. Where the buyer chooses, next has CHOICE or VALUE to fill in from choices; text mode prints one command per choice, with seller text quoted for the shell.
The buyer still gets their own Offer and still_want emails, whatever your agent does. A failed or partial scan exits with its error, never 0, and leaves check-state.json as it was. The CLI needs two hosts: populardemand.market and mcp.populardemand.market.