Reference
CLI and MCP server
The dvaarik command line tool drives this API from a terminal, a CI job or an AI coding tool. It holds a local MCP server too, so Claude Code, Cursor and other MCP clients can list agents, read calls and logs, and change agents for you. It calls the same /v2 routes as your servers, with your project API key, and nothing else: no account session, no other host, no telemetry.
Install#
It needs Node.js 20 or newer.
npm install -g @dvaarikai/cli
dvaarik --versionOr run it without installing: npx @dvaarikai/cli <command>.
Log in#
Make a project API key on the console's Keys page (Projects and keys), then:
dvaarik login # asks for the key; what you type is hidden
dvaarik whoami # the API address, the project and the key's first 14 characterslogin also takes the key from a pipe: echo "$KEY" | dvaarik login. There is no --api-key flag, because a key typed on a command line stays in your shell history and in the process list. The key is checked with the API before it is saved, stored in your user config folder in a file only you can read, and sent only to the API address you logged in to. The tool never prints it: every line it writes, its errors included, shows [hidden] in its place.
In CI, set DVAARIK_API_KEY instead of logging in (and DVAARIK_PROJECT_ID when the key has no project:read). For several projects, log in once per project with a name, dvaarik login --profile staging, and add --profile staging to any command (or set DVAARIK_PROFILE). dvaarik logout forgets a saved login.
What each command needs from the key's scopes:
| Commands | Scopes |
|---|---|
agents list, agents get, calls list, calls get, analytics, listen | voice:read |
agents export | voice:read and provider_account:read |
agents delete, agents rotate-secret, agents test, calls create | voice:write |
agents import | voice:write and provider_account:read |
logs, listen --webhooks | webhook:read |
logs without --project | also project:read, which tells the tool its project |
Commands#
| Command | What it does |
|---|---|
dvaarik login | Save a project API key (asked for without echo, or piped in) |
dvaarik logout | Forget a saved login |
dvaarik whoami | Show the API address, project and key prefix in use |
dvaarik agents list | List agents (--all adds switched-off ones) |
dvaarik agents get <agent> | Show one agent, by id or exact name |
dvaarik agents delete <agent> | Delete an agent (one that took calls is switched off instead) |
dvaarik agents rotate-secret <agent> | Make a new webhook signing secret and print it once; the old one stops at once |
dvaarik agents test <agent> | Run an agent's tests and wait for the results |
dvaarik agents export [agent...] | Write agents, their tests and settings to YAML files, never a secret |
dvaarik agents import <path> | Create or update agents from YAML or JSON files, showing the plan first |
dvaarik calls list | List calls, newest first (--agent, --status, --since, --until, --limit) |
dvaarik calls get <call> | Show one call (--transcript adds what was said) |
dvaarik calls create | Ring a phone number with an agent, from one of your own numbers (--agent, --to, --from) |
dvaarik logs | List webhook deliveries, newest first, with your endpoint's answer |
dvaarik analytics | Calls, minutes, charges and chats for whole days (--from, --to, --timezone, --csv) |
dvaarik listen | Watch calls (and webhook deliveries) as they change, by polling |
dvaarik mcp | Run a local MCP server on stdio for AI coding tools |
Every command takes --help, --json (print JSON instead of text), --profile, --base-url and --verbose (each request's method, address, status and time on stderr; never a key). A command that changes something asks first in a terminal; outside one it needs --yes. calls create sends an Idempotency-Key, so a retried request never rings twice; pass your own with --idempotency-key to make your retries safe too. Money is printed exactly as the API counts it, in your wallet's currency, never rounded.
Watching calls#
dvaarik listen prints a line when a call starts, changes or ends, and with --webhooks each webhook delivery too. It asks the API every 5 seconds (--interval, at least 2): it is not a live stream, because the API has no event stream to follow. Each request counts toward your project's requests per minute, 60 unless raised, which your own servers share: listen slows down when few are left and waits as long as the API asks after a 429. Stop it with Ctrl+C.
Agents as files#
Keep agents in git and apply them like code:
dvaarik agents export # every agent to ./agents/, a file each
dvaarik agents export Support --out support.yaml
dvaarik agents import ./agents --dry-run # the plan: every change, nothing sent
dvaarik agents import ./agents # asks, then appliesOne agent per file (several YAML documents in one file work too; JSON is accepted), with its tests:
version: 1
kind: agent
agent:
name: Support
language: en-IN
pipeline_mode: cascade
pipeline_config:
stt: { account: deepgram/main, model: "<catalogue model>" }
llm: { account: google/main, model: "<catalogue model>" }
tts: { account: google/main, model: "<catalogue model>", voice: "<provider voice>" }
prompt: You answer questions for Blue Orchid Salon and book appointments.
knowledge_bases: [FAQ]
mcp_servers:
- name: crm
url: https://crm.example.com/mcp
timeout_seconds: 6
allowed_tools: [find_customer]
headers:
Authorization: ${env:SUPPORT_CRM_AUTHORIZATION}
can_hand_off: true
handoff_destinations:
- name: sales
agent: Sales
description: The caller wants to buy a package.
tests:
- name: Books a haircut
caller_persona: Asha wants a haircut on Saturday morning.
max_turns: 6
checks:
- { type: says, text: Saturday }- References are names, not ids: a provider account is
<provider>/<name>, a knowledge base and a hand-off target by their names. So the same files apply to another project that has accounts and bases of the same names. - Secrets are never written. MCP header values become
${env:NAME}placeholders, and so does a webhook, tool webhook or MCP address that carries a user name, a password, a query parameter named like a token, key, secret, signature, password or auth, or a generated token in its path or host (as Slack, Zapier and other webhook services put theirs). A placeholder is read in four places only:mcp_servers[].headers.*,mcp_servers[].url,webhook_urlandtool_webhook_url; the plan lists every variable it reads and where its value is sent. Read a file someone else wrote before you import it: its placeholders decide which of your variables go to which server. A webhook signing secret is never in a file and never printed byimport: rundvaarik agents rotate-secret <agent>to get one. - What a file leaves out is not managed: a field you delete from the file is left as it is on the agent, never reset. The one exception is
is_active: export writesis_active: falseonly for a switched-off agent, so a file without it switches the agent on, and the plan says so. - The plan comes first.
--dry-runprints every change and every variable it would read and sends nothing;--dry-run --exit-codeexits 3 when something would change (a drift check for CI). An import that switches an agent on or off says so. Before each change the agent is read again, and an agent edited in the console after the plan stops the import instead of being overwritten. - Tests are matched by name;
--prune-testsdeletes tests that are not in the files.--skip-missing-secretsleaves out a field whose variable is not set. - Knowledge-base documents and provider accounts are never exported or created (they need files and keys): make them in the console first, and the import stops when one it names is missing.
Tests in CI#
dvaarik agents test <agent> runs the agent's test chats (Agent tests) and waits: exit 0 when every test passed, 1 when one failed, ended in an error, timed out (--timeout, default 600 seconds) or the agent has no tests. --test <name> runs one test; --no-wait starts the runs, prints their ids and exits.
# GitHub Actions
- run: npx -y @dvaarikai/cli agents test Support
env:
DVAARIK_API_KEY: ${{ secrets.DVAARIK_API_KEY }}MCP server#
dvaarik mcp runs an MCP server on your machine, inside the tool, on stdio. It uses your saved login (log in once with dvaarik login), and the key never leaves your machine except to your API address. Never put the key in a project .mcp.json that git commits.
Claude Code:
claude mcp add dvaarik -- npx -y @dvaarikai/cli mcpCursor, or any client that takes JSON:
{"mcpServers": {"dvaarik": {"command": "npx", "args": ["-y", "@dvaarikai/cli", "mcp"]}}}| Tool | Kind | What it does |
|---|---|---|
list_agents | read | The project's agents |
get_agent | read | One agent, by id or exact name |
list_calls | read | Calls, newest first |
get_call | read | One call: status, timing, cost and how it ended |
get_call_transcript | read | What was said on a call |
get_analytics | read | Calls, minutes, charges and chats for whole days |
list_webhook_deliveries | read | Webhook deliveries and your endpoint's answers |
list_provider_accounts | read | The AI and speech accounts agents can run on |
list_carrier_numbers | read | Your phone numbers and the agent each answers with |
list_agent_tests | read | An agent's test chats and their last results |
get_test_run | read | One test run with its checks and chat |
export_agents | read | Agents as YAML in the import format, without secrets |
create_agent | write | Make an agent |
update_agent | write | Change an agent |
run_agent_tests | write | Start an agent's tests |
place_call | call | Ring a real phone number (only with --allow-calls) |
dvaarik mcp --read-onlyoffers only the read tools.place_callrings real phones and spends money, so it is offered only withdvaarik mcp --allow-calls(never with--read-only). It takes an optionalidempotency_key, so a retried call never rings twice.create_agentandupdate_agentsetwebhook_url,tool_webhook_urlandmcp_servers(where an agent sends call data) only when you start the server withdvaarik mcp --allow-addresses; otherwise they refuse, so text an AI tool reads cannot send your calls somewhere else.- There is no delete tool. No tool returns a key or a webhook secret, and an AI tool cannot read your environment:
create_agentandupdate_agentrefuse${env:…}placeholders and MCP header values. - What callers said and what tools return is data written by people, and the server tells the AI tool so: it is not a list of instructions.
Limits#
listenpolls; there is no live event stream on the API.- There is no log of API requests to read, and no model catalogue with a project key (the console's agent form lists them): an AI tool copies
pipeline_configfrom an agent you already have, or uses the models you name. - Exported: agents, their tests, knowledge-base names and MCP and tool settings. Not exported: knowledge-base documents, provider accounts, call lists, phone lines, webhook endpoints and alerts.
- The MCP server runs on your machine only; there is no hosted one.
Exit codes#
| Code | Meaning |
|---|---|
| 0 | Done (also listen stopped with Ctrl+C) |
| 1 | It failed: the API refused, a test did not pass, a wait timed out |
| 2 | The command was wrong: an unknown option, a missing argument, not logged in |
| 3 | agents import --dry-run --exit-code found changes to make |
| 130 | Stopped with Ctrl+C at a question |
Use one project per boundary
Provider secrets stay encrypted and project API keys stay on your server.