Referenz
CLI
Der Befehl qi spricht mit derselben API wie das Panel. Er funktioniert für eine Person, einen Cron-Job oder eine CI-Pipeline.
Installation
Das Paket @sumeria.ai/qi installiert die Befehle qi und qi-mcp. Node 20 oder neuer.
npm install -g @sumeria.ai/qi # the qi and qi-mcp commands, Node 20+
qi --helpZugangsdaten
qi auth login fragt zuerst, wo Sie arbeiten — Ihre Organisation, Suche per E-Mail oder ein persönliches Konto (Free oder Pro) — und öffnet dann den Browser, damit Sie diesen Computer bestätigen: Der Schlüssel wird erstellt und in Ihrem Home-Ordner gespeichert, nur für Sie lesbar. Um stattdessen einen Schlüssel aus API Keys zu verwenden, führen Sie qi auth login --key aus; er wird bei der Eingabe nicht angezeigt. Schlüssel haben die Form sk_live_tenant.… und enthalten ihren Tenant: Es gibt weder Tenant noch URL einzugeben.
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 hat die Umgebung Vorrang vor der Datei: Es wird nichts auf die Festplatte geschrieben.
# 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 environmentEs gibt absichtlich kein API-Schlüssel-Flag: Ein Argument landet in Ihrem Shell-Verlauf und, solange der Prozess läuft, in der Prozessliste, die jeder Benutzer auf dem Rechner lesen kann.
Umgebungsvariablen
| Variable | Wofür |
|---|---|
QI_API_KEY | Der geheime Schlüssel. |
QI_TENANT | Nur für ältere Schlüssel (sk_live_ gefolgt von Hex), die ihren Tenant nicht enthalten. |
QI_BASE_URL | Fortgeschritten: zeigt auf eine andere Umgebung. Normalerweise nicht nötig. |
QI_CONFIG_PATH | Optional: verschiebt die Konfigurationsdatei (und state.json daneben). |
QI_STATE_PATH | Optional: verschiebt die Zustandsdatei von qi watch. |
QI_LANG | Optional: CLI-Sprache (en, es, …). |
Befehle
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 commandLange Dateilisten werden von selbst in Stapel zu 10 aufgeteilt, und eine abgelehnte Datei reißt die übrigen nicht mit: Sie wird beiseitegelegt und der Stapel erneut gesendet.
Ein erfolgreicher Upload bedeutet, dass die Dateien angenommen und eingereiht wurden. Transkription und Analyse dauern Minuten: qi interactions wait blockiert, bis jede Phase abgeschlossen ist.
Optionen
Auflisten und Export
| Option | Wofür |
|---|---|
--limit <n> --page <n> | Seitengröße (höchstens 200) und Seite, ab 0. |
--from <date> --to <date> | ISO-Daten, immer zusammen. |
--type <audio|text> | audio oder text. Standard ist audio. |
--agent-type <human|bot> | human oder bot: wer geantwortet hat. |
--form <id> | Nur mit diesem Formular (ID) bewertete Interaktionen. |
--all | Jede Seite, nicht nur eine. |
--format <csv|json> --out <file> | Export: csv oder json, in eine Datei oder auf die Standardausgabe. |
--with-answers | Export: die Antworten jeder Interaktion hinzufügen. |
--timeout <s> --interval <s> | Zeitsteuerung von wait und watch, in Sekunden. |
--json | JSON-Ausgabe, für Skripte. |
Dateien und Namen
| Option | Wofür |
|---|---|
-r, --recursive | In Unterordner absteigen. |
--include <glob> --exclude <glob> | Wiederholbar, auf den Dateinamen angewendet. |
--prefix <p> --suffix <s> | Unter einem anderen Namen hochladen (oder umbenennen); die Datei auf der Festplatte bleibt unberührt. |
--key <KEY> --key-from-folder | Formularschlüssel, angehängt als _KEY (gemeinsamer Tenant), oder der Name des Ordners. |
--company <c> | Eigener Tenant: auch das Unternehmenssegment prüfen. |
Upload
| Option | Wofür |
|---|---|
--form <key|id> | Formular nach Schlüssel oder ID. |
--analysis <full|transcript> | Gemeinsamer Tenant: full oder transcript. |
--bot <bot_id|name> | Bot-Profil nach bot_id oder Name (upload bot). |
--concurrency <n> | Gleichzeitige Anfragen mit je 10 Dateien. Standard ist 2. |
--retries <n> | Wiederholungen bei 429 und 5xx, mit exponentiellem Backoff. Standard ist 3. |
--dry-run | Die endgültigen Namen und das, was abgelehnt würde, ausgeben; nichts senden. |
--convert <mp3|wav|…> | Vor dem Hochladen mit ffmpeg konvertieren. |
-i, --interactive | Formular, Bot und Analyse aus einem Menü wählen. |
Konvertierung
| Option | Wofür |
|---|---|
--to <mp3|wav|flac|ogg|m4a> | Ausgabeformat: mp3, wav, flac, ogg oder m4a. |
--bitrate <64k> --mono --sample-rate <hz> --trim-silence --normalize | Einstellungen des konvertierten Audios. |
--out-dir <dir> | Ausgabeordner. |
-y, --yes | ffmpeg ohne Nachfrage installieren. Ohne Terminal gibt die CLI nur den Befehl aus: Sie installiert nie stillschweigend. |
Überwachen und planen
| Option | Wofür |
|---|---|
--type <audio|text|bot> | Kanal von watch: audio, text oder bot. |
--interval <s> | Wie oft der Ordner geprüft wird, in Sekunden. Standard ist 60. |
--settle <s> | Sekunden, die die Dateigröße unverändert bleiben muss, bevor die Datei übernommen wird. Standard ist 2. |
--done-dir <dir> | Das Gesendete dorthin verschieben. |
--once | Nur eine Runde, für einen Scheduler. |
--every "<cron>" | Cron-Ausdruck für schedule print. |
--platform <linux|darwin|win32> | Für welches System der Befehl ausgegeben wird. |
--name <task> | Name der geplanten Aufgabe. |
Rezepte
Einen Ordner hochladen
Unterordner durchlaufen, nach Muster filtern und das Formular für den gesamten Stapel wählen.
# 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 -iPräfix, Suffix und Schlüssel
Sie ändern den Namen, unter dem jede Datei gesendet wird, nicht die Datei. Probieren Sie zuerst --dry-run; qi rename --apply ist das Einzige, das auf der Festplatte umbenennt.
# 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_ --applyVor dem Hochladen konvertieren
Verwendet das bereits installierte ffmpeg. Falls keines vorhanden ist, fragt es in einem Terminal vor der Installation nach (winget, brew, apt oder dnf, je nach 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 ./mp3Einen Ordner überwachen
Es merkt sich in ~/.qi/state.json, was es gesendet hat (Pfad, Größe und Änderungszeit): Eine Datei wird einmal gesendet und nur erneut, wenn sie sich ändert. Eine fehlgeschlagene wird in der nächsten Runde wiederholt.
# 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 --onceMit Cron oder Aufgabenplanung planen
qi schedule print gibt die Crontab-Zeile oder den Befehl schtasks /Create aus, mit absoluten Pfaden zu node und zur CLI. Es installiert nichts: Sie fügen die Zeile selbst hinzu.
# 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:\grabacionesErgebnisse lesen und exportieren
CSV folgt RFC 4180, und Text, der mit =, +, - oder @ beginnt, erhält ein Apostroph davor, damit eine Tabellenkalkulation ihn anzeigt, statt ihn auszuführen.
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 | Bedeutung |
|---|---|
0 | In Ordnung. |
1 | Die Anfrage ist fehlgeschlagen: Der Grund steht auf stderr. |
2 | Der Befehl war falsch. |
Gebaut für Cron und CI. Ein teilweiser Upload beendet sich mit 1 und erklärt den Grund pro Datei:
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 für Agenten
Fügen Sie dies in einen Coding-Agenten (Claude Code, Cursor, …) ein, damit er die CLI in Ihr Projekt einbindet.
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.