Referencia
CLI
El comando qi habla con la misma API que el panel. Sirve para una persona, un cron o un pipeline de CI.
Instalar
El paquete @sumeria.ai/qi instala los comandos qi y qi-mcp. Requiere Node 20 o superior.
npm install -g @sumeria.ai/qi # the qi and qi-mcp commands, Node 20+
qi --helpCredenciales
qi auth login pregunta primero dónde trabajas —tu organización, buscarla por tu email o una cuenta personal (Free o Pro)— y luego abre el navegador para que apruebes este equipo: la clave se crea y queda guardada en tu carpeta de usuario, con permisos solo para ti. Para usar una clave de API Keys, ejecuta qi auth login --key; no se muestra al escribirla. Las claves tienen la forma sk_live_tenant.… y traen su tenant: no hay tenant ni URL que escribir.
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 machineEn CI gana el entorno sobre el archivo: no se escribe nada a disco.
# 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 environmentNo hay flag de API key a propósito: un argumento queda en el historial del shell y, mientras corre, en la lista de procesos que ve cualquier usuario de la máquina.
Variables de entorno
| Variable | Para qué |
|---|---|
QI_API_KEY | La clave secreta. |
QI_TENANT | Solo para claves antiguas (sk_live_ seguido de hexadecimal), que no traen su tenant. |
QI_BASE_URL | Avanzado: apunta a otro entorno. Normalmente no hace falta. |
QI_CONFIG_PATH | Opcional: mueve el archivo de configuración (y state.json a su lado). |
QI_STATE_PATH | Opcional: mueve el archivo de estado de qi watch. |
QI_LANG | Opcional: idioma de la CLI (en, es, …). |
Comandos
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 commandLas listas largas de archivos se parten solas en lotes de 10, y un archivo rechazado no tumba al resto: se aparta y el lote se reenvía.
Una carga exitosa significa que los archivos se aceptaron y quedaron en cola. La transcripción y el análisis tardan minutos: qi interactions wait espera hasta que cada etapa termine.
Opciones
Listado y exportación
| Opción | Para qué |
|---|---|
--limit <n> --page <n> | Tamaño de página (máximo 200) y página, desde 0. |
--from <date> --to <date> | Fechas ISO, siempre juntas. |
--type <audio|text> | audio o text. Por defecto, audio. |
--agent-type <human|bot> | human o bot: quién atendió. |
--form <id> | Solo las interacciones evaluadas con esa pauta (ID). |
--all | Todas las páginas, no solo una. |
--format <csv|json> --out <file> | Exportar: csv o json, a un archivo o a la salida estándar. |
--with-answers | Exportar: agrega las respuestas de cada interacción. |
--timeout <s> --interval <s> | Tiempos de wait y watch, en segundos. |
--json | Salida en JSON, para scripts. |
Archivos y nombres
| Opción | Para qué |
|---|---|
-r, --recursive | Entra en las subcarpetas. |
--include <glob> --exclude <glob> | Repetibles, se comparan con el nombre del archivo. |
--prefix <p> --suffix <s> | Sube (o renombra) con otro nombre; el archivo en disco no cambia. |
--key <KEY> --key-from-folder | Clave de pauta agregada como _CLAVE (tenant compartido), o el nombre de la carpeta. |
--company <c> | Tenant propio: verifica también el segmento de la compañía. |
Carga
| Opción | Para qué |
|---|---|
--form <key|id> | Pauta por clave o ID. |
--analysis <full|transcript> | Tenant compartido: full o transcript. |
--bot <bot_id|name> | Perfil de bot por bot_id o nombre (upload bot). |
--concurrency <n> | Requests de 10 archivos en paralelo. Por defecto, 2. |
--retries <n> | Reintentos ante 429 y 5xx, con espera exponencial. Por defecto, 3. |
--dry-run | Muestra los nombres finales y lo que se rechazaría, sin enviar nada. |
--convert <mp3|wav|…> | Convierte con ffmpeg antes de subir. |
-i, --interactive | Elige pauta, bot y análisis en un menú. |
Conversión
| Opción | Para qué |
|---|---|
--to <mp3|wav|flac|ogg|m4a> | Formato de salida: mp3, wav, flac, ogg o m4a. |
--bitrate <64k> --mono --sample-rate <hz> --trim-silence --normalize | Ajustes del audio convertido. |
--out-dir <dir> | Carpeta de salida. |
-y, --yes | Instala ffmpeg sin preguntar. Sin terminal, la CLI solo imprime el comando: nunca instala en silencio. |
Watch y schedule
| Opción | Para qué |
|---|---|
--type <audio|text|bot> | Canal de watch: audio, text o bot. |
--interval <s> | Cada cuántos segundos revisa la carpeta. Por defecto, 60. |
--settle <s> | Segundos que el tamaño debe quedar quieto antes de tomar un archivo. Por defecto, 2. |
--done-dir <dir> | Mueve ahí lo que ya se envió. |
--once | Una sola vuelta, para un programador de tareas. |
--every "<cron>" | Expresión cron de schedule print. |
--platform <linux|darwin|win32> | Para qué sistema imprimir el comando. |
--name <task> | Nombre de la tarea programada. |
Recetas
Subir una carpeta
Recorre subcarpetas, filtra por patrón y elige la pauta para todo el lote.
# 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 -iPrefijo, sufijo y clave
Cambian el nombre con el que se envía cada archivo, no el archivo. Prueba primero con --dry-run; qi rename --apply es el único que renombra en disco.
# 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_ --applyConvertir antes de subir
Usa el ffmpeg ya instalado. Si no hay, en una terminal pregunta antes de instalarlo (winget, brew, apt o dnf, según el sistema).
# 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 ./mp3Vigilar una carpeta
Recuerda lo que envió en ~/.qi/state.json (ruta, tamaño y fecha de modificación): un archivo se envía una vez, y otra solo si cambia. Uno que falló se reintenta en la vuelta siguiente.
# 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 --onceProgramar con cron o con el Programador de tareas
qi schedule print imprime la línea de crontab o el comando schtasks /Create, con rutas absolutas a node y a la CLI. No instala nada: la línea la agregas tú.
# 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:\grabacionesLeer y exportar resultados
El CSV sigue RFC 4180, y un texto que empieza con =, +, - o @ lleva un apóstrofo delante para que una planilla lo muestre en vez de ejecutarlo.
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.jsonCódigos de salida
| Código | Significado |
|---|---|
0 | Todo bien. |
1 | El request falló: el motivo sale por stderr. |
2 | El comando estaba mal escrito. |
Pensados para cron y CI. Una carga parcial sale con 1 y explica el motivo por archivo:
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 para agentes
Pega esto en un agente de código (Claude Code, Cursor, …) para que integre la CLI en tu proyecto.
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.