Command-line client for Cookiy AI — run user research, quant surveys, and recruit participants from your terminal.
# Install once (requires Node.js 18+)
npm install -g @cookiyai/cookiy-cli
# Upgrade
npm update -g @cookiyai/cookiy-cliThe commands remain cookiy and cookiy-cli.
If you previously installed the unscoped package, migrate with:
npm uninstall -g cookiy-cli
npm install -g @cookiyai/cookiy-cliFor CI and automated tests, set COOKIY_SKIP_UPDATE_CHECK=1 to disable background update checks and update-cache writes.
- Successful V1 responses print
datato stdout. Standard API errors print the server'serrorto stderr and exit nonzero. HTTP 401 errors additionally receive a top-levellogin_url; precedence is server top-levellogin_url, serverdetails.login_url, then the CLI-derived configured-server URL. The server'sdetailsvalue is unchanged. - Other V1 runtime errors print JSON
{code,message,details?}to stderr:HTTP_<status>for nonstandard HTTP errors,NETWORK_ERRORfor connection failures,REQUEST_TIMEOUTfor HTTP timeouts, andCLI_ERRORfor unexpected exceptions. A nonstandard 401 usesUNAUTHORIZEDwith the same login hint. Local token/argument errors and help/save-token messages keep their existing text format; stderr is not universally JSON. study guide update --jsonaccepts both nested JSON ('{"meta":{"sample_size":8}}') and dotted keys ('{"meta.sample_size":8}'). Dotted keys are expanded before the REST request is sent.- Guide updates use
--base-revisionfor optimistic concurrency. The deprecated--idempotency-keyremains optional for compatibility; the current server ignores it and does not return a receipt. After a timeout or revision conflict, get the latest guide before deciding whether another edit is needed. - Synthetic interviews accept
--personaand the deprecated--plain-textalias. Both send the RESTpersonafield;--personatakes precedence if both are supplied. study createwaits for the discussion guide and returns the ready canonical guide, sostudy guide waitis not supported.study report wait --study-id <id> [--timeout-ms <n>]polls the Study activity every 15 seconds, with the final sleep capped by the remaining wait budget and followed by one last Activity request. Each HTTP request keeps the normal RPC timeout.report_generation_in_progresskeeps waiting;report_readyprints the share-link response;report_failed,report_not_requested, missing states, and unknown states fail immediately. All wait failures print JSON to stderr and exit nonzero. AWAIT_TIMEOUTerror includes the latest complete Study activity indetails, so a calling workflow can inspect it and retry.- Early pipe closure (for example
| head) is silent and preserves the command's exit status. Other output-write failures print a text diagnostic when stderr is usable and exit nonzero. quant raw-responsereads the server's JSON response and prints itscsvfield to stdout, with the CLI's usual trailing newline (also for empty CSV). Save it withcookiy quant raw-response --survey-id 12345 > responses.csv.