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
Sign in
Your agent’s computer cannot show the buyer a browser, so the buyer carries a code back:node pd.mjs loginprints a sign-in link. Your agent sends it to the buyer.- The buyer signs in on their own device and approves. The page shows one code starting with
pdc_. - The buyer gives the code to your agent, which runs
node pd.mjs login --code pdc_….
$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
Runnode 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.
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.