リファレンス
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 はまず勤務先を尋ねます(組織、メールで検索、または個人アカウント(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 machineCI では、ファイルよりも環境変数が優先されます。ディスクには何も書き込まれません。
# 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 environmentAPI キーのフラグは意図的に用意していません。引数はシェルの履歴に残り、プロセスの実行中は、マシン上のすべてのユーザーが読み取れるプロセス一覧にも表示されるためです。
環境変数
| 変数 | 用途 |
|---|---|
QI_API_KEY | シークレットキー。 |
QI_TENANT | テナントを含まない旧形式のキー(sk_live_ の後に 16 進数)の場合のみ。 |
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 件ずつのバッチに分割され、拒否されたファイルが 1 つあっても残りは影響を受けません。そのファイルは除外され、バッチが再送されます。
アップロードが成功したことは、ファイルが受理されキューに入ったことを意味します。文字起こしと分析には数分かかります。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 | 1 ページだけでなく、すべてのページ。 |
--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 | 1 回だけ実行します。スケジューラー向けです。 |
--every "<cron>" | schedule print の cron 式。 |
--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 --oncecron またはタスクスケジューラーでスケジュール
qi schedule print は、node と CLI への絶対パス付きで、crontab の行または schtasks /Create コマンドを表示します。何もインストールしません。行はご自身で追加してください。
# 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.