Skip to main content
The cvm CLI is the terminal interface for Caveman Cloud. It wraps every control plane operation so you can list projects, search traces, run SQL, start improvement attempts, and drive evals without leaving your shell.

Install and sign in

1

Install the CLI

2

Sign in

cvm login runs caveman login under the hood. One sign-in works for both the caveman and cvm CLIs. If caveman is not installed, cvm login fetches it once with npx.
3

Verify the session

Project binding and context

Most cvm commands target a project. You can set the project in several ways, checked in this order:
  1. --project UUID on the command line
  2. CAVE_PROJECT_ID environment variable
  3. cvm context bind (writes .caveman-cloud.json in the current repository)
  4. Your saved default project
When you pipe cvm output to another command, it automatically switches to JSON. On an interactive terminal it prints readable tables by default.

Output formats

Override the default with --format:

Discover commands

cvm commands ship with the Cloud release they were built from, so the command list always matches the server. Commands follow the pattern cvm <family> <verb>, which runs the Cloud operation family.verb.
Use cvm tools describe <family>.<verb> before writing scripts. It prints the input schema, required permissions, effects, and retry rules for that operation.

Common command examples

Traces

Captured payloads require the explicit payload:read permission and trace:read_payload scope. Without them, metadata reads still work but content is omitted.

SQL

Results include columns, rows, row_count, truncated, elapsed_ms, query_digest, and notices. Agent connections and sql:read keys are limited to 101 rows, 128 KiB, and 15 seconds. People get up to 10,000 rows, 8 MiB, and 30 seconds.

Ask Caveman and improvements

A turn JSON looks like {"request_id": "...", "input": {"question": "...", "window": {"from": "...", "to": "..."}}}. Preserve the run ID to inspect results later with runs.get, runs.events, and runs.result.

Credential storage and CI

Non-secret config lives at ~/.caveman-cloud/config.json with mode 0600. Auth tokens are stored in the OS keychain when available, with a ~/.caveman/credentials fallback. In CI, set CAVE_TOKEN instead of running an interactive login. For a private install, also set CAVE_API_URL. If cvm is signed out, commands exit with code 3 instead of hanging.

Exit codes

Next steps

Query with SQL

Run read-only SELECT over requests, spans, and evals.

Traces and spend

Search traces, inspect spans, and understand spend attribution.

Connect a coding agent

Use MCP to let Claude Code or Cursor operate Caveman Cloud.