Getting Started
QwryAI CLI
Install qwryai-cli and work with your agents, sources, conversations, tickets and WhatsApp templates from a terminal, a script or CI
qwryai-cli is the official command-line client for the QwryAI tools: the same tools the QwryAI MCP server and Backstage use. Instead of one command per resource, it has three building blocks. tools:list shows the tools your credential may use, tools:call runs one, and apply confirms a change a tool prepared for you. Everything else on these pages, from listing agents to sending a test message, is a tools:call.
Install
npm install -g qwryai-cliOr run it without installing:
npx qwryai-cli tools:listCheck the version:
qwryai-cli version{"success":true,"version":"1.0.0"}Quick start
- Sign in with your browser
qwryai-cli auth:loginThe CLI opens the QwryAI approval page and prints a short device code. Check that the code matches, choose what the CLI may do, and select Approve qwryai-cli. The CLI stores the credential for later commands. See CLI Auth for every way to sign in.
- List your agents
qwryai-cli tools:call list_agentsEach agent in the reply has an
id. Agent tools take it aschatbotId, so keep it in a shell variable:AGENT=$(qwryai-cli tools:call list_agents | jq -r '.data.agents[] | select(.name=="QwryAI") | .id') - Send a message
CONV=$(qwryai-cli tools:call create_conversation --args "{\"chatbotId\":\"$AGENT\"}" | jq -r '.data.conversationId') qwryai-cli tools:call send_message --args "{\"chatbotId\":\"$AGENT\",\"conversationId\":\"$CONV\",\"content\":\"How do I reset my password?\"}"The reply comes back in full once the agent has answered. See CLI Chat.
Authenticate in CI
Where nobody can approve a browser login, set an API key in the environment instead of running auth:login:
export QWRYAI_API_KEY=<your-qwryai-api-key>
qwryai-cli tools:call list_agentsThe key can do what you chose when you created it, and never more than your own workspace role allows.
These environment variables change where the CLI connects:
| Variable | Purpose |
|---|---|
QWRYAI_API_KEY | API key used when no browser login is stored |
QWRYAI_API_URL | API origin or full public API URL. Defaults to https://api.qwryai.com/public/v1 |
QWRYAI_AUTH_SERVER | Sign-in server origin. Defaults to the API origin |
QWRYAI_MCP_URL | MCP endpoint printed by mcp:config. Defaults to the API origin's /mcp path |
Every address must use HTTPS. Plain HTTP is accepted only for localhost.
Output
Every command prints JSON, so there are no output flags to remember. Commands that report more than one event, such as auth:login, print one JSON object per line.
| Field | Meaning |
|---|---|
success | true when the command worked |
data | What the tool returned |
error.message | Why the command failed |
error.code | A machine-readable code, such as INSUFFICIENT_PERMISSION |
error.httpStatus | The HTTP status QwryAI answered with |
Failed commands also exit with a non-zero code, so set -e scripts stop on the first error. Pipe the output to jq to pick out fields.
Reviewed changes
Tools that change settings, sources, actions or procedures never apply anything on their own. They answer with "status": "review_required", the before and after of each change and a reviewId. Nothing changes until you run:
qwryai-cli apply <reviewId>A review lasts 15 minutes, can be applied once, and only by the credential that prepared it. See CLI API for the full flow.
Privacy
The CLI sends no telemetry. It talks only to the QwryAI API and sign-in server you point it at, and only when you run a command. A browser login is stored in ~/.qwryai/credentials.json, readable by your user alone.
Commands
Auth
Sign in with your browser or an API key, check status and sign out.
Agents
List agents, read their settings, change instructions, model and styles.
Sources
Add text, Q&A and websites, then train your agent.
Chat
Start a conversation and talk to an agent as a customer.
Conversations
Find, read and handle conversations from every channel.
Tickets
List, search and read Helpdesk tickets, statuses and teams.
List approved templates and send them to contacts.
API
List every tool and call any of them directly.
To connect an MCP client such as Cursor instead, qwryai-cli mcp:config prints a ready-made server block that reads your key from QWRYAI_API_KEY. See MCP Server.
Uninstall
qwryai-cli auth:logout
npm uninstall -g qwryai-cliauth:logout revokes your browser login and deletes ~/.qwryai/credentials.json. Remove QWRYAI_API_KEY from your shell profile or CI secrets yourself.