# CLI

`arvm` is the command-line client of the [API](api.md). Each command calls the API with your key, so a program can do whatever the CLI does. This page is the help the CLI prints, for each of its 88 commands. `--help` after a command prints the same text.

[Quickstart](quickstart.md#1-install-the-cli) installs the CLI and signs it in.

```text
Quick start:
  arvm login                      sign in from a browser
  arvm new                        create a machine and wait until it runs
  arvm ssh <machine>              open a shell in it
  arvm exec <machine> -- uname -r run one command and get its exit code
  arvm stop <machine>             stop paying for compute; the disk is kept
  arvm rm <machine> --yes         delete it

A machine is named by its name or its ID (m_...). A stopped machine costs
nothing. A machine with no activity is stopped after its idle timeout, one
hour unless --idle-timeout says otherwise.

Credentials:
  arvm login stores an API key in the user's config directory, mode 0600.
  ARVM_API_KEY  an API key to use instead, for CI and agents; no login needed
  ARVM_API_URL  the API to talk to; --api-url overrides it

Output:
  Text for a terminal. JSON when stdout is not a terminal, or with --json:
  the API's own objects, and a JSON array for a list. --json=false forces
  text. exec, ssh, cp, forward, ssh-config and agent-instructions carry a
  command's own output and print JSON only with --json.

Errors go to stderr: "error: <code>: <detail>" on a terminal, and otherwise
(or with --json) {"error": {"code": ..., "detail": ...}}, for every command.
<code> is the API's stable error code, such as insufficient_balance or
machine_not_running.

When no answer of the API's ends a request, the CLI says only what it knows.
A request it could not send (api_unreachable), and a read the API did not
answer (no_answer), changed nothing: exit 9. Any other request may have been
carried out: exit 12 (outcome_unknown), with the
request ID to quote when an answer brought one. Check before running the
command again; "arvm new" names the --idempotency-key that makes running it
again safe. A command that waits exits 10 when a read of the wait fails, as
when the wait runs out: wait_unanswered, or wait_refused when the API refused
the read. The request the wait follows was accepted; the read's own error is
the error's "cause", never the command's outcome.

Exit codes:
  0    success
  1    an error not listed below, including an API 5xx
  2    a bad flag or argument, or a request the API calls invalid (HTTP 400)
  3    not logged in, or the API refused the key (HTTP 401)
  4    not allowed: a plan limit is reached, the org is suspended, or the key is read-only (HTTP 403)
  5    no such machine, snapshot, key or endpoint (HTTP 404)
  6    wrong state or a name already taken, e.g. machine_not_running (HTTP 409)
  7    the balance is empty, or the subscription ended: insufficient_balance, subscription_required (HTTP 402)
  8    rate limited (HTTP 429)
  9    the request that failed changed nothing: no capacity, or the machine's host or disk is unreachable (HTTP 503), or the API could not be sent the request (api_unreachable), or did not answer it and it only reads (no_answer); from exec, only when nothing ran
  10   a machine or snapshot failed, or did not reach the wanted state before --timeout (wait_timeout) or before a read of the wait failed (wait_unanswered, wait_refused; the read's error is its cause)
  11   the machine was created and runs, and its setup script failed, timed out or was interrupted
  12   whether a request that changes something was carried out is unknown (outcome_unknown), or, from exec, whether its command ran (exec_outcome_unknown): the API said so, or the ending was not the API's answer, such as a proxy's or the gateway's 502 or a connection lost after the request was sent; a command may not have started, may have run, or may still be running; check its effects before running it again
  130  interrupted (Ctrl-C)
  exec, ssh, cp and forward exit with the remote command's own code instead.

AI agents: run "arvm agent-instructions" for a page to put in AGENTS.md.
```

## Global flags

Every command takes these.

```text
      --api-url string   the API to talk to (env ARVM_API_URL)
      --json             print JSON; the default when stdout is not a terminal (--json=false forces text)
```

## Commands

### Machines

| Command | What it does |
|---|---|
| [`arvm context`](#arvm-context) | Show machines to reuse, ready snapshots, balance and limits in one call |
| [`arvm new`](#arvm-new) | Create a machine and wait until it runs |
| [`arvm ls`](#arvm-ls) | List machines |
| [`arvm get`](#arvm-get) | Show one machine |
| [`arvm set`](#arvm-set) | Update a machine's idle timeout, labels, inbound policy, name or size |
| [`arvm start`](#arvm-start) | Start one or more stopped machines |
| [`arvm stop`](#arvm-stop) | Stop one or more machines and keep their disks |
| [`arvm restart`](#arvm-restart) | Stop and start one or more machines |
| [`arvm rm`](#arvm-rm) | Delete one or more machines and their disks |
| [`arvm rename`](#arvm-rename) | Rename a machine |
| [`arvm resize`](#arvm-resize) | Change a stopped machine's size |
| [`arvm inbound`](#arvm-inbound) | Open or close a machine's public IPv6 address to the internet |
| [`arvm wait`](#arvm-wait) | Wait for a machine or snapshot to reach a desired state |
| [`arvm run`](#arvm-run) | Run a command in an ephemeral machine and delete it afterward |
| [`arvm metrics`](#arvm-metrics) | Show CPU, memory, disk and network metrics for a machine |
| [`arvm top`](#arvm-top) | Show live CPU, memory, disk, network and burn rate for running machines |
| [`arvm events`](#arvm-events) | Show a machine's activity, or follow it |
| [`arvm snapshot`](#arvm-snapshot) | Save, list and delete copies of a machine's disk |
| [`arvm snapshot create`](#arvm-snapshot-create) | Snapshot a machine's disk |
| [`arvm snapshot ls`](#arvm-snapshot-ls) | List snapshots |
| [`arvm snapshot rm`](#arvm-snapshot-rm) | Delete a snapshot |
| [`arvm sizes`](#arvm-sizes) | List machine sizes and what an hour of each costs |
| [`arvm regions`](#arvm-regions) | List regions |
| [`arvm images`](#arvm-images) | List images |

### Worktree & local dev

| Command | What it does |
|---|---|
| [`arvm init`](#arvm-init) | Inspect this repository and scaffold an arvm.toml manifest |
| [`arvm bind`](#arvm-bind) | Bind the current git worktree to a machine, or show its binding |
| [`arvm dev`](#arvm-dev) | Run services from arvm.toml in the bound box and wire local proxy ports |
| [`arvm logs`](#arvm-logs) | Read or stream logs for a dev service in the bound box |
| [`arvm sleep`](#arvm-sleep) | Stop the bound worktree box (or named machines) without losing disk |
| [`arvm wake`](#arvm-wake) | Start the bound worktree box (or named machines) |
| [`arvm fork`](#arvm-fork) | Snapshot and clone a running or stopped box into a new box |
| [`arvm pull`](#arvm-pull) | Copy files from the bound box workspace back into the local worktree |
| [`arvm browser`](#arvm-browser) | Drive headless Chromium inside the bound box over CDP with a JS snippet |
| [`arvm focus`](#arvm-focus) | Switch which worktree box receives bare http://localhost:<port> traffic |
| [`arvm proxy`](#arvm-proxy) | Run and inspect the local HTTP/WebSocket box proxy daemon (arvmd) |
| [`arvm proxy start`](#arvm-proxy-start) | Run the local HTTP + WebSocket reverse proxy daemon (arvmd) |
| [`arvm proxy status`](#arvm-proxy-status) | Show arvmd status, active listeners, bound worktrees, and focus |
| [`arvm proxy stop`](#arvm-proxy-stop) | Stop a running arvmd proxy daemon |

### Reach a machine

| Command | What it does |
|---|---|
| [`arvm ssh`](#arvm-ssh) | Open a shell in a machine, or run a command over SSH |
| [`arvm exec`](#arvm-exec) | Run a command in a machine through the API and get its exit code |
| [`arvm job`](#arvm-job) | Run a command in a machine that outlives the request, and follow it |
| [`arvm job start`](#arvm-job-start) | Start a background job in a machine |
| [`arvm job status`](#arvm-job-status) | Show whether a job runs, or how it ended |
| [`arvm job logs`](#arvm-job-logs) | Print the end of a job's output |
| [`arvm job stop`](#arvm-job-stop) | Stop a running job |
| [`arvm cp`](#arvm-cp) | Copy files to or from a machine |
| [`arvm files`](#arvm-files) | Read, write, list and delete files in a machine through the API |
| [`arvm files ls`](#arvm-files-ls) | List a directory in a machine through the API |
| [`arvm files cat`](#arvm-files-cat) | Read a file from a machine through the API |
| [`arvm files put`](#arvm-files-put) | Upload a file to a machine through the API |
| [`arvm files rm`](#arvm-files-rm) | Delete a file or directory in a machine through the API |
| [`arvm sync`](#arvm-sync) | Copy a local directory into a machine through the API, without SSH |
| [`arvm forward`](#arvm-forward) | Forward local ports to a machine |
| [`arvm ssh-config`](#arvm-ssh-config) | Print or install SSH config, so plain `ssh <machine>` and editors work |
| [`arvm expose`](#arvm-expose) | Give a port of a machine an HTTPS URL |
| [`arvm unexpose`](#arvm-unexpose) | Take a port's HTTPS URL away |
| [`arvm endpoints`](#arvm-endpoints) | List a machine's HTTPS URLs |

### Account

| Command | What it does |
|---|---|
| [`arvm login`](#arvm-login) | Sign in from a browser |
| [`arvm logout`](#arvm-logout) | Sign out and revoke the stored key |
| [`arvm whoami`](#arvm-whoami) | Show the signed-in user, the org, its plan and its balance |
| [`arvm keys`](#arvm-keys) | Create, list and revoke API keys |
| [`arvm keys create`](#arvm-keys-create) | Create an API key and print its secret once |
| [`arvm keys ls`](#arvm-keys-ls) | List API keys |
| [`arvm keys rm`](#arvm-keys-rm) | Revoke an API key |
| [`arvm ssh-keys`](#arvm-ssh-keys) | Add, list and remove the org's SSH public keys |
| [`arvm ssh-keys add`](#arvm-ssh-keys-add) | Add an SSH public key |
| [`arvm ssh-keys ls`](#arvm-ssh-keys-ls) | List SSH keys |
| [`arvm ssh-keys rm`](#arvm-ssh-keys-rm) | Remove an SSH key |
| [`arvm billing`](#arvm-billing) | Show the plan, the balance and the hours left at each size |
| [`arvm billing auto-top-up`](#arvm-billing-auto-top-up) | Show auto top-up: charging the saved card when the balance runs low |
| [`arvm billing auto-top-up off`](#arvm-billing-auto-top-up-off) | Turn auto top-up off |
| [`arvm usage`](#arvm-usage) | Show what was used and what it cost |
| [`arvm open`](#arvm-open) | Open the dashboard, a page or a machine in a browser |
| [`arvm doctor`](#arvm-doctor) | Check API reachability, credentials, balance, SSH key and SSH config |
| [`arvm feedback`](#arvm-feedback) | Send product feedback directly to the arvm team |

### Automation & agents

| Command | What it does |
|---|---|
| [`arvm api`](#arvm-api) | Inspect and call any operation from the OpenAPI 3.1.2 contract |
| [`arvm api list`](#arvm-api-list) | List every public API operation |
| [`arvm api describe`](#arvm-api-describe) | Show an operation's endpoint, scope, parameters, schemas and examples |
| [`arvm api call`](#arvm-api-call) | Call any API operation directly |
| [`arvm mcp`](#arvm-mcp) | Serve arvm's tools to an AI agent over the Model Context Protocol (stdio) |
| [`arvm skill`](#arvm-skill) | Install and manage self-updating AI agent skills for arvm |
| [`arvm skill setup`](#arvm-skill-setup) | Install or update the self-updating arvm skill stub |
| [`arvm skill status`](#arvm-skill-status) | Check the arvm skill status across agent harnesses |
| [`arvm skill show`](#arvm-skill-show) | Print the live AI agent instructions guide |
| [`arvm skill remove`](#arvm-skill-remove) | Remove arvm-managed skill stubs |

### Other

| Command | What it does |
|---|---|
| [`arvm agent-instructions`](#arvm-agent-instructions) | Print how an AI agent should use this CLI, for AGENTS.md |
| [`arvm completion`](#arvm-completion) | Generate shell completion scripts with dynamic resource completions |
| [`arvm version`](#arvm-version) | Print the CLI's version |

## arvm context

Show machines to reuse, ready snapshots, balance and limits in one call.

```text
arvm context [flags]

Prints, in one call, what an agent reads before it creates a machine: the
org's machines (running and stopped, with labels and age), its ready
snapshots, the balance and the hours it buys at each size, each plan limit
beside what is used of it, the sizes and their rates, and a recommended size:
the default size when the plan has room for one more of it, else the largest
smaller size that fits, else null.

Reuse a running machine, or start a stopped one, before creating another.
With --label, only machines with those labels are listed; the limits still
count every machine.

Flags:
      --label stringArray   list only machines with this KEY=VALUE label; repeat to require several
```

```sh
arvm context
arvm context --label owner=agent-run-42 --json | jq '.machines[] | select(.phase == "running") | .name'
```

## arvm new

Create a machine and wait until it runs.

```text
arvm new [flags]

Creates a machine and starts it. Every flag is optional: with none, the
machine gets the default size, image and region and a generated three-word
name. The command waits until the machine is running, then prints it, the SSH
command and how long it took.

With --ssh, once the machine is running (and any --setup script has succeeded)
the command replaces itself with an interactive SSH session into it.

With JSON output the result is the API's machine object, plus
"cli": {"elapsed_ms": N}, the time from the request to "running".

With --setup, the machine runs the script in the file once, when it first
runs: as the login user, who has sudo, in that user's home directory, with the
machine's --env. The file is at most 64 KiB, and its first line chooses the
interpreter (without one, bash runs it). The command then also waits for the
script to end. A script may run for 30 minutes: give --timeout that long.
If the script fails, times out or is interrupted, the machine still runs and
the command exits 11 with the machine's name in the error; the script's
output is in the machine, in /var/log/acre-setup.log (the last 40 lines are
printed to stderr automatically). The script is never run again, and "arvm get"
shows how it ended. With --no-wait the command waits for neither.

Billing starts when the machine runs and stops when it is stopped. Common
errors: insufficient_balance (exit 7), limit_exceeded (exit 4), name_taken
(exit 6), no_capacity (exit 9). After no_capacity no machine was created:
run the command again later.

Aliases: create

Flags:
      --env stringArray          a KEY=VALUE environment variable, or KEY to read from the local environment; repeat for several
      --env-file stringArray     read KEY=VALUE environment variables from a file; repeat for several
      --from-snapshot string     start the disk as a copy of this snapshot (name or ID) instead of the image
      --idempotency-key string   send this Idempotency-Key, so repeating the command cannot create a second machine (default: a random key)
      --idle-timeout string      stop the machine after this long with no activity, e.g. 30m or 8h; 'never' turns idle stop off (default: 1h)
      --image string             an image from 'arvm images' (default: the default image)
      --inbound string           open or closed: whether the internet can open connections to the machine's public IPv6 address (default: open)
      --label stringArray        a KEY=VALUE label to find the machine by; repeat for several
      --name string              the machine's name: lowercase letters, digits and hyphens (default: three generated words)
      --no-wait                  return as soon as the API has the request, without waiting for running
      --region string            a region from 'arvm regions' (default: the default region)
      --setup string             a file with a script to run once in the machine when it first runs, at most 64 KiB; - reads it from standard input
      --size string              a size from 'arvm sizes' (default: the default size)
      --ssh                      connect over SSH as soon as the machine is running
      --ssh-key stringArray      an SSH key ID to install in the guest; repeat for several (default: every key of the org)
      --timeout duration         how long to wait for running (default 5m0s)
```

```sh
arvm new
arvm new --name api-staging --size large --label env=staging
arvm new --env DATABASE_URL=postgres://db.internal/app --idle-timeout never
arvm new --from-snapshot before-upgrade
arvm new --setup ./setup.sh --timeout 30m
arvm new --json | jq -r .name
```

## arvm ls

List machines.

```text
arvm ls [flags]

Lists the org's machines, newest first. A machine is left out once its deletion
is asked for. A machine the platform stopped has the reason beside its phase:
"stopped (idle_timeout)". Running machines with an idle timeout show how much
idle time remains before auto-stop.

With -q/--quiet, prints only machine names, one per line, even when piped.

Aliases: list

Flags:
      --label stringArray   keep machines with this KEY=VALUE label; repeat to require several
      --phase string        keep machines in this phase (e.g. running, stopped)
  -q, --quiet               print only machine names, one per line
```

```sh
arvm ls
arvm ls --label env=staging
arvm ls --phase running -q
arvm ls --json | jq -r '.[] | select(.phase == "running") | .name'
```

## arvm get

Show one machine.

```text
arvm get <machine>

Shows a machine: its phase, size, SSH command and addresses. "desired" is what
was asked for (running, stopped, deleted) and "phase" is where the machine is.
A machine the platform stopped says why and when, in "stopped by platform".

Aliases: info
```

```sh
arvm get calm-river-otter
arvm get calm-river-otter --json | jq -r .phase
```

## arvm set

Update a machine's idle timeout, labels, inbound policy, name or size.

```text
arvm set <machine> [flags]

Updates one or more settings on an existing machine (PATCH /v1/machines/{id}).
--label merges with the machine's existing labels; pass --unset-label <key> to
remove a label. Changing --size requires the machine to be stopped.

Flags:
      --idle-timeout string       stop after this long with no activity, e.g. 30m or 8h; 'never' turns idle stop off
      --inbound string            open or closed: whether the internet can reach the machine's public IPv6 address
      --label stringArray         set a KEY=VALUE label (merged with existing labels); repeat for several
      --name string               rename the machine
      --size string               change the size of a stopped machine
      --unset-label stringArray   remove a label by key; repeat for several
```

```sh
arvm set calm-river-otter --idle-timeout never
arvm set calm-river-otter --label env=staging --idle-timeout 2h
arvm set calm-river-otter --inbound closed
```

## arvm start

Start one or more stopped machines.

```text
arvm start <machine>... [flags]

Starts one or more machines (by name, ID, or --label) and waits until they
are running. Each machine's disk and SSH address are unchanged. Starting a
running machine succeeds. With multiple targets or --label, JSON output is an
array. Fails with insufficient_balance (exit 7) when the balance is empty,
and with no_capacity (exit 9) when the server that holds the machine's disk
is full.

Flags:
      --label stringArray   select machines with this KEY=VALUE label; repeat to require several
      --no-wait             return as soon as the API has the request, without waiting for running
      --timeout duration    how long to wait for running (default 5m0s)
```

```sh
arvm start calm-river-otter
arvm start calm-river-otter --no-wait
```

## arvm stop

Stop one or more machines and keep their disks.

```text
arvm stop <machine>... [flags]

Shuts down one or more machines (by name, ID, --label, or --all) and waits
until they are stopped. Disks are kept and billing for compute stops at the
request. Stopping a stopped machine succeeds. With multiple targets, --label
or --all, JSON output is an array.

Flags:
      --all                 stop every running machine in the org
      --label stringArray   select machines with this KEY=VALUE label; repeat to require several
      --no-wait             return as soon as the API has the request, without waiting for stopped
      --timeout duration    how long to wait for stopped (default 5m0s)
```

```sh
arvm stop calm-river-otter
arvm stop calm-river-otter --no-wait
```

## arvm restart

Stop and start one or more machines.

```text
arvm restart <machine>... [flags]

Stops one or more machines (by name, ID, or --label), starts them again and
waits until they are running. Restarting a stopped machine starts it, and
fails as a start does: insufficient_balance (exit 7), or no_capacity (exit 9)
with the machine still stopped. With multiple targets or --label, JSON output
is an array.

Flags:
      --label stringArray   select machines with this KEY=VALUE label; repeat to require several
      --no-wait             return as soon as the API has the request, without waiting for running
      --timeout duration    how long to wait for running (default 5m0s)
```

```sh
arvm restart calm-river-otter
arvm restart calm-river-otter --no-wait
```

## arvm rm

Delete one or more machines and their disks.

```text
arvm rm <machine>... [flags]

Deletes one or more machines (by name, ID, or --label) and their disks, and
waits until they are gone. This cannot be undone; snapshots of a machine are
kept. Without --yes the command asks you to confirm first: for one machine,
type its name; for several, type "delete". A script or an agent has nobody
to answer and must pass --yes: without it the command deletes nothing and
exits 2. With multiple targets or --label, JSON output is an array.

Aliases: delete

Flags:
      --label stringArray   delete machines with this KEY=VALUE label; repeat to require several
      --no-wait             return as soon as the API has the request, without waiting for deleted
      --timeout duration    how long to wait for deleted (default 5m0s)
  -y, --yes                 delete without asking for confirmation
```

```sh
arvm rm calm-river-otter --yes
```

## arvm rename

Rename a machine.

```text
arvm rename <machine> <new-name>

Gives a machine a new name. Its ID and its endpoint URLs do not change; its
SSH command does, because it contains the name. Fails with name_taken (exit 6)
when another machine of the org has the name.
```

```sh
arvm rename calm-river-otter api-staging
```

## arvm resize

Change a stopped machine's size.

```text
arvm resize <machine> <size>

Changes the machine's size to one from "arvm sizes". The machine must be
stopped: otherwise the command fails with machine_not_stopped (exit 6).
```

```sh
arvm stop calm-river-otter && arvm resize calm-river-otter large && arvm start calm-river-otter
```

## arvm inbound

Open or close a machine's public IPv6 address to the internet.

```text
arvm inbound <machine> <open|closed>

Sets whether the internet can open connections to the machine's public IPv6
address, which "arvm get" prints. With "open", TCP, UDP and ping from anywhere
reach the machine on every port, and what answers is the machine's to decide:
what listens in it, and its own firewall. With "closed", every new connection
from outside is dropped before it reaches the machine.

The change takes effect within seconds, and the machine is not restarted.
Connections that are open when a machine is closed stay open until they end.
"arvm ssh", "arvm exec", "arvm cp" and the machine's public URLs go through
the gateway and work either way.
```

```sh
arvm inbound calm-river-otter closed
arvm inbound calm-river-otter open
```

## arvm wait

Wait for a machine or snapshot to reach a desired state.

```text
arvm wait <machine|snapshot> [flags]

Waits until a machine reaches a phase ("running", "stopped", "deleted") or
finishes its setup script ("setup-done"), or until a snapshot (snap_... or
--until ready) becomes "ready".

Decouples starting an operation (--no-wait) from waiting for it, so scripts
and agents never need manual polling loops. Exits 10 on timeout or resource
failure, and exits 11 when waiting on --until setup-done and the setup script
did not succeed.

Flags:
      --for duration   how long to wait before timing out (default 5m0s)
      --until string   state to wait for: running, stopped, deleted, setup-done, or ready (for snapshots)
```

```sh
arvm wait calm-river-otter --until running
arvm wait calm-river-otter --until running --for 2m
arvm wait before-upgrade --until ready
```

## arvm run

Run a command in an ephemeral machine and delete it afterward.

```text
arvm run [flags] -- <command> [args...]

Creates a temporary machine, waits for it to run, executes the given command
through the API, deletes the machine (even on Ctrl-C) and exits with the
remote command's exit code.

Pass --keep-on-failure to preserve the temporary machine if the command exits
non-zero or cannot finish so you can inspect it with "arvm ssh" or "arvm exec".

Flags:
      --boot-timeout duration   how long to wait for the temporary machine to boot (default 5m0s)
      --cwd string              the directory to run in (default: /home/dev)
      --env stringArray         a KEY=VALUE environment variable, or KEY to read from the local environment; repeat for several
      --env-file stringArray    read KEY=VALUE environment variables from a file; repeat for several
      --from-snapshot string    start the disk from this snapshot (name or ID)
      --image string            an image from 'arvm images' (default: the default image)
      --keep-on-failure         keep the temporary machine if the command fails
      --label stringArray       a KEY=VALUE label on the temporary machine; repeat for several
      --region string           a region from 'arvm regions' (default: the default region)
      --size string             a size from 'arvm sizes' (default: the default size)
      --stdin                   send standard input to the remote command
      --timeout duration        kill the command after this long, at most 1h (default 10m0s)
      --user string             the user to run as (default: dev)
```

```sh
arvm run -- echo hello
arvm run --size small -- echo ok
arvm run --from-snapshot before-upgrade --keep-on-failure -- echo ok
```

## arvm metrics

Show CPU, memory, disk and network metrics for a machine.

```text
arvm metrics <machine> [flags]

Shows recent CPU utilization, memory usage, disk usage and network throughput
for a machine (GET /v1/machines/{id}/metrics). One sample is retained per
minute for 30 days.

Flags:
      --range string   time window to inspect, e.g. 15m, 1h, 6h, 24h, 7d (default "1h")
      --step string    bucket width (15s to 24h; default: API chooses ~120 points)
```

```sh
arvm metrics calm-river-otter
arvm metrics calm-river-otter --range 6h
```

## arvm top

Show live CPU, memory, disk, network and burn rate for running machines.

```text
arvm top [flags]

Prints a compact live summary of every running machine in the org, with its
latest CPU%, memory usage, disk usage, network throughput and hourly burn rate.

Flags:
      --label stringArray   keep machines with this KEY=VALUE label; repeat to require several
```

```sh
arvm top
```

## arvm events

Show a machine's activity, or follow it.

```text
arvm events <machine> [flags]

Lists what happened to a machine, oldest first: each request that changed it,
each phase it reached and each step its host took, with how long the step
took. This is where to look when a machine is slow to start or has failed.

With -f the command stays open and prints new events as they happen, until
Ctrl-C. With JSON output, -f prints one event object per line.

Flags:
  -f, --follow      keep printing new events until Ctrl-C
      --limit int   print at most this many events, oldest first (default: all)
```

```sh
arvm events calm-river-otter
arvm events calm-river-otter -f
arvm events calm-river-otter --json | jq -r '.[] | "\(.type) \(.duration_ms)"'
```

## arvm snapshot

Save, list and delete copies of a machine's disk.

```text
arvm snapshot [flags]

A snapshot is a saved copy of a machine's disk. "arvm new --from-snapshot"
starts a new machine from one. Snapshots are a paid add-on: storage is billed
per GiB-month from the same balance while the snapshot exists.

Aliases: snapshots
```

## arvm snapshot create

Snapshot a machine's disk.

```text
arvm snapshot create <machine> [flags]

Saves a copy of the machine's disk as it is now and waits until the copy is
ready. The machine keeps running.

Flags:
      --name string        the snapshot's name (default: generated)
      --no-wait            return as soon as the API has the request, without waiting for ready
      --timeout duration   how long to wait for ready (default 5m0s)
```

```sh
arvm snapshot create calm-river-otter --name before-upgrade
```

## arvm snapshot ls

List snapshots.

```text
arvm snapshot ls [flags]

Lists the org's snapshots, newest first.

Aliases: list

Flags:
      --machine string   keep snapshots of this machine (name or ID)
```

```sh
arvm snapshot ls
arvm snapshot ls --machine calm-river-otter
```

## arvm snapshot rm

Delete a snapshot.

```text
arvm snapshot rm <snapshot> [flags]

Deletes a snapshot. This cannot be undone. Machines created from it are not
affected, and billing for its storage stops at the request. The command asks
you to type the snapshot's name, unless --yes is given.

Aliases: delete

Flags:
  -y, --yes   delete without asking for the name
```

```sh
arvm snapshot rm before-upgrade --yes
```

## arvm sizes

List machine sizes and what an hour of each costs.

```text
arvm sizes

Lists the sizes a machine can be created with, lowest price first. Needs no login. A stopped machine costs nothing.
```

```sh
arvm sizes
```

## arvm regions

List regions.

```text
arvm regions

Lists the regions a machine can be created in. Needs no login.
```

```sh
arvm regions
```

## arvm images

List images.

```text
arvm images

Lists the operating system images a machine can be created from. Needs no login.
```

```sh
arvm images
```

## arvm init

Inspect this repository and scaffold an arvm.toml manifest.

```text
arvm init [flags]

Inspects the local repository for Node, pnpm, Bun, Python, uv, Go, Rust, or
Docker Compose files and writes a clean arvm.toml describing the box defaults
([box]) and runnable services ([service.<name>]).

Non-destructive by default: refuses to overwrite an existing arvm.toml unless
--force is passed. Run this at the root of a repository or worktree.

Flags:
      --dir string      directory to inspect and write arvm.toml into (default: worktree root or cwd)
      --force           overwrite an existing arvm.toml
      --image string    override [box].image in the generated manifest
      --region string   override [box].region in the generated manifest
      --size string     override [box].size in the generated manifest
```

```sh
arvm init
arvm init --force --size large
```

## arvm bind

Bind the current git worktree to a machine, or show its binding.

```text
arvm bind [machine] [flags]

Associates the current git worktree root with an arvm machine in
~/.config/arvm/worktrees.json so commands like "arvm exec --", "arvm dev",
"arvm logs", "arvm sleep", "arvm wake", "arvm fork", "arvm pull", "arvm browser",
and "arvm focus" work without passing a machine name or ID.

With no arguments, shows the current worktree's binding. With --clear, removes
the local binding without touching the remote machine.

Flags:
      --clear               remove the binding for the current worktree
      --remote-dir string   remote workspace directory inside the machine (default "/home/dev/workspace")
```

```sh
arvm bind calm-river-otter
arvm bind
```

## arvm dev

Run services from arvm.toml in the bound box and wire local proxy ports.

```text
arvm dev [service...] [flags]

Starts one or more services declared under [service.<name>] in arvm.toml
inside the worktree's bound box, honoring dependency order (deps), syncing
the local worktree into the box, running any install step, and recording
service ports so arvmd exposes http://box-<name>.localhost:<port> (and bare
http://localhost:<port> when focused).

If no machine is bound to the current git worktree yet, provisions one using
[box] from arvm.toml and binds it automatically. On a terminal, streams logs
until Ctrl-C unless --detach is given. Without a terminal (scripts and agents),
starts the services and exits unless --follow is passed.

Flags:
  -d, --detach           start services and return without streaming logs
  -f, --follow           stream service logs until Ctrl-C
  -m, --machine string   target machine name or ID (default: current worktree box)
      --no-install       skip running each service's install command
      --no-sync          skip syncing local files into the box before starting
      --stop             stop the running dev service(s)
```

```sh
arvm dev --detach
arvm dev web --detach
arvm dev --stop
```

## arvm logs

Read or stream logs for a dev service in the bound box.

```text
arvm logs [service] [flags]

Prints or streams stdout and stderr from a service started with "arvm dev"
(or a job started with "arvm job start") in the worktree's bound box.
Wakes a sleeping box automatically via ?wake=true.

If [service] is omitted, reads the first service defined in arvm.toml.
Prints raw log lines even when piped; pass --json for a JSON object.

Flags:
      --all              print the entire log
  -f, --follow           stream new log lines until Ctrl-C
  -n, --lines int        how many lines from the end (default 100)
  -m, --machine string   target machine name or ID (default: current worktree box)
```

```sh
arvm logs web --lines 50
arvm logs --lines 50
```

## arvm sleep

Stop the bound worktree box (or named machines) without losing disk.

```text
arvm sleep [machine...] [flags]

Stops the machine bound to the current git worktree, or one or more
explicitly named machines. Stopped machines cost nothing and keep their disk.
They wake automatically on the next worktree command or localhost proxy hit.

Flags:
      --no-wait            return as soon as the API has the request, without waiting for stopped
      --timeout duration   how long to wait for stopped (default 5m0s)
```

```sh
arvm sleep
arvm sleep calm-river-otter
```

## arvm wake

Start the bound worktree box (or named machines).

```text
arvm wake [machine...] [flags]

Starts the machine bound to the current git worktree, or one or more
explicitly named machines, and waits until running. Starting an already-running
machine succeeds without restarting it.

Flags:
      --no-wait            return as soon as the API has the request, without waiting for running
      --timeout duration   how long to wait for running (default 5m0s)
```

```sh
arvm wake
arvm wake calm-river-otter
```

## arvm fork

Snapshot and clone a running or stopped box into a new box.

```text
arvm fork [name] [flags]

Snapshots the bound worktree box (or --from <machine>) and boots a new
machine from that snapshot for parallel branch experiments or agent runs.
Works whether the source box is running or stopped.

The temporary snapshot is deleted after the forked machine boots so it incurs
no ongoing snapshot storage charge, unless --keep-snapshot or --no-wait is set.
Pass --bind to rebind the current worktree to the newly forked machine.

Flags:
      --bind               rebind the current git worktree to the newly forked machine
      --from string        source machine name or ID (default: current worktree box)
      --keep-snapshot      keep the intermediate snapshot instead of deleting it
      --no-wait            return as soon as the API has the request, without waiting for running
      --region string      region for the forked machine
      --size string        size for the forked machine (default: same size as source)
      --timeout duration   how long to wait for running (default 5m0s)
```

```sh
arvm fork experiment-1
arvm fork --from calm-river-otter experiment-2
```

## arvm pull

Copy files from the bound box workspace back into the local worktree.

```text
arvm pull [path...] [flags]

Downloads files or directories from the bound box's remote workspace into
the local git worktree over the HTTP Files API (?wake=true).

Every write is jailed inside the destination directory using Go's os.Root:
absolute paths, ".." traversal segments, and symlinks pointing outside the
worktree are rejected with path_escape before any file is written.

Flags:
      --dest string           local destination root directory (default: git worktree root)
      --dry-run               list files that would be pulled without writing them
      --exclude stringArray   skip paths matching this pattern; repeat for several
  -m, --machine string        target machine name or ID (default: current worktree box)
      --no-default-excludes   include .git, node_modules, and target
      --remote-dir string     remote workspace directory inside the box (default: worktree remote dir)
```

```sh
arvm pull
arvm pull README.md
```

## arvm browser

Drive headless Chromium inside the bound box over CDP with a JS snippet.

```text
arvm browser [script-file] [flags]

Runs an async JavaScript snippet against headless Chromium inside the bound
worktree box over the Chrome DevTools Protocol (CDP), waking a sleeping box
automatically via ?wake=true.

Read the snippet from [script-file], --eval <code>, or standard input. The
snippet runs inside an async function with helpers: cdp(method, params),
goto(url), evalJS(expr), title(), text(), click(selector), and screenshot().

Flags:
      --cdp-port int       Chromium remote debugging port inside the box (default 9222)
      --ensure             start headless Chromium in the box if not already listening (default true)
  -e, --eval string        inline JavaScript snippet to execute over CDP
  -m, --machine string     target machine name or ID (default: current worktree box)
      --timeout duration   kill the browser snippet after this long, at most 1h (default 1m0s)
      --url string         navigate to this URL before running the snippet
```

```sh
arvm browser --eval 'return await title()'
arvm browser --url http://localhost:3000 --eval 'return await text()'
```

## arvm focus

Switch which worktree box receives bare http://localhost:<port> traffic.

```text
arvm focus [machine] [flags]

Selects which worktree's box receives bare http://localhost:<port> requests
through arvmd, keeping OAuth callbacks and cookies consistent while switching
between parallel branches or agents.

With no arguments, focuses the machine bound to the current git worktree.
With <machine>, focuses that machine (or its bound worktree). Pass --status
to inspect the current focus or --clear to unset it.

Flags:
      --clear    unset localhost focus
      --status   show which worktree or machine is currently focused
```

```sh
arvm focus
arvm focus calm-river-otter
arvm focus --status
```

## arvm proxy

Run and inspect the local HTTP/WebSocket box proxy daemon (arvmd).

```text
arvm proxy

Manages arvmd, the local HTTP and WebSocket reverse proxy that routes
http://box-<name>.localhost:<port> to any bound box port and routes bare
http://localhost:<port> to whichever worktree is focused ("arvm focus").
Sleeping boxes wake automatically via ?wake=true on incoming HTTP requests.
```

## arvm proxy start

Run the local HTTP + WebSocket reverse proxy daemon (arvmd).

```text
arvm proxy start [flags]

Starts the local reverse proxy on 127.0.0.1 and serves until interrupted
(Ctrl-C or SIGTERM). Forwards http://box-<name>.localhost:<port> to the
matching box port over the arvm SSH gateway, wakes sleeping boxes via
?wake=true, and forwards bare http://localhost:<port> to the focused worktree.

Ports declared by "arvm dev" in worktrees.json are bound automatically unless
--no-auto-ports is passed. Pass --port 0 to bind an ephemeral port.

Flags:
      --box-port int      target port inside the box when listening on --port 0
      --host string       loopback bind address (default "127.0.0.1")
  -i, --identity string   the private key to use; its .pub must be beside it (default: ~/.ssh/id_ed25519, id_ecdsa or id_rsa, else a key arvm makes)
      --no-auto-ports     do not auto-bind ports recorded in worktrees.json
  -p, --port ints         local loopback port to listen on (0 for ephemeral; repeat for several)
```

```sh
arvm proxy start --port 0
```

## arvm proxy status

Show arvmd status, active listeners, bound worktrees, and focus.

```text
arvm proxy status

Shows whether arvmd is running, its PID and listening loopback addresses,
the worktrees bound in ~/.config/arvm/worktrees.json, and which box currently
receives bare http://localhost:<port> traffic.
```

```sh
arvm proxy status
```

## arvm proxy stop

Stop a running arvmd proxy daemon.

```text
arvm proxy stop

Sends SIGTERM to the running arvmd process recorded in arvmd.json and
cleans up its status file. Succeeds cleanly if arvmd is already stopped.
```

```sh
arvm proxy stop
```

## arvm ssh

Open a shell in a machine, or run a command over SSH.

```text
arvm ssh <machine> [ssh options] [command...] [flags]

Runs the system's ssh against the gateway, as the right user for the machine.
Everything after the machine goes to ssh as it is: ssh options first, then a
command. With no command it opens a shell. The exit code is ssh's: the
command's own, or 255 when ssh itself fails.

Before connecting, the command starts the machine if it is stopped, and
registers this computer's public key with the org if it is not registered
(with no key in ~/.ssh, it makes one in the config directory). That start
fails as "arvm start" does: no_capacity (exit 9) when the server that holds
the machine's disk is full, with the machine still stopped.

Flags of "arvm ssh" itself go before the machine.

The gateway's host key comes from the API and is checked on the first
connection, with no prompt: a server without it is refused.

For a command's output and exit code without SSH, see "arvm exec".

Flags:
  -i, --identity string   the private key to use; its .pub must be beside it (default: ~/.ssh/id_ed25519, id_ecdsa or id_rsa, else a key arvm makes)
```

```sh
arvm ssh calm-river-otter
arvm ssh calm-river-otter uname -r
arvm ssh calm-river-otter -L 5432:localhost:5432
arvm ssh -i ~/.ssh/work calm-river-otter
```

## arvm exec

Run a command in a machine through the API and get its exit code.

```text
arvm exec [machine] -- <command> [args...] [flags]

Runs a command in the machine through the API, with no SSH and no key. Its
output is streamed to stdout and stderr as it is produced, and the command's
exit code becomes this command's exit code.

Inside a bound git worktree, omit <machine> ("arvm exec -- uname -r") to run
on the worktree's box with automatic transparent wake (?wake=true). Explicit
machine names remain supported and preserve strict machine_not_running (exit 6)
unless --wake or --start is passed.

The command is an argument vector, not a shell line: for pipes, globs or
"&&", run a shell: arvm exec <machine> -- sh -c 'cd /srv && make test'.
It runs as the user dev, in dev's home directory, and is killed after
--timeout (30s unless set; at most 1h). The machine must be running:
otherwise the command fails with machine_not_running (exit 6), unless
--wake or --start is passed to wake a stopped machine first.

Only the API's own answer says what happened to the command. Exit 9 means
nothing ran: the API answered machine_unreachable, or the request never left
this computer (api_unreachable). Any other ending says nothing about the
command: the API's exec_outcome_unknown, an answer that is not the API's (a
proxy's 502 or 504 page), or a connection that ends after the request was
sent. arvm then exits 12 (exec_outcome_unknown): the command may not have
started, may have run, or may still be running, so check what it changes
before running it again.

With --json the command runs to the end and prints one object:
{"exit_code", "stdout", "stderr", "truncated", "timed_out", "oom_killed",
"duration_ms"}; each of stdout and stderr is cut at 8 MiB. Without --json the
output is the command's own bytes, even when stdout is a pipe.

An exit code from 1 to 10 can be the command's or arvm's own. arvm's own
failure always prints "error: ..." on stderr; with --json, the command's code
is in "exit_code".

Flags:
      --cwd string             the directory to run in (default: the user's home)
      --env stringArray        a KEY=VALUE environment variable, or KEY to read from the local environment; repeat for several
      --env-file stringArray   read KEY=VALUE environment variables from a file; repeat for several
      --start                  start the machine first if it is stopped
      --stdin                  send this command's standard input to the remote command
      --timeout duration       kill the command after this long, at most 1h (default 30s)
      --user string            the user to run as (default: dev)
      --wake                   wake a stopped machine transparently via ?wake=true (default true in a bound worktree)
```

```sh
arvm exec calm-river-otter -- uname -r
arvm exec -- uname -r
arvm exec calm-river-otter --start -- uname -r
arvm exec calm-river-otter --cwd /srv/app --env CI=true --timeout 10m -- make test
arvm exec calm-river-otter -- sh -c 'systemctl is-system-running && docker ps'
echo 'PORT=8080' | arvm exec calm-river-otter --stdin -- tee /home/dev/.env
arvm exec calm-river-otter --json -- cat /etc/os-release | jq -r .stdout
```

## arvm job

Run a command in a machine that outlives the request, and follow it.

```text
arvm job

A job is a command that keeps running after the exec that started it ends,
as a systemd unit in the machine (arvm-job-<name>), with no SSH. Its output
goes to /home/dev/.arvm/jobs/<name>/log and its exit code is kept after it
ends. A process that a plain exec leaves running may be killed when the exec
ends; a job is not.
```

## arvm job start

Start a background job in a machine.

```text
arvm job start <machine> [flags] -- <command> [args...]

Starts the command as a job and returns at once. The command is run as dev
with exactly the arguments given: no shell reads them (pass sh -c '...' for
a shell line). A job keeps the machine busy only while it uses CPU, so a
long job that waits can still be stopped for idleness: start the machine
with --idle-timeout never and delete it afterwards. Fails with job_running
when a job of that name runs.

Flags:
      --cwd string             the directory to run in (default "/home/dev")
      --env stringArray        a KEY=VALUE environment variable, or KEY to read from the local environment; repeat for several
      --env-file stringArray   read KEY=VALUE environment variables from a file; repeat for several
      --name string            the job's name: lowercase letters, digits and dashes (default: job-<random>)
```

```sh
arvm job start calm-river-otter --name build -- sh -c 'make -j8 && make test'
arvm job start calm-river-otter --name web --cwd /home/dev --env PORT=8080 -- python3 -m http.server 8080
```

## arvm job status

Show whether a job runs, or how it ended.

```text
arvm job status <machine> [job]

Shows a job's state: running, exited (with its exit code) or stopped (it ended
without one: arvm job stop, or killed). Without a job, lists every job in the
machine. A job is kept until the machine is deleted.
```

```sh
arvm job status calm-river-otter build
arvm job status calm-river-otter --json | jq -r '.[] | select(.state == "running") | .job'
```

## arvm job logs

Print the end of a job's output.

```text
arvm job logs <machine> <job> [flags]

Prints the last lines of what the job wrote to stdout and stderr, together,
as raw text even when piped; --json wraps it in an object. --all prints all
of it, which an exec result cuts at 8 MiB.

Flags:
      --all         print the whole log
  -n, --lines int   how many lines from the end (default 100)
```

```sh
arvm job logs calm-river-otter build --lines 50
```

## arvm job stop

Stop a running job.

```text
arvm job stop <machine> <job>

Stops the job's unit: every process of it gets SIGTERM, then SIGKILL. Its log
is kept, and its state becomes stopped. Stopping a job that already ended
changes nothing.
```

```sh
arvm job stop calm-river-otter build
```

## arvm cp

Copy files to or from a machine.

```text
arvm cp <source>... <destination> [flags]

Copies files with the system's scp, through the gateway. A path in a machine
is written <machine>:<path>; a relative path there is relative to the home
directory of the user dev. One machine per command. Like "arvm ssh", it starts
a stopped machine and registers this computer's key first.

Aliases: scp

Flags:
  -i, --identity string   the private key to use; its .pub must be beside it (default: ~/.ssh/id_ed25519, id_ecdsa or id_rsa, else a key arvm makes)
  -r, --recursive         copy directories and what is in them
```

```sh
arvm cp ./app.tar.gz calm-river-otter:/tmp/
arvm cp calm-river-otter:/var/log/app.log .
arvm cp -r ./site calm-river-otter:site
```

## arvm files

Read, write, list and delete files in a machine through the API.

```text
arvm files [flags]

Transfers and manages files in a running machine over HTTPS through the
API (/v1/machines/{id}/files), requiring no OpenSSH client and no SSH
key. Ideal for CI, minimal containers and headless agents.
```

## arvm files ls

List a directory in a machine through the API.

```text
arvm files ls <machine> [path]

Lists the entries of one directory in a running machine through the HTTP
Files API, without SSH. Defaults to /home/dev when path is omitted.

Aliases: list
```

```sh
arvm files ls calm-river-otter
arvm files ls calm-river-otter /etc
```

## arvm files cat

Read a file from a machine through the API.

```text
arvm files cat <machine>:<path>

Prints a file's raw bytes from a running machine through the HTTP Files API,
requiring no SSH key. Writes raw bytes even when piped; pass --json to wrap
the content in a JSON object.
```

```sh
arvm files cat calm-river-otter:/etc/hostname
```

## arvm files put

Upload a file to a machine through the API.

```text
arvm files put <local-file|-> <machine>:<path> [flags]

Uploads a local file (or standard input when local-file is "-") to a running
machine through the HTTP Files API, requiring no SSH key. Files are owned by
the user dev.

Flags:
      --mode string   permission bits in octal, e.g. 0600 (default: 0644)
  -p, --parents       create missing parent directories
```

```sh
arvm files put ./app.tar.gz calm-river-otter:/tmp/app.tar.gz
```

## arvm files rm

Delete a file or directory in a machine through the API.

```text
arvm files rm <machine>:<path> [flags]

Deletes a file or directory in a running machine through the HTTP Files API,
requiring no SSH key. Pass -r/--recursive to delete a non-empty directory.

Aliases: delete

Flags:
  -r, --recursive   delete a directory and everything in it
```

```sh
arvm files put ./app.tar.gz calm-river-otter:/tmp/app.tar.gz && arvm files rm calm-river-otter:/tmp/app.tar.gz
```

## arvm sync

Copy a local directory into a machine through the API, without SSH.

```text
arvm sync <local-dir> <machine>:<remote-dir> [flags]

Packs the local directory into one gzipped tar, uploads it through the Files
API and unpacks it into the remote directory, creating it: one upload and one
exec, with no SSH key. Files already in the remote directory that the local one
does not have are kept, and files of the same path are replaced. Files are
owned by dev and keep their mode bits; symlinks stay symlinks.

Leaves out .git, node_modules and target wherever they are, unless
--no-default-excludes. --exclude adds a pattern, matched against each path
segment and against the whole path relative to the directory.

Flags:
      --exclude stringArray   leave out paths that match this pattern; repeat for several
      --no-default-excludes   keep .git, node_modules and target
```

```sh
arvm sync ./site calm-river-otter:/home/dev/site
arvm sync ./site calm-river-otter:/home/dev/site --exclude '*.log' --exclude dist
```

## arvm forward

Forward local ports to a machine.

```text
arvm forward <machine> <port>... [flags]

Forwards ports on this computer to ports in the machine, over SSH, until you
press Ctrl-C. A port is written <local>:<remote>, or once when both are the
same. Nothing is exposed to the internet; for a public URL see "arvm expose".

Flags:
  -i, --identity string   the private key to use; its .pub must be beside it (default: ~/.ssh/id_ed25519, id_ecdsa or id_rsa, else a key arvm makes)
```

```sh
arvm forward calm-river-otter 8080          # localhost:8080 -> the machine's 8080
arvm forward calm-river-otter 3000:8080 5432
```

## arvm ssh-config

Print or install SSH config, so plain `ssh <machine>` and editors work.

```text
arvm ssh-config [flags]

Prints one "Host" block per machine for ~/.ssh/config. With a block in
place, "ssh <machine>", scp, rsync and an editor's remote mode reach the
machine through the gateway with no arvm command in between. Each block
accepts only the gateway's host key, as the API states it, from a known_hosts
file of arvm's own that this command writes.

With --install the blocks go into a file of arvm's own in the config
directory, and ~/.ssh/config gets one "Include" line for it, once. From then
on "arvm new", "arvm rename" and "arvm rm" keep that file up to date. The
command also registers this computer's public key with the org.

Plain ssh does not start a stopped machine; "arvm ssh" and "arvm start" do.

Flags:
  -i, --identity string   the private key to use; its .pub must be beside it (default: ~/.ssh/id_ed25519, id_ecdsa or id_rsa, else a key arvm makes)
      --install           write the blocks to arvm's own file and include it from ~/.ssh/config
```

```sh
arvm ssh-config --install
arvm ssh-config >> ~/.ssh/config
```

## arvm expose

Give a port of a machine an HTTPS URL.

```text
arvm expose <machine> <port> [flags]

Gives a TCP port of the machine an HTTPS URL through the gateway. The URL is
private unless --public is given: it answers only a request that carries the
token in the "signed url" the command prints. With --public it answers
anyone. Running the command again changes the visibility. Pass --open to open
the URL in a browser.

Flags:
      --open     open the URL in a browser
      --public   let anyone open the URL, with no signed link
```

```sh
arvm expose calm-river-otter 8080
arvm expose calm-river-otter 8080 --public
arvm expose calm-river-otter 8080 --open
arvm expose calm-river-otter 8080 --json | jq -r .signed_url
```

## arvm unexpose

Take a port's HTTPS URL away.

```text
arvm unexpose <machine> <port>

Removes the port's URL. It stops answering at once. Fails with not_found (exit 5) when the port has no URL.
```

```sh
arvm unexpose calm-river-otter 8080
```

## arvm endpoints

List a machine's HTTPS URLs.

```text
arvm endpoints <machine>

Lists the ports of the machine that have an HTTPS URL, with the signed link of each private one.
```

```sh
arvm endpoints calm-river-otter
```

## arvm login

Sign in from a browser.

```text
arvm login [flags]

Signs this computer in. The command prints a short code and a URL, opens the
URL in a browser when it can, and waits until you confirm the code there. It
then stores an API key in the user's config directory with mode 0600.

CI and agents do not need this: set ARVM_API_KEY (from "arvm keys create").

Flags:
      --no-browser   do not open a browser; print the URL only
```

```sh
arvm login
arvm login --no-browser   # print the URL; open it on any device
```

## arvm logout

Sign out and revoke the stored key.

```text
arvm logout

Revokes the API key "arvm login" stored and deletes it from this computer.
The stored key is deleted even when it cannot be revoked; the command then
fails and names the key, so it can be revoked with "arvm keys rm".
```

```sh
arvm logout
```

## arvm whoami

Show the signed-in user, the org, its plan and its balance.

```text
arvm whoami

Shows who the credentials belong to. With an API key, the user is the key's
creator. Use it to check that ARVM_API_KEY works.
```

```sh
arvm whoami
arvm whoami --json | jq -r .org.id
```

## arvm keys

Create, list and revoke API keys.

```text
arvm keys

API keys are how programs sign in: set one as ARVM_API_KEY and every command
works with no login. A key belongs to the org. A full key can do everything
the org's members can. A read-only key can only look: it lists and shows
machines, snapshots, keys, events, metrics, usage and billing, with the names
of a machine's environment variables and not their values. Every command
that changes something through the API, or reaches into a machine through
it (exec, expose, endpoints), fails with read_only_key (exit 4). A key's
scope is chosen when it is created and never changes.

SSH does not use API keys. "arvm ssh", "arvm cp" and "arvm forward" sign in
with this computer's SSH key: with a read-only key they work only where that
key is already registered with the org, and cannot register one. A read-only
API key limits the API, not SSH: to give someone look-only access, do not
register their SSH key.

Aliases: api-keys
```

## arvm keys create

Create an API key and print its secret once.

```text
arvm keys create <name> [flags]

Creates an API key. The secret is printed by this command and never again:
only its hash is stored. With JSON output it is the "secret" field.

The key is full unless --read-only is given. Give a read-only key to a
program that watches and must not act: a dashboard, a cost report, a monitor.
It cannot run "arvm exec", read or write a machine's files through the API,
see the value of an environment variable, or get a signed link to a private
endpoint, and it cannot create another key or register an SSH key. It does
not stop SSH from a computer whose SSH key the org already has.

Flags:
      --expires-in string   how long the key works, e.g. 36h or 90d (default: it never expires)
      --read-only           a key that can only look: it changes nothing and reaches into no machine (default: a full key)
```

```sh
arvm keys create ci
arvm keys create ci --expires-in 90d
arvm keys create grafana --read-only
export ARVM_API_KEY=$(arvm keys create agent --json | jq -r .secret)
```

## arvm keys ls

List API keys.

```text
arvm keys ls

Lists the org's API keys, newest first. Secrets are never shown again.

Aliases: list
```

```sh
arvm keys ls
```

## arvm keys rm

Revoke an API key.

```text
arvm keys rm <key-id>

Revokes a key by its ID (key_...), from "arvm keys ls". The key stops working at once.

Aliases: revoke, delete
```

```sh
arvm keys rm key_01jcz3k8x0e5v9w2r4t6y8a0bq
```

## arvm ssh-keys

Add, list and remove the org's SSH public keys.

```text
arvm ssh-keys

Any SSH key of the org signs in to every machine of the org through the
gateway. "arvm ssh" registers this computer's key by itself; these commands
are for other keys.
```

## arvm ssh-keys add

Add an SSH public key.

```text
arvm ssh-keys add [public-key-file] [flags]

Adds a public key to the org. With no file, it adds this computer's default
key (~/.ssh/id_ed25519.pub, id_ecdsa.pub or id_rsa.pub), or generates and saves
a new ed25519 key in the arvm config directory if none exists. Adding a key the
org has is ssh_key_exists (exit 6).

Flags:
      --name string   a name for the key (default: this computer's hostname)
```

```sh
arvm ssh-keys add
arvm ssh-keys add ~/.ssh/work.pub --name work-laptop
```

## arvm ssh-keys ls

List SSH keys.

```text
arvm ssh-keys ls

Lists the org's SSH public keys, newest first.

Aliases: list
```

```sh
arvm ssh-keys ls
```

## arvm ssh-keys rm

Remove an SSH key.

```text
arvm ssh-keys rm <ssh-key-id>

Removes a key by its ID (sshkey_...), from "arvm ssh-keys ls". It stops signing in through the gateway at once.

Aliases: delete
```

```sh
arvm ssh-keys rm sshkey_01jcz3k8x0e5v9w2r4t6y8a0bq
```

## arvm billing

Show the plan, the balance and the hours left at each size.

```text
arvm billing

Shows the org's plan, when the current period ends, the prepaid balance, and
how long that balance runs one machine of each size. Only a running machine
uses balance. To subscribe, top up or change the card, use "arvm open". To
have the card charged when the balance runs low, see "arvm billing
auto-top-up".
```

```sh
arvm billing
arvm billing --json | jq '.runtime_remaining[] | select(.size == "default") | .seconds / 3600'
```

## arvm billing auto-top-up

Show auto top-up: charging the saved card when the balance runs low.

```text
arvm billing auto-top-up

Shows whether auto top-up is on, its three amounts, what it has charged this
calendar month (UTC), and whether a card is saved for it to charge.

Auto top-up is turned on and changed from the dashboard's billing page
("arvm open"): an API key can show it or turn it off, and cannot turn it on or
change its amounts. While it is on, the card the subscription is paid with is
charged when the balance falls under a threshold, and the amount is added to
the balance as a top-up. It never charges more in a month than the maximum you
set: when one more charge would pass it, nothing is charged, you are emailed,
and the state reads "at the monthly maximum" until the month ends. A charge
that fails stops it, with an email, until you turn it on again in the dashboard.
```

```sh
arvm billing auto-top-up
arvm billing auto-top-up --json | jq -r .state
```

## arvm billing auto-top-up off

Turn auto top-up off.

```text
arvm billing auto-top-up off

Turns auto top-up off. Nothing more is charged. A charge already sent to the card's bank still adds to the balance if it is paid.
```

```sh
arvm billing auto-top-up off
```

## arvm usage

Show what was used and what it cost.

```text
arvm usage [machine] [flags]

Without a machine: one row per day and per machine or snapshot that used
anything that day, newest day first. With a machine: its running time and
cost over the range. The range is the current calendar month in UTC unless
--from and --to say otherwise.

Flags:
      --from string   the start of the range, a date (2026-11-01) or an RFC 3339 time, inclusive
      --to string     the end of the range, exclusive
```

```sh
arvm usage
arvm usage calm-river-otter
arvm usage --from 2026-11-01 --to 2026-11-08
```

## arvm open

Open the dashboard, a page or a machine in a browser.

```text
arvm open [target] [flags]

Prints a dashboard URL and opens it in a browser. With no target, opens the
dashboard home, where you subscribe, top up and manage the card. Pass
"billing", "keys", "ssh-keys", "snapshots" or a machine name/ID to jump
straight to that page; pass --terminal with a machine to open its browser
terminal.

The dashboard URL is the one "arvm login" learned. Without a login, pass
--web-url or set ARVM_WEB_URL.

Flags:
      --no-browser       print the URL only
      --terminal         open the machine's browser terminal
      --web-url string   the dashboard's URL (env ARVM_WEB_URL)
```

```sh
arvm open
arvm open --no-browser
arvm open billing --no-browser
arvm open calm-river-otter --no-browser
arvm open calm-river-otter --terminal --no-browser
```

## arvm doctor

Check API reachability, credentials, balance, SSH key and SSH config.

```text
arvm doctor

Runs a one-shot diagnostic covering API reachability, active credential
source (including whether ARVM_API_KEY shadows credentials.json), account
subscription and balance, local SSH key registration and ~/.ssh/config Include
health. Exits 0 when all checks pass or warn, and 1 if any check fails.
```

```sh
arvm doctor
```

## arvm feedback

Send product feedback directly to the arvm team.

```text
arvm feedback [message...] [flags]

Submits product feedback through POST /v1/feedback along with your CLI
version, OS/architecture, and optional command name. Accepts the message as
positional arguments or from standard input with --stdin.

Flags:
      --command string   command name this feedback relates to (e.g. dev, pull, proxy)
      --stdin            read the feedback message from standard input
```

```sh
arvm feedback "auto-wake on exec feels instant"
arvm feedback --command dev "ports auto-wired cleanly"
```

## arvm api

Inspect and call any operation from the OpenAPI 3.1.2 contract.

```text
arvm api [flags]

Introspects the live OpenAPI 3.1.2 specification (fetched from
<api-url>/openapi.json with fallback to the embedded contract) and calls any
operation directly with your credentials, tracing headers, automatic
Idempotency-Key generation and standard arvm exit codes.
```

## arvm api list

List every public API operation.

```text
arvm api list [flags]

Lists every public API operation from the OpenAPI 3.1.2 specification, with
its HTTP method, path, required key scope and summary. Works offline by
falling back to the embedded specification.

Aliases: ls

Flags:
  -q, --quiet        print only operation IDs, one per line
      --tag string   keep operations with this OpenAPI tag (e.g. machines, billing)
```

```sh
arvm api list
arvm api list --tag machines
arvm api list -q
```

## arvm api describe

Show an operation's endpoint, scope, parameters, schemas and examples.

```text
arvm api describe <operationId>

Shows the full contract for one API operation from the OpenAPI 3.1.2
specification: HTTP method and path, required key scope, idempotency support,
parameters, request schema, response codes and examples. Works offline.
```

```sh
arvm api describe getMe
arvm api describe updateMachine
```

## arvm api call

Call any API operation directly.

```text
arvm api call <operationId> [JSON|@file|-] [flags]

Calls an API operation by its OpenAPI operationId. Use -m/--machine to fill
the {machine} parameter, -p k=v for path, query or header parameters, and an
optional inline JSON string, @file or - (stdin) for the request body.

For idempotent operations, an Idempotency-Key header is generated automatically
unless --idempotency-key is given. JSON responses are pretty-printed on a
terminal and printed as compact JSON when piped. All standard arvm RFC 9457
error handling and exit codes apply.

Flags:
      --idempotency-key string   send this Idempotency-Key header (default: generated for idempotent operations)
  -m, --machine string           machine name or ID to fill the {machine} parameter
  -p, --param stringArray        a path, query or header parameter as key=value; repeat for several
```

```sh
arvm api call getMe
arvm api call -m calm-river-otter getMachine
arvm api call -m calm-river-otter updateMachine '{"idle_timeout_seconds": null}'
```

## arvm mcp

Serve arvm's tools to an AI agent over the Model Context Protocol (stdio).

```text
arvm mcp [flags]

Runs a Model Context Protocol server on standard input and output, for an
agent harness to start: arvm_context, arvm_new, arvm_exec, arvm_job,
arvm_files, arvm_sync, arvm_expose, arvm_snapshot, arvm_stop and arvm_rm.
Each tool runs one arvm command with --json and returns its JSON, so it
needs what the command needs: ARVM_API_KEY, or a login. A failure returns the
command's error object (code, detail, hint) with isError set.

With --code-mode it serves two tools instead: arvm_api_reference, the SDKs'
Code Mode summary and the sizes, and arvm_run_code, which runs a TypeScript,
JavaScript or Python script that uses the SDK. The script gets a loopback
proxy's URL and a key only that proxy takes, never the API key; the proxy
sends on calls of machines, snapshots, sizes, regions and images, and when the
script ends, also on a throw, a timeout or a cancel, deletes every machine it
created and did not delete. The script runs as you, in this server's working
directory, with a home of its own: this keeps the key out of its environment,
and is not a sandbox.
--sdk names a checkout's sdk/ directory, built by make test-sdk, which the
script imports as "arvm" (TypeScript) or arvm (Python).

"arvm skill setup --mcp" prints the line that adds it to each harness.

Flags:
      --code-mode    serve arvm_api_reference and arvm_run_code instead of the command tools
      --sdk string   with --code-mode: a checkout's sdk/ directory, built, for scripts to import
```

```sh
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | arvm mcp
arvm mcp --code-mode --sdk ~/src/arvm/sdk
```

## arvm skill

Install and manage self-updating AI agent skills for arvm.

```text
arvm skill [flags]

Installs a tiny self-updating SKILL.md stub (metadata: arvm-stub) into
coding-agent skill directories (Claude Code, Codex, OpenCode, Pi, Antigravity,
Cursor). The stub directs agents to "arvm skill show" and "arvm api", so
upgrading the arvm binary updates every agent harness without clobbering
hand-written skills.
```

## arvm skill setup

Install or update the self-updating arvm skill stub.

```text
arvm skill setup [flags]

Writes the version-tagged arvm SKILL.md stub (metadata: arvm-stub) into the
selected agent harnesses. When --agent is omitted, targets every detected
harness on this machine (or claude if none exist yet). Never overwrites a
foreign (user-written) skill file unless --force is passed.

With --mcp, each row also says how to add "arvm mcp" to that harness as an
MCP server: the command to run, or for Cursor the file to write. Setup runs
none of them.

Flags:
      --agent stringArray   harness to install into (claude, codex, opencode, pi, agy, cursor); repeat for several
      --dry-run             show what would change without writing files
      --force               overwrite existing non-arvm (foreign) skill files
      --mcp                 also say how to add arvm mcp to each harness as an MCP server
      --project             write into project-local directories instead of user home
```

```sh
arvm skill setup --agent claude --dry-run
arvm skill setup --agent claude --mcp
arvm skill setup --agent codex --project
```

## arvm skill status

Check the arvm skill status across agent harnesses.

```text
arvm skill status [flags]

Checks each supported coding-agent harness and reports whether the arvm
skill stub is current, outdated, missing or foreign (authored outside arvm).

Flags:
      --agent stringArray   limit to this harness (claude, codex, opencode, pi, agy, cursor); repeat for several
      --project             check project-local skill directories instead of user home
```

```sh
arvm skill status
arvm skill status --project
```

## arvm skill show

Print the live AI agent instructions guide.

```text
arvm skill show

Prints the live Markdown guide telling AI agents how to use arvm: setup,
output rules, main workflow, cost, exit codes and error handling. Equivalent
to "arvm agent-instructions".
```

```sh
arvm skill show
```

## arvm skill remove

Remove arvm-managed skill stubs.

```text
arvm skill remove [flags]

Removes only SKILL.md files carrying arvm-stub metadata, leaving any
user-written (foreign) skill files untouched.

Aliases: rm

Flags:
      --agent stringArray   limit to this harness (claude, codex, opencode, pi, agy, cursor); repeat for several
      --dry-run             show what would be removed without deleting files
      --project             remove project-local skill stubs instead of user home
```

```sh
arvm skill remove --agent claude
arvm skill remove --project
```

## arvm agent-instructions

Print how an AI agent should use this CLI, for AGENTS.md.

```text
arvm agent-instructions

Prints a Markdown page that tells an AI agent how to use arvm: setup, the
main path, output, cost, exit codes and the errors it will meet. Append it to
the project's AGENTS.md or CLAUDE.md.
```

```sh
arvm agent-instructions >> AGENTS.md
```

## arvm completion

Generate shell completion scripts with dynamic resource completions.

```text
arvm completion <bash|zsh|fish|powershell>

Generates a completion script for bash, zsh, fish or powershell. Includes
dynamic tab completion for machine names, snapshots, sizes, regions, images
and OpenAPI operation IDs.

To load completions in your shell:
  bash:       source <(arvm completion bash)
  zsh:        source <(arvm completion zsh)
  fish:       arvm completion fish | source
  powershell: arvm completion powershell | Out-String | Invoke-Expression
```

```sh
arvm completion bash
arvm completion zsh
arvm completion fish
arvm completion powershell
```

## arvm version

Print the CLI's version.

```text
arvm version


```

```sh
arvm version
```
