Skip to content
QwryAI
Documentation
Pages

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

Bash
npm install -g qwryai-cli

Or run it without installing:

Bash
npx qwryai-cli tools:list

Check the version:

Bash
qwryai-cli version
JSON
{"success":true,"version":"1.0.0"}

Quick start

  1. Sign in with your browser
    Bash
    qwryai-cli auth:login

    The 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.

  2. List your agents
    Bash
    qwryai-cli tools:call list_agents

    Each agent in the reply has an id. Agent tools take it as chatbotId, so keep it in a shell variable:

    Bash
    AGENT=$(qwryai-cli tools:call list_agents | jq -r '.data.agents[] | select(.name=="QwryAI") | .id')
  3. Send a message
    Bash
    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:

Bash
export QWRYAI_API_KEY=<your-qwryai-api-key>
qwryai-cli tools:call list_agents

The 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:

VariablePurpose
QWRYAI_API_KEYAPI key used when no browser login is stored
QWRYAI_API_URLAPI origin or full public API URL. Defaults to https://api.qwryai.com/public/v1
QWRYAI_AUTH_SERVERSign-in server origin. Defaults to the API origin
QWRYAI_MCP_URLMCP 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.

FieldMeaning
successtrue when the command worked
dataWhat the tool returned
error.messageWhy the command failed
error.codeA machine-readable code, such as INSUFFICIENT_PERMISSION
error.httpStatusThe 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:

Bash
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

Uninstall

Bash
qwryai-cli auth:logout
npm uninstall -g qwryai-cli

auth:logout revokes your browser login and deletes ~/.qwryai/credentials.json. Remove QWRYAI_API_KEY from your shell profile or CI secrets yourself.

Explore the documentation