Skip to content

Caveman Cloud· Hosted & VPCBuild & Deploy Agents

Develop Locally, Deploy, Run, and Roll Back Agents

Iterate locally with cvm agent dev, ship immutable revisions with cvm deploy, stream sessions with cvm run, fork or export sessions to evals, and roll back cleanly.

Every Caveman agent follows a web-deploy lifecycle: iterate locally with zero Cloud credentials, inspect a --dry-run deploy plan, publish an immutable revision, stream live runs, and roll back or fork any session from one CLI.

1. Develop locally with hot reload#

cvm agent dev ./my-agent

cvm agent dev starts a loopback-only dev server at http://127.0.0.1:4317 (override with --port):

  • Watches your agent folder and recompiles agent.json on every save.
  • Mounts declared drives to local folders under .caveman/drives/<drive-name>/ with zero Cloud credentials required.
  • Serves an interactive chat UI, manifest inspector, approval simulator, and trigger tester.
  • Pass --trigger schedule:<name> or --trigger webhook to test scheduled or webhook prompts directly.

2. Deploy an immutable revision#

# Preview exact build digest, connector plan, and API calls without sending anything
cvm deploy ./my-agent --budget 2 --dry-run

# Build, upload if changed, and activate the live revision
cvm deploy ./my-agent --name pr-reviewer --repo acme/app --base-branch main --budget 2

How cvm deploy works:

  • Deduplicated builds. Computes the deterministic SHA-256 build locally. If neither the build nor settings changed, cvm deploy prints unchanged and creates no revision.
  • Deployment naming. Uses --name, or lowercases the agent's name replacing characters outside a-z, 0-9, and - with -.
  • Settings persistence. Existing live settings carry forward; --repo, --base-branch, --model, and --budget USD update only the flags you specify.
  • Git provenance. When run inside a git checkout, records cli plus the commit SHA and branch name (never your remote URL, local path, or author).
  • Connector preflight plan. If AGENT.md declares connectors, cvm deploy fetches a dry plan showing each connector's status, tool count, token budget, and required grants. On a terminal, it offers to connect or accept missing tools inline. If a deploy widens permissions you do not manage, it enters held status (exit 0, prints cvm connect requests) until a connector manager approves.

3. Run and stream a session#

cvm run pr-reviewer "Review PR #42 for tenancy bugs"

cvm run creates a session against the deployment's live revision and streams assistant messages, one line per tool call, usage, and final status until the turn finishes or parks for an external action.

Useful flags:

  • --subject KEY=VALUE (repeatable): tag the session with custom subject metadata.
  • --no-follow: start the session, print its session ID, and exit immediately.
  • --timeout SECONDS: bound how long the CLI waits for idle output (default 900; ending the wait does not cancel the remote session).
  • cvm run --session SESSION_ID: re-attach and follow an existing session.

Exit codes for cvm run: 0 turn ended cleanly, 1 error, 4 deployment paused or archived, 6 waiting for an action cvm cannot provide or wait timeout reached.

4. Manage deployments, repos, and rollbacks#

cvm deployments                                 # list active deployments (--archived includes archived)
cvm deployments get pr-reviewer # live revision, settings, status
cvm deployments revisions pr-reviewer # immutable revision history, newest first
cvm deployments rollback pr-reviewer 2 # create a new live revision copying revision 2
cvm deployments pause pr-reviewer # stop new runs while preserving history
cvm deployments resume pr-reviewer # resume accepting runs
cvm deployments schedules pr-reviewer # inspect cron schedules
cvm deployments channels pr-reviewer # inspect connected Slack/GitHub channels
cvm deployments connect-repo acme/app --path ./agents/pr-reviewer --name pr-reviewer
cvm deployments sources # list connected git deployment sources
cvm deployments archive pr-reviewer --yes # permanently archive and free the name

5. Inspect, fork, and turn sessions into evals#

Every session carries one append-only event log, enabling time-travel debugging and regression testing:

# Inspect pending approvals, timers, or external waits keeping a session parked
cvm sessions waits SESSION_ID

# Time-travel fork a session at sequence 14 with a different model or message
cvm sessions fork SESSION_ID --at 14 --model claude-sonnet-5-5 --message "Try the minimal fix"

# Export a failing production session into a deterministic replay eval file
cvm sessions to-eval SESSION_ID --out evals/regression-42.eval.json

# Migrate a parked session to a newer deployment revision
cvm sessions migrate SESSION_ID --revision 5

Exporting a real failure with cvm sessions to-eval lets you lock the bug down in CI with cvm evals ci before rolling out a fix.

Verify and undo#

Check which revision is live right now:

cvm deployments revisions pr-reviewer

Roll back in one command:

cvm deployments rollback pr-reviewer PREVIOUS_REVISION_NUMBER

Next: connect org MCP servers and inject scoped secrets in Connectors & Secrets.

Esc

Start here