# CLI: Logs, metrics, alerts, crashes, vectors and AI tools
Source: https://sovaria.in/docs/cli-logs-and-ai

Read logs, request metrics and per-route latency, manage SLO alerts and crash reports, work with vectors, knowledge bases (RAG) and embeddings, talk to your agents, and connect AI assistants over MCP with sov.

`sov ai credits` shows your Sovariq credits (left today and this month, grants, and the limits set for you); owners and admins set who can use Sovariq and caps per member and project with `sov ai limits` ([Sovariq credits and limits](https://sovaria.in/docs/sovariq-credits)).

Credits and limits:
```bash
sov ai credits
sov ai limits set-member <user id> --day 500
sov ai limits access admins
```

`sov metrics routes` ranks your API's routes by traffic with p50/p95/p99 latency and errors, per environment; `sov alerts` emails the team or posts a signed webhook when latency, 5xx rate, function failures or database connections cross a threshold ([Alerts: latency, errors, function failures and connections](https://sovaria.in/docs/slo-alerts)).

Find the slow route, then alert on it:
```bash
sov metrics routes --hours 168
sov alerts create --metric latency_p95_ms --threshold 800 --target "GET /rest/v1/orders" --window 15
sov alerts list
```

AI assistants connect to the hosted MCP server at `https://api.sovaria.in/mcp` with an OAuth sign-in ([Connect AI assistants (MCP): Claude, ChatGPT, Cursor and VS Code](https://sovaria.in/docs/mcp)): `sov mcp config --remote` prints the entry for your app, `sov mcp connections` lists what you connected and `sov mcp disconnect` ends one. `sov mcp serve` runs the same tools locally over stdio with your CLI login.

Connect an assistant:
```bash
sov mcp config --remote --client cursor           # or vscode, claude-code, claude, chatgpt
sov mcp config --remote --code                      # MCP code mode: search_api + execute
sov mcp connections
sov mcp disconnect <connection id>
sov openapi --version 3.2 -o openapi.json           # the public API description (no sign-in)
```

Knowledge bases ([Knowledge bases (RAG)](https://sovaria.in/docs/knowledge-bases)): `sov knowledge` (alias `sov kb`) creates one, adds files, text or web pages, and searches with citations; `sov agents run <name> "question"` asks one of your agents by name or id and streams the answer (`--thread` continues a conversation, the question can come from stdin, `-q` prints only the answer); `sov agents list` shows them. `sov vector embedding-key` switches the project to your own embedding key.

RAG from the terminal:
```bash
sov kb create support_docs --access app_users
sov kb add support_docs --file handbook.pdf
sov kb search support_docs "refund window"
sov agents run support-bot "Can I return a gift card?"
echo "Summarise today's tickets" | sov agents run digest -q
```

## sov logs

API and audit logs

### sov logs api
`sov logs api [OPTIONS]`
Show recent API audit events (console Logs → API page).

### sov logs requests
`sov logs requests [OPTIONS]`
The project's recent API requests (what the console's Observability › Request logs shows).
Follow mode asks only for requests newer than the last one shown, so it stays cheap.

### sov logs why
`sov logs why [OPTIONS] TRACE_ID`
Why a request was refused or failed: the check or service that decided it, the reason, every hop.

### sov logs refused
`sov logs refused [OPTIONS]`
The project's latest refused or failed requests, each with why.

## sov metrics

Request metrics and per-route p50/p95/p99 latency

### sov metrics
`sov metrics [OPTIONS]`
Request metrics and per-route p50/p95/p99 latency

### sov metrics routes
`sov metrics routes [OPTIONS]`
p50/p95/p99 latency and errors per route (method + path with ids collapsed), busiest first.

## sov alerts

SLO alerts: latency, errors, function failures, connections → email/webhook

### sov alerts list
`sov alerts list [OPTIONS]`
Alert rules with their state (ok, firing, no_data, paused) and the plan limit.

### sov alerts create
`sov alerts create [OPTIONS]`
Create an alert rule.
A webhook's signing secret is printed once: store it to verify X-Sovaria-Signature.

### sov alerts pause
`sov alerts pause [OPTIONS] RULE_ID`
Stop checking and notifying for a rule.

### sov alerts resume
`sov alerts resume [OPTIONS] RULE_ID`
Check and notify again.

### sov alerts test
`sov alerts test [OPTIONS] RULE_ID`
Measure the rule now and send a test to its webhook (no email).

### sov alerts delete
`sov alerts delete [OPTIONS] RULE_ID`
Delete an alert rule.

### sov alerts events
`sov alerts events [OPTIONS]`
Fired and resolved alerts, newest first.

## sov crashes

App crash reports, release health, source maps / mappings / dSYMs

### sov crashes list
`sov crashes list [OPTIONS]`
Crash issues, most recent first.

### sov crashes show
`sov crashes show [OPTIONS] FINGERPRINT`
One issue: stack (symbolicated), breadcrumbs, device and release of the latest report, releases and daily counts.

### sov crashes resolve
`sov crashes resolve [OPTIONS] FINGERPRINT`
Mark resolved (it reopens if the crash happens again).

### sov crashes ignore
`sov crashes ignore [OPTIONS] FINGERPRINT`
Hide an issue you won't fix.

### sov crashes releases
`sov crashes releases [OPTIONS]`
Release health: sessions, crash-free sessions and users, and adoption per release.

### sov crashes trends
`sov crashes trends [OPTIONS]`
Crash events over time and the releases, environments and platforms they came from.

### sov crashes upload-symbols
`sov crashes upload-symbols [OPTIONS] PATHS`
Find and upload every symbol file a release needs, for all platforms, in one go: Apple dSYMs, Android NDK library symbols (by build id), R8/ProGuard mappings, and JavaScript / React Native (Hermes) source maps.
Only symbol tables leave your machine for dSYMs and .so files, never the full debug info. Symbols already uploaded unchanged are skipped; a file the server refuses doesn't stop the others (the exit code is 1 if any failed).

### sov crashes debug-files
`sov crashes debug-files [OPTIONS]`
Uploaded source maps, mappings and symbols, with the storage used.

### sov crashes debug-files-delete
`sov crashes debug-files-delete [OPTIONS] FILE_ID`
Delete one debug file.

### sov crashes sourcemaps upload
`sov crashes sourcemaps upload [OPTIONS] PATH`
Upload a release's source maps.
Each is named after its minified file (dist/assets/app.js.map → ~/assets/app.js), which is how crash frames find it.

### sov crashes mapping upload
`sov crashes mapping upload [OPTIONS] PATH`
Upload an R8/ProGuard mapping file for one Android release.

### sov crashes dsym upload
`sov crashes dsym upload [OPTIONS] PATH`
Upload the function symbols of dSYMs (matched to crashes by image UUID, so no --release).
Only the symbol table leaves your machine; frames get function + offset (Swift names stay mangled).

## sov perf

Client performance: web vitals, network vs server, app start, screens

### sov perf summary
`sov perf summary [OPTIONS]`
p50 / p75 / p95 per metric, with web-vitals ratings (good / needs improvement / poor at p75).

### sov perf network
`sov perf network [OPTIONS]`
Each route's time measured in the app next to the gateway's server time for the same route.

### sov perf slow
`sov perf slow [OPTIONS]`
The slowest client requests, each with its trace id (open one with `sov perf trace`).

### sov perf trace
`sov perf trace [OPTIONS] TRACE_ID`
One request end to end: the app's spans and the server's hops (kept for failed and refused requests).

## sov vector

Vector embeddings and semantic search

### sov vector embed
`sov vector embed [OPTIONS] TEXT`
Generate embeddings for text inputs.

### sov vector upsert
`sov vector upsert [OPTIONS] COLLECTION`
Embed and upsert documents into a vector collection.

### sov vector search
`sov vector search [OPTIONS] COLLECTION QUERY`
Search a vector collection by meaning, words or both.

### sov vector app-search
`sov vector app-search [OPTIONS] COLLECTION`
Let the project's apps (anon key, signed-in users) search a collection.
Apps can never write or list it.

### sov vector reembed
`sov vector reembed [OPTIONS] COLLECTION`
Embed every stored text again with the project's current model.

### sov vector sql-search
`sov vector sql-search [OPTIONS] TABLE`
Search a SQL table by meaning, words or both (only rows you may read).

### sov vector sql-status
`sov vector sql-status [OPTIONS]`
pgvector on the project database: vector columns, their indexes (method, metric, building/ready) and row estimates.

### sov vector sql-enable
`sov vector sql-enable [OPTIONS]`
Turn pgvector on for the project database.

### sov vector sql-table
`sov vector sql-table [OPTIONS] TABLE`
Create a documents table (id, content, metadata, embedding vector(n)) with an HNSW index.

### sov vector sql-index
`sov vector sql-index [OPTIONS] TABLE`
Create an HNSW or IVFFlat index (built concurrently: writes keep working; sql-status shows building/ready).

### sov vector auto-status
`sov vector auto-status [OPTIONS]`
Tables with automatic embeddings: rows embedded and waiting, last error, the project's model.

### sov vector auto-on
`sov vector auto-on [OPTIONS] TABLE`
Keep a vector column embedded from text columns; new and edited rows are embedded in the background.

### sov vector auto-off
`sov vector auto-off [OPTIONS] TABLE`
Stop keeping a table's vectors up to date (the column and its vectors stay).

### sov vector auto-sync
`sov vector auto-sync [OPTIONS]`
Embed waiting rows now instead of on the next background pass.

### sov vector collections
`sov vector collections [OPTIONS]`
List vector collections in the current project scope.

### sov vector records
`sov vector records [OPTIONS] COLLECTION`
List records in a vector collection.

### sov vector delete-record
`sov vector delete-record [OPTIONS] COLLECTION RECORD_ID`
Delete one record from a vector collection.

### sov vector delete-collection
`sov vector delete-collection [OPTIONS] COLLECTION`
Delete an entire vector collection.

### sov vector embedding-model
`sov vector embedding-model [OPTIONS]`
The model this project embeds with, who pays for it (Sovaria or your key), dimensions and list price.

### sov vector embedding-key
`sov vector embedding-key [OPTIONS]`
Embed with your own provider key (owners and admins).
The key is tested, encrypted and never shown again.

### sov vector embedding-managed
`sov vector embedding-managed [OPTIONS]`
Go back to Sovaria's managed embedding model (your stored key is deleted).

### sov vector embedding-usage
`sov vector embedding-usage [OPTIONS]`
Texts embedded, tokens and estimated cost per month, model and who paid.

## sov knowledge

Knowledge bases (RAG): documents in, cited passages out

### sov knowledge list
`sov knowledge list [OPTIONS]`
Knowledge bases with documents, sections, tokens, sections still embedding and estimated cost.

### sov knowledge create
`sov knowledge create [OPTIONS] NAME`
Create a knowledge base (chunks table, row policies and automatic embeddings).

### sov knowledge add
`sov knowledge add [OPTIONS] NAME`
Add or replace a document from a file, a web page or text.
Only new or changed sections are embedded.

### sov knowledge docs
`sov knowledge docs [OPTIONS] NAME`
Documents you may read: title, source, sections, tokens and whether they are still embedding.

### sov knowledge rm-doc
`sov knowledge rm-doc [OPTIONS] NAME DOCUMENT_ID`
Remove one document (all its sections).

### sov knowledge search
`sov knowledge search [OPTIONS] NAME QUERY`
Passages that answer a question, best first, with numbered citations.

### sov knowledge sources
`sov knowledge sources [OPTIONS] NAME`
URL documents fetched again on a schedule: next fetch and last error.

### sov knowledge set
`sov knowledge set [OPTIONS] NAME`
Change who can read it, whether app users may add documents, or its description.

### sov knowledge delete
`sov knowledge delete [OPTIONS] NAME`
Delete a knowledge base and every document in it.

## sov kb

Knowledge bases (alias of `sov knowledge`)

### sov kb list
`sov kb list [OPTIONS]`
Knowledge bases with documents, sections, tokens, sections still embedding and estimated cost.

### sov kb create
`sov kb create [OPTIONS] NAME`
Create a knowledge base (chunks table, row policies and automatic embeddings).

### sov kb add
`sov kb add [OPTIONS] NAME`
Add or replace a document from a file, a web page or text.
Only new or changed sections are embedded.

### sov kb docs
`sov kb docs [OPTIONS] NAME`
Documents you may read: title, source, sections, tokens and whether they are still embedding.

### sov kb rm-doc
`sov kb rm-doc [OPTIONS] NAME DOCUMENT_ID`
Remove one document (all its sections).

### sov kb search
`sov kb search [OPTIONS] NAME QUERY`
Passages that answer a question, best first, with numbered citations.

### sov kb sources
`sov kb sources [OPTIONS] NAME`
URL documents fetched again on a schedule: next fetch and last error.

### sov kb set
`sov kb set [OPTIONS] NAME`
Change who can read it, whether app users may add documents, or its description.

### sov kb delete
`sov kb delete [OPTIONS] NAME`
Delete a knowledge base and every document in it.

## sov agents

Talk to your project's agents

### sov agents list
`sov agents list [OPTIONS]`
The project's agents (name, id, who can use it) and the plan's agent allowance.

### sov agents run
`sov agents run [OPTIONS] AGENT [MESSAGE]`
Ask a project agent something; its answer streams.
It acts with your permissions.

Examples: sov agents run support-bot "Where is order 1042?" · echo "Summarise this" | sov agents run digest

### sov agents threads
`sov agents threads [OPTIONS] AGENT_ID`
Your threads with this agent, newest first.

### sov agents versions
`sov agents versions [OPTIONS] AGENT_ID`
An agent's published version and its kept versions.

### sov agents publish
`sov agents publish [OPTIONS] AGENT_ID`
Publish the agent's current definition; app users run it from now on.

### sov agents rollback
`sov agents rollback [OPTIONS] AGENT_ID VERSION`
Make an older version current again (it is published as a new version).

### sov agents compare
`sov agents compare [OPTIONS] AGENT_ID A [B]`
What changed between two versions (or a version and the draft).

## sov mcp

MCP server for AI assistants (Claude, Cursor)

### sov mcp serve
`sov mcp serve [OPTIONS]`
Run the MCP server over stdio using your current login and scope.

### sov mcp config
`sov mcp config [OPTIONS]`
Print an MCP client config: the hosted server (--remote) or one that launches `sov mcp serve`.

### sov mcp connections
`sov mcp connections [OPTIONS]`
AI assistants you connected to the hosted MCP server.

### sov mcp disconnect
`sov mcp disconnect [OPTIONS] CONNECTION_ID`
End a connection now: the assistant's tokens stop working at once.

### sov mcp org
`sov mcp org [OPTIONS]`
Whether the organization's members may connect AI assistants, and (owners/admins) their connections.

## sov openapi

Download the public API description: OpenAPI 3.1 / 3.2 or Arazzo

### sov openapi
`sov openapi [OPTIONS]`
Download the public API description: OpenAPI 3.1 / 3.2 or Arazzo

## sov gateway

Model gateway: routes, fallbacks, cache, usage per model

### sov gateway routes
`sov gateway routes [OPTIONS]`
Routes, the models they may use and the plan's limits.

### sov gateway set
`sov gateway set [OPTIONS] NAME`
Create or change a route.

### sov gateway delete
`sov gateway delete [OPTIONS] NAME`
`sov gateway delete`.

### sov gateway complete
`sov gateway complete [OPTIONS] ROUTE PROMPT`
One completion on a route (shows which model answered and whether it came from the cache).

### sov gateway usage
`sov gateway usage [OPTIONS]`
Requests, errors, fallbacks, cache hits, tokens and latency per model.

### sov gateway cache-clear
`sov gateway cache-clear [OPTIONS]`
`sov gateway cache-clear`.

## sov sovariq

Sovariq: usage (tokens, cache hits, credits per day), credits and packs

### sov sovariq usage
`sov sovariq usage [OPTIONS]`
Sovariq requests, tokens, cache-hit rate and credits per day (calls on your own model key use no credits).

### sov sovariq credits
`sov sovariq credits [OPTIONS]`
Your Sovariq credits now, and the limits that apply to you.

### sov sovariq packs
`sov sovariq packs [OPTIONS]`
Sovariq credit packs for sale (12-month credits, paid plans), your packs and the Sovariq wallet cap.

### sov sovariq buy-pack
`sov sovariq buy-pack [OPTIONS] PACK_ID`
Buy a credit pack: from the wallet here, or by card / UPI in the console (the CLI never takes a card).

## sov ai

Sovariq credits and limits: sov ai credits, sov ai limits

### sov ai credits
`sov ai credits [OPTIONS]`
Your Sovariq credits now, and the limits that apply to you.

### sov ai packs
`sov ai packs [OPTIONS]`
Sovariq credit packs for sale (12-month credits, paid plans), your packs and the Sovariq wallet cap.

### sov ai buy-pack
`sov ai buy-pack [OPTIONS] PACK_ID`
Buy a credit pack: from the wallet here, or by card / UPI in the console (the CLI never takes a card).

### sov ai limits
`sov ai limits [OPTIONS]`
The organization's Sovariq limits: who can use it, caps per member and project

### sov ai limits set-member
`sov ai limits set-member [OPTIONS] USER_ID`
Cap one member's Sovariq credits (owners and admins).

### sov ai limits remove-member
`sov ai limits remove-member [OPTIONS] USER_ID`
Remove a member's own cap (the default for members applies again).

### sov ai limits set-project
`sov ai limits set-project [OPTIONS] PROJECT`
Cap everything Sovariq does in one project, whoever asks.

### sov ai limits remove-project
`sov ai limits remove-project [OPTIONS] PROJECT`
Remove a project's Sovariq cap.

### sov ai limits set-default
`sov ai limits set-default [OPTIONS]`
The cap for every member without their own (new members too).
No --day/--month removes it.

### sov ai limits access
`sov ai limits access [OPTIONS] MODE`
Who can use Sovariq: everyone, owners and admins only, or chosen members.
