Reference
CLI
The qi command talks to the same API as the panel. It works for a person, a cron job or a CI pipeline.
Install
The @sumeria.ai/qi package installs the qi and qi-mcp commands. Node 20 or newer.
npm install -g @sumeria.ai/qi # the qi and qi-mcp commands, Node 20+
qi --helpCredentials
qi auth login first asks where you work — your organization, find it by your email, or a personal account (Free or Pro) — and then opens the browser so you approve this computer: the key is created and saved in your home folder, readable only by you. To use a key from API Keys instead, run qi auth login --key; it is not echoed. Keys look like sk_live_tenant.… and carry their tenant, so there is no tenant or URL to type.
qi auth login
# Where do you work? your organization / find it by email / personal account (Free, Pro)
# The browser opens: approve this computer and the key is created and saved for you
qi auth status # account, branch and key in use (the key is masked)
qi auth login --tenant acme # skip the question: your organization's name
qi auth login --key # paste a key from API Keys instead (not echoed)
qi auth switch # sign in to another account; keeps the current one if it fails
qi auth switch --branch # another branch of your organization
qi auth logout # forget the key on this machineIn CI the environment wins over the file: nothing is written to disk.
# CI: the key comes from the pipeline's secrets, never from a file or a flag.
# GitHub Actions, for example:
env:
QI_API_KEY: ${{ secrets.QI_API_KEY }}
# QI_TENANT only for older keys (sk_live_<hex>) that do not carry their tenant
# QI_BASE_URL advanced: point at another environmentThere is no API key flag, on purpose: an argument lands in your shell history and, while the process runs, in the process list every user on the machine can read.
Environment variables
| Variable | What for |
|---|---|
QI_API_KEY | The secret key. |
QI_TENANT | Only for older keys (sk_live_ followed by hex) that do not carry their tenant. |
QI_BASE_URL | Advanced: point at another environment. Not normally needed. |
QI_CONFIG_PATH | Optional: moves the config file (and state.json next to it). |
QI_STATE_PATH | Optional: moves qi watch's state file. |
QI_LANG | Optional: CLI language (en, es, …). |
Commands
qi auth login # sign in from the browser and save the key
qi auth status # which account and key are in use (masked)
qi auth switch [--branch] # another account, or another branch
qi auth logout # forget the key on this machine
qi doctor # config, API, plan, modules, name rules, ffmpeg
qi usage # plan, QI tokens used, period end
qi lang [code] # CLI language: en es zh pt fr de ja
qi upload audio <file|folder...> # recordings (Speech Analytics)
qi upload text <file|folder...> # conversations (Text Analytics)
qi upload bot <file|folder...> --bot <p> # bot conversations (Bot Analytics)
qi validate <file|folder...> # check names against the tenant's rules
qi rename <file|folder...> [--apply] # rename local files with --prefix/--suffix/--key
qi convert <file|folder...> --to <fmt> # convert audio with the system's ffmpeg
qi forms list [--type audio|text|bot] # forms and the key uploads use
qi bots list # bot profiles (plans with Bot Analytics)
qi interactions list [--all] # analysed conversations
qi interactions get <id> # status, dialogue, answers
qi interactions wait <id> # until processing finishes
qi interactions export --format csv|json # [--with-answers]
qi watch <folder...> # upload new files as they appear
qi schedule print --every <cron> -- ... # print a cron line or a schtasks commandLong file lists are split into batches of 10 on their own, and one rejected file does not sink the rest: it is set aside and the batch is resent.
A successful upload means the files were accepted and queued. Transcription and analysis take minutes: qi interactions wait blocks until every stage has settled.
Options
Listing and export
| Option | What for |
|---|---|
--limit <n> --page <n> | Page size (at most 200) and page, from 0. |
--from <date> --to <date> | ISO dates, always together. |
--type <audio|text> | audio or text. Defaults to audio. |
--agent-type <human|bot> | human or bot: who answered. |
--form <id> | Only interactions evaluated with that form (id). |
--all | Every page, not just one. |
--format <csv|json> --out <file> | Export: csv or json, to a file or to standard output. |
--with-answers | Export: add each interaction's answers. |
--timeout <s> --interval <s> | wait and watch timing, in seconds. |
--json | JSON output, for scripts. |
Files and names
| Option | What for |
|---|---|
-r, --recursive | Descend into sub-folders. |
--include <glob> --exclude <glob> | Repeatable, matched on the file name. |
--prefix <p> --suffix <s> | Upload (or rename) under a different name; the file on disk is untouched. |
--key <KEY> --key-from-folder | Form key appended as _KEY (shared tenant), or the folder's name. |
--company <c> | Own tenant: also check the company segment. |
Upload
| Option | What for |
|---|---|
--form <key|id> | Form by key or id. |
--analysis <full|transcript> | Shared tenant: full or transcript. |
--bot <bot_id|name> | Bot profile by bot_id or name (upload bot). |
--concurrency <n> | Requests of 10 files in flight. Defaults to 2. |
--retries <n> | Retries on 429 and 5xx, with exponential backoff. Defaults to 3. |
--dry-run | Print the final names and what would be rejected; send nothing. |
--convert <mp3|wav|…> | Convert with ffmpeg before uploading. |
-i, --interactive | Choose form, bot and analysis from a menu. |
Conversion
| Option | What for |
|---|---|
--to <mp3|wav|flac|ogg|m4a> | Output format: mp3, wav, flac, ogg or m4a. |
--bitrate <64k> --mono --sample-rate <hz> --trim-silence --normalize | Settings of the converted audio. |
--out-dir <dir> | Output folder. |
-y, --yes | Install ffmpeg without asking. Without a terminal the CLI only prints the command: it never installs silently. |
Watch and schedule
| Option | What for |
|---|---|
--type <audio|text|bot> | watch channel: audio, text or bot. |
--interval <s> | How often the folder is checked, in seconds. Defaults to 60. |
--settle <s> | Seconds a file's size must hold still before it is taken. Defaults to 2. |
--done-dir <dir> | Move what was sent there. |
--once | One round only, for a scheduler. |
--every "<cron>" | Cron expression for schedule print. |
--platform <linux|darwin|win32> | Which system to print the command for. |
--name <task> | Name of the scheduled task. |
Recipes
Upload a folder
Walk sub-folders, filter by pattern and pick the form for the whole batch.
# A folder, recursively, only .mp3, evaluated against the form VENTAS
qi upload audio ./grabaciones -r --include "*.mp3" --form VENTAS
# Shared tenants: transcript only, no evaluation
qi upload audio ./grabaciones --analysis transcript
# Choose form, bot and analysis from a menu
qi upload audio ./grabaciones -iPrefix, suffix and key
They change the name each file is sent under, not the file. Try --dry-run first; qi rename --apply is the only one that renames on disk.
# Preview the names files would be sent under; nothing is uploaded
qi upload audio ./grabaciones --prefix dev_ --suffix _lote2 --key VENTAS --dry-run
# Every reason a name is refused, per file (exit 1 if any is bad)
qi validate ./grabaciones
# Rename on disk: preview first, then --apply
qi rename ./grabaciones --prefix acme_
qi rename ./grabaciones --prefix acme_ --applyConvert before uploading
Uses the ffmpeg already installed. If there is none, in a terminal it asks before installing it (winget, brew, apt or dnf, depending on the system).
# Convert, then upload the result (system ffmpeg, into a temporary folder)
qi upload audio ./wav --convert mp3
# Only convert
qi convert ./wav --to mp3 --bitrate 64k --mono --sample-rate 16000 --trim-silence --normalize
qi convert ./wav --to mp3 --out-dir ./mp3Watch a folder
It remembers what it sent in ~/.qi/state.json (path, size and modification time): a file is sent once, and again only if it changes. A failed one is retried next round.
# Upload what lands in ./inbox, every 60 s, and move it to ./sent
qi watch ./inbox --interval 60 --done-dir ./sent --form VENTAS
# One round only, for a scheduler
qi watch ./inbox --onceSchedule with cron or Task Scheduler
qi schedule print prints the crontab line or the schtasks /Create command, with absolute paths to node and the CLI. It installs nothing: you add the line yourself.
# Linux / macOS: prints the crontab line
qi schedule print --every "0 2 * * *" -- upload audio /var/recordings --form VENTAS
# Windows: prints the schtasks /Create command (daily, weekly, hourly or every N minutes)
qi schedule print --every "0 2 * * *" --platform win32 --name qi-nightly -- upload audio D:\grabacionesRead and export results
CSV follows RFC 4180, and text starting with =, +, - or @ gets an apostrophe in front so a spreadsheet shows it instead of running it.
qi interactions list --limit 25 --from 2026-09-01 --to 2026-09-08
qi interactions list --all --agent-type bot --json
qi interactions export --format csv --out week.csv --from 2026-09-01 --to 2026-09-08 --with-answers
qi interactions export --format json --with-answers > all.jsonExit codes
| Code | Meaning |
|---|---|
0 | Fine. |
1 | The request failed: the reason is on stderr. |
2 | The command was wrong. |
Built for cron and CI. A partial upload exits 1 and explains the reason per file:
FAILED 1 accepted · 1 rejected · 0 failed
├─ SUCCEEDED call-001.mp3
└─ REJECTED notas.mp3 missingFields: 1 fields, 7 required: tenant_company_YYYYMMDD_HHMMSS_callId_clientId_agentId# Nightly upload, alerting only when it actually breaks
qi upload audio /var/recordings/$(date +%F) || notify-team "QI upload failed"Prompt for agents
Paste this into a coding agent (Claude Code, Cursor, …) so it wires the CLI into your project.
You are integrating the Sumeria Quality Intelligence CLI (@sumeria.ai/qi) into this project.
1. Install: npm install -g @sumeria.ai/qi (or add it as a dev dependency for CI). Node 20+.
2. Authenticate once with "qi auth login": it asks where the user works and approves the
computer in the browser; the key is stored outside the repo. In CI, provide QI_API_KEY
from the pipeline's secrets instead — never as a command-line flag or in a file that
could get committed. QI_TENANT is only needed for older keys (sk_live_<hex>).
3. Use "qi upload audio <path>" and "qi upload text <path>" to send files or folders; they
go in requests of 10 and are retried on 429/5xx.
4. A successful upload only means the files were accepted and queued — use
"qi interactions wait <id>" or poll "qi interactions list" to see when they were analysed.
5. Exit codes: 0 fine, 1 the request failed (reason on stderr), 2 the command was wrong.
6. Wire this into our build/release process: <tell the agent where the files to upload
live in this repo, and when the command should run>.
Ask before writing any credential to a file that could be committed.