Shoof AI CLI
shoof is the Shoof AI command line. It works with one app at a time and does
from a terminal what the dashboard and the REST API do: search, ask for
an answer, import records, run a resync, change settings, synonyms and rules,
and read analytics. Every command takes --json, so scripts, CI jobs and AI
agents can read its output.
It needs Node.js 18 or later.
npm install -g @shoof/clishoof --helpTo run it once without installing it, use npx @shoof/cli <command>.
Log in
Section titled “Log in”Give it your app’s ID and its admin key, both in the dashboard under API keys. See API keys.
shoof login --app app_123 --key shf_adm_...login checks the key and saves both to ~/.config/shoof/config.json, which
only your user can read. shoof logout deletes that file.
A search key works too, for search and ask only.
For CI and scripts, set environment variables instead of logging in:
| Variable | |
|---|---|
SHOOF_APP |
The app ID |
SHOOF_ADMIN_KEY |
The admin key (or a search key, for search and ask) |
SHOOF_HOST |
The API host, if not https://api.shoofai.com |
The flags --app, --key and --host come first, then the variables, then
what login saved.
Search and ask
Section titled “Search and ask”shoof search running shoesshoof search "running shoes" -n 5 --page 1 --filters '{"brand":"Acme"}'shoof ask "what is the return policy?"search takes the same --lang, --mode and --filters as the
search endpoint. It prints each result’s title, ID and URL;
--json prints the whole response. Searches from the CLI are sent with
analytics: false, so they don’t show in your analytics.
ask streams the answer as it’s written, then lists its
sources.
Records
Section titled “Records”shoof records import products.jsonlcat posts.json | shoof records import -shoof records get prod_42shoof records delete prod_42 prod_43shoof records clear --yesrecords import reads a file of records, or standard input for -. The file is
either a JSON array of records or JSON Lines, one record per line, in the format
of Records:
{"id": "prod_42", "type": "product", "title": "Trail runner", "url": "https://shop.example/p/42", "price": 89}It sends them in batches of up to 500 and prints its progress. When the API
asks it to slow down (429), it waits as long as Retry-After says and tries
again. Records the API rejects are listed at the end, and the command exits
with status 1.
Replace every record
Section titled “Replace every record”With --replace, the import is a full resync: records that
aren’t in the file are removed.
shoof records import catalog.jsonl --replaceThe CLI starts a resync, sends every record with it, then commits it, so the new
records go live at once. If a record fails, it doesn’t commit, because that
would remove the record from your index. Fix the file and run the import again
(the resync resumes), or keep what was sent with shoof reindex commit.
The reindex commands run each step by hand:
shoof reindex start # --no-copy starts from an empty indexshoof reindex statusshoof reindex commitshoof reindex cancelSettings, synonyms and rules
Section titled “Settings, synonyms and rules”shoof settings getshoof settings get hitsPerPageshoof settings set hitsPerPage 30shoof settings set mode keywordshoof settings set allowedReferers '["https://shop.example"]'shoof settings preset storesettings set parses the value as JSON, and otherwise sends it as a string.
It changes that one setting and leaves the others as they are. See
App settings for each setting.
shoof synonyms listshoof synonyms add sofa couch setteeshoof synonyms add --input phone iphone androidshoof synonyms remove syn_abc123synonyms add with several terms makes them all find each other. With
--input, searching the input finds the terms, but not the other way round.
See Synonyms.
shoof rules listshoof rules add '{"pattern":"sale","match":"contains","pins":[{"id":"prod_42","position":1}]}'shoof rules add @rule.jsonshoof rules remove rule_abc123A rule is the JSON object described in Rules. @ reads it
from a file.
Analytics
Section titled “Analytics”shoof analyticsshoof analytics --from 2026-10-01 --to 2026-11-01shoof analytics --no-results --jsonanalytics prints the totals, the top searches and the searches that found
nothing for the last 14 days, or for --from to --to. --no-results prints
only the searches that found nothing, the ones to fix with synonyms, rules or
new content. With --json it prints the whole analytics
response, including a series by
--interval (hour, day or week).
Exit status
Section titled “Exit status”| Status | |
|---|---|
0 |
It worked. |
1 |
The API returned an error, or records failed to import. |
2 |
The command or its arguments are wrong. |
Errors go to standard error as Error <status> <code>: <message>, the code
being one of the API’s error codes. With --json, they’re the
API’s error object.
Use it from an AI agent
Section titled “Use it from an AI agent”An agent that can run commands, such as Claude Code or Cursor, can use the CLI
with --json. Set SHOOF_APP and SHOOF_ADMIN_KEY in its environment, and
tell it to run shoof --help first. To give an assistant the same abilities
without a terminal, use the MCP server.