Developer platform · v2

Reference

View as MarkdownAll docs

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.

bash
npm install -g @dvaarikai/cli
dvaarik --version

Or 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:

bash
dvaarik login     # asks for the key; what you type is hidden
dvaarik whoami    # the API address, the project and the key's first 14 characters

login 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:

CommandsScopes
agents list, agents get, calls list, calls get, analytics, listenvoice:read
agents exportvoice:read and provider_account:read
agents delete, agents rotate-secret, agents test, calls createvoice:write
agents importvoice:write and provider_account:read
logs, listen --webhookswebhook:read
logs without --projectalso project:read, which tells the tool its project

Commands#

CommandWhat it does
dvaarik loginSave a project API key (asked for without echo, or piped in)
dvaarik logoutForget a saved login
dvaarik whoamiShow the API address, project and key prefix in use
dvaarik agents listList 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 listList calls, newest first (--agent, --status, --since, --until, --limit)
dvaarik calls get <call>Show one call (--transcript adds what was said)
dvaarik calls createRing a phone number with an agent, from one of your own numbers (--agent, --to, --from)
dvaarik logsList webhook deliveries, newest first, with your endpoint's answer
dvaarik analyticsCalls, minutes, charges and chats for whole days (--from, --to, --timezone, --csv)
dvaarik listenWatch calls (and webhook deliveries) as they change, by polling
dvaarik mcpRun 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:

bash
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 applies

One agent per file (several YAML documents in one file work too; JSON is accepted), with its tests:

yaml
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_url and tool_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 by import: run dvaarik 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 writes is_active: false only for a switched-off agent, so a file without it switches the agent on, and the plan says so.
  • The plan comes first. --dry-run prints every change and every variable it would read and sends nothing; --dry-run --exit-code exits 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-tests deletes tests that are not in the files. --skip-missing-secrets leaves 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.

yaml
# 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:

bash
claude mcp add dvaarik -- npx -y @dvaarikai/cli mcp

Cursor, or any client that takes JSON:

json
{"mcpServers": {"dvaarik": {"command": "npx", "args": ["-y", "@dvaarikai/cli", "mcp"]}}}
ToolKindWhat it does
list_agentsreadThe project's agents
get_agentreadOne agent, by id or exact name
list_callsreadCalls, newest first
get_callreadOne call: status, timing, cost and how it ended
get_call_transcriptreadWhat was said on a call
get_analyticsreadCalls, minutes, charges and chats for whole days
list_webhook_deliveriesreadWebhook deliveries and your endpoint's answers
list_provider_accountsreadThe AI and speech accounts agents can run on
list_carrier_numbersreadYour phone numbers and the agent each answers with
list_agent_testsreadAn agent's test chats and their last results
get_test_runreadOne test run with its checks and chat
export_agentsreadAgents as YAML in the import format, without secrets
create_agentwriteMake an agent
update_agentwriteChange an agent
run_agent_testswriteStart an agent's tests
place_callcallRing a real phone number (only with --allow-calls)
  • dvaarik mcp --read-only offers only the read tools.
  • place_call rings real phones and spends money, so it is offered only with dvaarik mcp --allow-calls (never with --read-only). It takes an optional idempotency_key, so a retried call never rings twice.
  • create_agent and update_agent set webhook_url, tool_webhook_url and mcp_servers (where an agent sends call data) only when you start the server with dvaarik 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_agent and update_agent refuse ${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#

  • listen polls; 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_config from 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#

CodeMeaning
0Done (also listen stopped with Ctrl+C)
1It failed: the API refused, a test did not pass, a wait timed out
2The command was wrong: an unknown option, a missing argument, not logged in
3agents import --dry-run --exit-code found changes to make
130Stopped with Ctrl+C at a question

Use one project per boundary

Provider secrets stay encrypted and project API keys stay on your server.