Справочник
CLI
Команда qi обращается к тому же API, что и панель. Она подходит и человеку, и заданию cron, и конвейеру CI.
Установка
Пакет @sumeria.ai/qi устанавливает команды qi и qi-mcp. Нужен Node 20 или новее.
npm install -g @sumeria.ai/qi # the qi and qi-mcp commands, Node 20+
qi --helpУчётные данные
qi auth login сначала спрашивает, где вы работаете — ваша организация, поиск по e-mail или личный аккаунт (Free или Pro), — а затем открывает браузер, чтобы вы подтвердили этот компьютер: ключ создаётся и сохраняется в вашей домашней папке, доступной для чтения только вам. Чтобы использовать ключ из API Keys, выполните qi auth login --key; при вводе он не отображается. Ключи имеют вид sk_live_tenant.… и содержат свой тенант: вводить тенант или URL не нужно.
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 machineВ CI переменные окружения имеют приоритет над файлом: на диск ничего не записывается.
# 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 environmentФлага для API-ключа нет намеренно: аргумент попадает в историю вашей оболочки и, пока процесс работает, в список процессов, который может читать любой пользователь машины.
Переменные окружения
| Переменная | Для чего |
|---|---|
QI_API_KEY | Секретный ключ. |
QI_TENANT | Только для старых ключей (sk_live_ и шестнадцатеричная строка), которые не содержат тенант. |
QI_BASE_URL | Для опытных: указывает на другое окружение. Обычно не нужно. |
QI_CONFIG_PATH | Необязательная: переносит файл конфигурации (и state.json рядом с ним). |
QI_STATE_PATH | Необязательная: переносит файл состояния qi watch. |
QI_LANG | Необязательная: язык CLI (en, es, …). |
Команды
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 commandДлинные списки файлов сами разбиваются на пакеты по 10, а один отклонённый файл не топит остальные: он откладывается, и пакет отправляется заново.
Успешная загрузка означает, что файлы приняты и поставлены в очередь. Расшифровка и анализ занимают минуты: qi interactions wait блокируется, пока не завершатся все этапы.
Опции
Список и экспорт
| Опция | Для чего |
|---|---|
--limit <n> --page <n> | Размер страницы (не более 200) и страница, начиная с 0. |
--from <date> --to <date> | Даты ISO, всегда вместе. |
--type <audio|text> | audio или text. По умолчанию audio. |
--agent-type <human|bot> | human или bot: кто отвечал. |
--form <id> | Только взаимодействия, оценённые по этой форме (id). |
--all | Все страницы, а не одна. |
--format <csv|json> --out <file> | Экспорт: csv или json, в файл или в стандартный вывод. |
--with-answers | Экспорт: добавить ответы по каждому взаимодействию. |
--timeout <s> --interval <s> | Тайминги wait и watch, в секундах. |
--json | Вывод в JSON, для скриптов. |
Файлы и имена
| Опция | Для чего |
|---|---|
-r, --recursive | Заходить во вложенные папки. |
--include <glob> --exclude <glob> | Можно повторять, сопоставляется с именем файла. |
--prefix <p> --suffix <s> | Загрузить (или переименовать) под другим именем; файл на диске не меняется. |
--key <KEY> --key-from-folder | Ключ формы, добавляемый как _KEY (общий тенант), или имя папки. |
--company <c> | Собственный тенант: проверять также сегмент компании. |
Загрузка
| Опция | Для чего |
|---|---|
--form <key|id> | Форма по ключу или id. |
--analysis <full|transcript> | Общий тенант: full или transcript. |
--bot <bot_id|name> | Профиль бота по bot_id или названию (upload bot). |
--concurrency <n> | Одновременных запросов по 10 файлов. По умолчанию 2. |
--retries <n> | Повторы при 429 и 5xx с экспоненциальной задержкой. По умолчанию 3. |
--dry-run | Вывести итоговые имена и то, что было бы отклонено; ничего не отправлять. |
--convert <mp3|wav|…> | Конвертировать с помощью ffmpeg перед загрузкой. |
-i, --interactive | Выбрать форму, бота и анализ из меню. |
Конвертация
| Опция | Для чего |
|---|---|
--to <mp3|wav|flac|ogg|m4a> | Выходной формат: mp3, wav, flac, ogg или m4a. |
--bitrate <64k> --mono --sample-rate <hz> --trim-silence --normalize | Параметры конвертированного аудио. |
--out-dir <dir> | Папка вывода. |
-y, --yes | Установить ffmpeg без вопросов. Без терминала CLI только выводит команду: он никогда не устанавливает молча. |
Наблюдение и расписание
| Опция | Для чего |
|---|---|
--type <audio|text|bot> | Канал watch: audio, text или bot. |
--interval <s> | Как часто проверяется папка, в секундах. По умолчанию 60. |
--settle <s> | Сколько секунд размер файла должен оставаться неизменным, прежде чем он будет взят. По умолчанию 2. |
--done-dir <dir> | Переместить туда отправленное. |
--once | Только один цикл, для планировщика. |
--every "<cron>" | Выражение cron для schedule print. |
--platform <linux|darwin|win32> | Для какой системы вывести команду. |
--name <task> | Название запланированной задачи. |
Рецепты
Загрузить папку
Обходите вложенные папки, фильтруйте по шаблону и выбирайте форму для всего пакета.
# 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 -iПрефикс, суффикс и ключ
Они меняют имя, под которым отправляется каждый файл, а не сам файл. Сначала попробуйте --dry-run; только qi rename --apply переименовывает на диске.
# 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_ --applyКонвертировать перед загрузкой
Использует уже установленный ffmpeg. Если его нет, в терминале перед установкой он спросит разрешения (winget, brew, apt или dnf, в зависимости от системы).
# 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 ./mp3Наблюдать за папкой
Он запоминает отправленное в ~/.qi/state.json (путь, размер и время изменения): файл отправляется один раз и повторно только при изменении. Неудачный повторяется в следующем цикле.
# 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 --onceРасписание через cron или Планировщик заданий
qi schedule print выводит строку crontab или команду schtasks /Create с абсолютными путями к node и CLI. Он ничего не устанавливает: строку вы добавляете сами.
# 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:\grabacionesЧтение и экспорт результатов
CSV следует RFC 4180, а перед текстом, начинающимся с =, +, - или @, ставится апостроф, чтобы электронная таблица показала его, а не выполнила.
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.jsonКоды завершения
| Код | Значение |
|---|---|
0 | Всё в порядке. |
1 | Запрос не удался: причина в stderr. |
2 | Команда была неверной. |
Рассчитано на cron и CI. Частичная загрузка завершается с кодом 1 и объясняет причину по каждому файлу:
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"Промпт для агентов
Вставьте это в агента для программирования (Claude Code, Cursor, …), чтобы он подключил CLI к вашему проекту.
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.