> ## Documentation Index
> Fetch the complete documentation index at: /llms.txt
> Use this file to discover all available pages before exploring further.

# Commands

> The full boxd CLI command reference, grouped by task.

Every machine operation is available from the CLI, and all commands accept `--json` for scripting. This page is the full reference for the CLI on your laptop. The in-machine CLI has a different command set, and the forms that only work inside a machine are marked as such.

## The command tree

The surface is a nested tree. This is the full first level:

| Command | Alias | What it does |
| - | - | - |
| `machine` | `m` | Machines end to end: create, fork, state control, exec, files, proxies, domains, checkpoints, networks, usage and cost, per-machine settings |
| `new` | | Create a machine, from scratch, a fork, or a snapshot (shortcut for `machine new`) |
| `connect` | | Open an interactive shell in a machine (shortcut for `machine connect`) |
| `list` | `ls` | List your machines (shortcut for `machine list`) |
| `snapshots` | `snap` | Reusable snapshots of memory and disk |
| `disks` | | Standalone disks: create, attach, detach ([Disks](/guides/disks.md)) |
| `teams` | | Teams inside an org, each with an optional default snapshot ([Organizations and teams](/guides/organizations.md)) |
| `auth` | | [Login](/cli/authentication.md), identity, org context, [API keys](/cli/authentication.md#api-keys), the org's roster (`auth org`) |
| `manage` | | Org-level management: billing, usage and cost, integrations, wildcard domains, default machine size, default backup schedule, [regions](#regions) |
| `env` | | Env vars and secrets |
| `config` | | Laptop-side CLI settings |
| `docs` | | Open the boxd documentation in your browser |
| `completions` | | Set up shell tab-completion |
| `version` | | Show the CLI version |

The three shortcuts exist because creating, connecting, and listing are what you do all day: `boxd new myapp` and `boxd machine new myapp` are the same command.

`remove` is the delete verb everywhere (alias `rm`), with one exception: a team is deleted with `boxd teams destroy` (alias `rm`). The common aliases are `ls` for `list`, `info` for `machine get`, and `ssh` for `connect`. On the laptop `info` exists only as that alias (`boxd machine info myapp`). A top-level `boxd info` exists only inside a machine.

> [!TIP]
>
> `boxd <cmd> --help` is the always-current reference for flags and subcommands, straight from your installed binary. Running bare `boxd` in a terminal drops into an interactive REPL (`boxd (org)>`) where you type the same commands without the `boxd` prefix, with tab completion and arrow-key pickers for missing arguments.

## Managing machines

```bash
boxd machine new myapp                              # create a machine
boxd machine new                                    # auto-named
boxd machine new myapp --auto-suspend-timeout=60    # standby after 60 idle seconds (0 disables, the default)
boxd machine new myapp --auto-hibernate-timeout=0   # never hibernate this machine (default: 4 hours)
boxd machine new myapp --idle-ignore-outbound       # only inbound connections keep it awake (=off opts out of an org default)
boxd machine new myapp --delete-after=2h            # delete it in 2 hours (or a cron expression), see Delete after
boxd machine new myapp --shared                     # shared with the whole org from creation
boxd machine new myapp --networks=backend,cache     # join these networks instead of the default one
boxd machine new myapp --isolated                   # sandbox, see Networks below
boxd machine new myapp --no-ssh                     # SSH off, see Editor and SSH integration below
boxd machine new myapp --disk data:/mnt/data        # attach a disk at creation, see Disks below
boxd machine new myapp --vcpu 4                     # pick a size: 1 vCPU / 4 GiB, 2 / 8 GiB (default), 4 / 16 GiB or 8 / 32 GiB
boxd machine new myapp --region nyc                 # create it in New York, see Regions below
boxd machine resize myapp --memory 16G              # change the size later (a running machine reboots)
boxd machine list                                   # list your machines (alias: ls)
boxd machine get myapp                              # detailed info (status, image, auto-suspend; alias: info)
boxd machine fork myapp myapp-v2                    # fork: copy-on-write memory and disk, under 200ms
boxd machine fork myapp --auto-suspend-timeout=0    # fork with auto-suspend disabled
boxd machine fork myapp --shared                    # keep a fork of a shared machine shared (default: private to you)
boxd machine fork myapp --networks=backend          # fork onto different networks (default: inherit the source's)
boxd machine fork myapp --delete-after=0            # no delete-after timer (default: a fresh copy of the source's)
boxd machine fork myapp --ssh                       # SSH on for the fork (default: the source's setting)
boxd machine rename myapp myapp2 -y                 # rename (reboots to apply the hostname unless stopped)
boxd machine remove myapp -y                        # delete (requires -y or --confirm; alias: rm)
```

Inside a machine, `boxd machine remove --self` deletes the machine it runs on, after a yes/no question. See [Self-delete](/guides/self-delete.md).

`boxd new myapp` and `boxd m ls` are the top-level and short forms. `machine new` folds in forking (`--fork`) and creating from a snapshot (`--from-snapshot`):

```bash
boxd machine new myapp-v2 --fork myapp              # same as `machine fork myapp myapp-v2`
boxd machine new fresh --from-snapshot my-workspace # create from a snapshot (memory and disk as saved)
```

See [Suspend, resume, and hibernate](/guides/suspend-resume.md) for how the idle timers work, and [Machine sizes](/guides/resources.md#machine-sizes) for sizing. A fork and a machine created from a snapshot keep their source's size, so passing a size there is an error. The size a machine gets when you name none is the org's default:

```bash
boxd manage size                 # the org's default size and its quota (any member)
boxd manage size set --vcpu 1    # admin only: new machines get 1 vCPU / 4 GiB
```

The org can also set the [bot protection](/guides/bot-protection.md#org-default) that new machines start with, and whether their idle timers [ignore outbound traffic](/guides/suspend-resume.md#org-default). Setting a default changes your existing machines too (machines with bot protection off stay off), unless you pass `--new-only`:

```bash
boxd manage defaults                                    # the org's defaults for new machines (any member)
boxd manage defaults set bot-protection on              # admin only: new machines, and your existing ones
boxd manage defaults set bot-protection on --new-only   # admin only: machines created from now on
boxd manage defaults clear bot-protection               # back to the platform's setting; existing machines keep theirs
boxd manage defaults set idle.ignore-outbound on        # admin only: new machines, and your existing ones
boxd manage defaults clear idle.ignore-outbound         # back to the platform's setting; existing machines keep theirs
```

How many machines the org may have at once is its machine limit. Any member can read it; the org's owner can ask for more, with their login or an API key of theirs. Ask for the new total (above the current limit, at most 1000). One request is open at a time, and the owner gets an email when the limit changes:

```bash
boxd manage machine-limit                                              # the limit, machines in use, any open request (any member)
boxd manage machine-limit request --max-vms 100 --message "CI runners"  # owner only
boxd manage machine-limit --json                                       # {"org_id","org_name","max_vms","vm_count","is_owner","requested_at","requested_max_vms"}
```

With several [regions](#regions), the limit applies in each region on its own, and `manage machine-limit` shows the machines in use in each. `--json` then adds `"regions"`, one `{"region","vm_count"}` per region, and `vm_count` counts Frankfurt's.

### State control

Three categories of state transition, all `boxd machine <verb> <machine>`:

```bash
boxd machine start myapp       # start a stopped machine
boxd machine stop myapp        # stop (disk persists; running processes lost)
boxd machine pause myapp       # standby (warm: memory preserved, sub-ms resume)
boxd machine resume myapp      # resume a machine on standby
boxd machine hibernate myapp   # write memory to disk now (frees host RAM)
boxd machine wake myapp        # wake a hibernated machine (also accepts standby)
boxd machine reboot myapp      # reboot (cold: memory lost, about 2 seconds)
```

* **pause and resume.** Warm. Memory, running processes, and open sockets stay intact, and resume is sub-millisecond. This is the same mechanism as auto-suspend, only user-triggered. Status becomes `standby`. The API and SDKs report the same state as `suspended`. `resume` fails on a hibernated machine, so use `wake` there.
* **hibernate and wake.** Memory is written to disk and the machine gives up its RAM. Waking takes about 85ms.
* **reboot, and stop then start.** Cold. Memory is lost and the restart takes about 2 seconds.

Use `pause` to save cost without losing state. Use `reboot` when you need a cold restart.

## Running commands

```bash
boxd machine exec myapp -- uname -a                        # run a command
boxd machine exec myapp -- 'cd /app && npm start'          # shell constructs work
boxd machine exec myapp -e API_KEY=secret -e DEBUG=1 -- <command>  # env vars
boxd machine exec myapp --timeout 30 -- <command>          # timeout in seconds
boxd machine exec myapp --tty -- htop                      # allocate a pseudo-TTY (for interactive tools)
boxd machine exec myapp --json -- echo hello               # JSON: {"output":"hello\n","exit_code":0}
```

Exit codes are forwarded, so a remote command that exits 42 makes `boxd machine exec` exit 42.

The remote command's stdout and stderr are surfaced separately on your laptop, so shell redirects work as you'd expect:

```bash
boxd machine exec myapp -- gcc -v 2>/dev/null              # drop the version banner (it's on stderr)
boxd machine exec myapp -- cargo build 2>build.log         # only warnings/errors land in build.log
```

PTY execs (`--tty`) are the exception. The kernel TTY layer merges stderr into stdout, as terminals do, so everything arrives on stdout and `2>` filters won't separate them.

> [!NOTE]
>
> The `--` separator between the machine name and the command is optional, since everything after the machine name is treated as the command. Put exec's own flags (`-e`, `--timeout`, `--tty`) before the command, and use `--` or quotes when your command starts with a dash.

## Interactive access

`boxd connect` drops you straight into an interactive shell on the machine over the boxd API. It needs neither SSH config nor host keys, wakes a machine that is on standby or hibernated, and forwards exit codes. Type `exit` or Ctrl-D to come back to the shell on your laptop.

```bash
boxd connect myapp             # drops you into a shell (top-level shortcut)
boxd machine connect myapp     # the full path
boxd machine ssh myapp         # `ssh` is the alias of connect
```

`connect` requires an interactive terminal and refuses to run in scripts, pipes, or other non-TTY contexts. For automation, use `boxd machine exec` instead:

```bash
boxd machine exec myapp -- uptime    # one-shot, scriptable
```

## Editor and SSH integration

The CLI keeps a managed block of `Host` entries in `~/.ssh/config` **automatically**. `boxd auth login` writes it, every `machine new`, `fork`, `list`, `rename`, and `remove` refreshes it, and a background agent re-syncs it periodically, so your SSH config stays current as machines come and go. There is no separate command to run.

After the first sync, `<machine>.boxd` is reachable to plain `ssh`, `scp`, `rsync`, Cursor / VS Code Remote-SSH, JetBrains Gateway, Zed Remote, and anything else that reads SSH config:

```bash
ssh myapp.boxd                                      # plain SSH (alias carries HostName + Port)
cursor --remote ssh-remote+myapp.boxd /home/boxd    # Cursor (Remote-SSH)
code   --remote ssh-remote+myapp.boxd /home/boxd    # VS Code
# JetBrains Gateway / Zed: pick `myapp.boxd` from their host picker
```

Each machine is reachable on a dedicated SSH **port** (10000-30000 range) on the shared proxy IP, so each stanza carries a `HostName`, a `Port`, a `User`, and a managed `IdentityFile`. The CLI also pre-trusts the proxy's host key in `~/.ssh/known_hosts`, so the first connect never prompts. Connecting to the bare `<machine>.boxd.sh` hostname on port 22 reaches the proxy rather than the machine, so always use the `<machine>.boxd` alias. The managed block is bracketed with `# BEGIN boxd` / `# END boxd`, and nothing outside the markers is ever modified.

Machines in another [region](#regions) get a block of their own, with that region's address, port and host key, under the alias `<machine>.<region>.boxd`:

```bash
ssh web.nyc.boxd                                    # the machine web in New York
```

Only a key linked to the machine's owner, or to a member of its org while the machine is shared, gets past authentication on the machine's port. Any other key is refused there, as an unknown key is.

### Turn SSH off

A machine has SSH on unless you turn it off. With SSH off, nothing answers SSH for the machine, on its public address or on your org's [Tailscale](/guides/tailscale.md) or [NetBird](/guides/netbird.md) network: the connection closes before a single byte of SSH is sent. SSH sessions open to it are closed when you turn it off.

```bash
boxd machine new myapp --no-ssh                 # born with SSH off
boxd machine config set myapp ssh off           # turn it off later
boxd machine config set myapp ssh on            # and back on
```

`boxd connect`, `boxd machine exec`, file copies and the console's terminal go through the boxd API rather than SSH, so they keep working. The machine keeps its SSH port, so turning SSH back on brings back the same address and your `~/.ssh/config` entry needs no change. A fork and a machine created from a snapshot keep their source's setting unless you pass `--ssh` or `--no-ssh`. SSH can't be turned back on from inside the machine.

## Copying files

Paths after `:` are relative to `/home/boxd` unless starting with `/`. Uploads and downloads stream, and from the laptop they have no size cap.

```bash
boxd machine cp ./local.txt myapp:/home/boxd/remote.txt    # upload
boxd machine cp myapp:/home/boxd/remote.txt ./local.txt    # download
boxd machine cp myapp:/path/file -                         # download to stdout
echo data | boxd machine cp - myapp:/path/file             # upload from stdin
boxd machine cp -r ./dir myapp:dir                         # recursive
```

## Disks

A standalone disk outlives the machine it is attached to. See [Disks](/guides/disks.md) for the model.

```bash
boxd disks new data --size 10G                       # create (alias: create)
boxd disks list                                      # name, size, status, attached to (alias: ls)
boxd disks attach data myapp --mount-path /mnt/data  # one machine at a time; --read-only for a read-only mount
boxd disks detach data myapp
boxd disks remove data -y                            # must be detached first (alias: rm)
```

A machine can only mount a disk that lives on its own host, so to pair a disk with a new machine, attach it at creation and the machine is placed on the disk's host:

```bash
boxd new myapp --disk data                          # mounted at /mnt/data
boxd new myapp --disk data:/srv/data:ro             # <disk>[:<mount-path>][:ro], repeatable
```

Not available with `--fork` or `--from-snapshot`. Create the machine first, then `disks attach`.

A disk lives in one [region](#regions) and attaches to machines there. `boxd disks new data --size 10G --region nyc` makes one in New York.

## Proxy management

Every machine gets `https://<machine>.boxd.sh` forwarding to its default port. Publish more ports, either as HTTPS subdomain proxies or as raw port forwards, all under `boxd machine proxy`.

```bash
boxd machine proxy list --vm myapp                       # list published ports (alias: ls)
boxd machine proxy add api --vm myapp --port 3001        # subdomain proxy: api.myapp.boxd.sh to port 3001
boxd machine proxy set-port --vm myapp --port 3000       # change the default proxy's target port
boxd machine proxy set-port --vm myapp --port auto       # auto-detect the listening port
boxd machine proxy remove api --vm myapp                 # remove a subdomain proxy (alias: rm)
```

Subdomain proxies are HTTPS-only. To expose a database, an SSH daemon, or any non-HTTP service, use a [raw port forward](#raw-tcp-and-udp-ports).

## Custom domains

Bring your own domain instead of `<machine>.boxd.sh`. See [Custom domains](/guides/custom-domains.md) for the full walkthrough (DNS records, confirmation step, gotchas).

```bash
boxd machine domain add app.example.com --vm myapp   # prints DNS records, then waits for Enter (or pass -y/--confirm)
boxd machine domain list                             # domain, machine, status, error (alias: ls)
boxd machine domain remove app.example.com            # unbind (alias: rm)
```

Org admins can delegate a wildcard to the whole org instead of binding machines one at a time:

```bash
boxd manage domain set preview.mysaas.com    # prints how to delegate it, then waits for Enter (or -y/--confirm)
boxd manage domain get                       # any org member can read it
boxd manage domain clear                     # admin only
```

With several [regions](#regions), the org has one wildcard domain in each, delegated to that region's nameservers. `--region` picks which, and `manage domain get --region all` lists them all. One region's domain can't be the same as, inside or around another's, so use names side by side, such as `preview.mysaas.com` and `preview-nyc.mysaas.com`.

## Raw TCP and UDP ports

Raw port forwards live under the same `machine proxy` group, selected with `--raw`. boxd opens a raw TCP or UDP port on the machine's public proxy and forwards it straight to a port inside the machine, for anything that isn't HTTP (databases, game servers, custom protocols). The public port is allocated for you. Connect on the machine's existing `<machine>.boxd.sh` endpoint at that port. See [Port forwarding](/guides/port-forwarding.md) for the concept.

```bash
boxd machine proxy add --vm myapp --port 5432 --raw            # forward a public port -> :5432 (TCP)
boxd machine proxy add --vm myapp --port 9999 --raw --udp      # UDP instead
boxd machine proxy add --vm myapp --port 7777 --raw --tcp --udp # both protocols on one allocated public port
boxd machine proxy list --vm myapp                            # raw port forwards show as kind tcp/udp
boxd machine proxy remove 5432 --vm myapp                     # remove a raw port forward by its machine port
```

Up to **3** raw port forwards per machine. Re-adding a port you already forwarded keeps the same public port and updates the protocol set. Raw port forwards are owner-only and removed automatically when the machine is deleted.

## Snapshots

A snapshot captures a running machine's memory and disk at a moment in time, replicated across a few hosts. Create a machine from it with `machine new --from-snapshot`, and it resumes with its processes already running.

```bash
boxd snapshots save myapp my-workspace              # save memory + disk as a named snapshot (machine keeps running)
boxd snapshots list                                 # name, version, status, size, used (alias: ls)
boxd snapshots remove my-workspace -y               # delete a snapshot and its replicas (alias: rm)
boxd snap save myapp my-workspace                   # `snap` is the short alias
```

Saving again under the same name replaces the version. New machines get the latest one, and older versions cannot be restored, so save under a new name to keep an old state. Snapshots are fenced to the org context that created them and never cross an org boundary. A snapshot lives in its machine's [region](#regions), and machines created from it start there.

## Checkpoints

A checkpoint captures a running machine's memory and disk on the machine's own host, restorable **in place**: the machine reboots into that exact state with the same name, URL, and ports. Checkpoints are per-machine and live and die with the machine. Use a checkpoint as a quick save point before a risky change, and a snapshot to create new machines from.

```bash
boxd machine checkpoint save myapp before-migration    # capture memory + disk (machine keeps running)
boxd machine checkpoint list myapp                     # name, status, size, created, available (alias: ls)
boxd machine checkpoint restore myapp before-migration # reboot the machine into the checkpoint (-y to skip confirm)
boxd machine checkpoint remove myapp before-migration  # delete a checkpoint (-y; alias: rm)
```

Up to 10 checkpoints per machine. `available: no` means the checkpoint's host is no longer the machine's host (for example after a migration), so it can't be restored until they line up again.

## Backups

A backup uploads a machine's **disk** to object storage, off the cluster, for disaster recovery. Backups are off by default and set per machine. Take one on demand, or set a schedule. Restoring is a full, in-place disk rewrite. See [Disaster recovery](/guides/disaster-recovery.md) for the full model.

```bash
boxd machine backup now myapp                          # back up the disk right now
boxd machine config set myapp backups.period 24h       # or schedule it: every 24h (also takes a cron expression)
boxd machine config set myapp backups.retention 30d    # keep each backup for 30 days (default: 7d)
boxd machine backup list myapp                         # id, status, size, age (alias: ls)
boxd machine backup restore myapp <backup-id>          # overwrite the disk and reboot into it (-y to skip confirm)
boxd machine backup remove myapp <backup-id>           # delete one backup (-y; alias: rm)
boxd machine config set myapp backups.period off       # disable the schedule
```

A scheduled backup can't fire more often than every 15 minutes. `backup now` is independent of the schedule and runs one capture at a time per machine. `backup remove` is refused for a backup still being captured, or one a newer unchanged-since backup still points at.

An org can hand every new machine a schedule by default. Only machines created afterwards are affected:

```bash
boxd manage backups                                    # the org's default schedule (any member; same as `get`)
boxd manage backups set --period 24h --retention 30d   # admin only
boxd manage backups clear                              # admin only: new machines get none
```

## Integrations

Over a hundred integrations (Linear, Slack, GitHub and more) are connected from the console's **Integrations** page or with the [`run` CLI](/cli/run) inside a machine (`run auth linear`). See [Connections](/guides/integrations/connections.md) for the model. From the laptop, `boxd manage integrations` lists what's connected and connects any of them by name:

```bash
boxd manage integrations                       # what's connected, for you and shared with the org (same as `list`, alias: ls)
boxd manage integrations connect claude        # sign in Claude Code on your private machines (codex works the same way)
boxd manage integrations connect git           # your GitHub sign-in for git and gh on your private machines
boxd manage integrations connect github        # the GitHub account automations and `run` act as
boxd manage integrations connect linear --scope billing   # any other integration, here shared with the org as "billing"
boxd manage integrations disconnect git        # revoke one, with --scope <name> for a shared connection
boxd manage integrations mcp linear claude     # install an integration's MCP server into these coding agents (omit for all)
boxd manage integrations mcp linear --disable  # remove it from all of them
```

## Desktop

`boxd machine desktop` prints the URL of a machine's live desktop and opens it in your browser. The owner can open it, and so can any org member when the machine is shared. See [Desktop](/guides/desktop.md).

```bash
boxd machine desktop myapp
```

### Computer use

`boxd machine computer` works a machine's desktop with screenshots, the mouse and the keyboard, for agents and scripts. The desktop starts on demand. See [Computer use](/guides/computer-use.md).

```bash
boxd machine computer myapp screenshot -o screen.png     # --format jpeg|webp, --quality, --max-width, --max-height, --crop X,Y,W,H, --delay
boxd machine computer myapp click 640 400                # --button right, --double, --triple, --modifiers ctrl+shift
boxd machine computer myapp type "hello world"           # `-` reads the text from stdin
boxd machine computer myapp key ctrl+l                   # Return, alt+Tab, ctrl+shift+t; --repeat N, --hold-ms MS
boxd machine computer myapp scroll 640 400 --down 5      # wheel clicks; --up, --left, --right
boxd machine computer myapp drag 100 100 400 300         # through more points: X Y X Y ...
boxd machine computer myapp move 10 10                   # also mouse-down, mouse-up, wait MS, cursor
boxd machine computer myapp click 640 400 --screenshot after.png --delay 500
boxd machine computer myapp screen-size 1280x800         # hold the screen at this size; --release lets go
```

Coordinates are screen pixels from the top left. Inside a machine, leave out the name to act on that machine.

## Env vars and secrets

Set environment variables and secrets once, and boxd injects them into the machines in the var's scope. `shared` reaches the org's shared machines, `private` reaches your own private machines in that org, and `all` reaches both. The default is `shared` when you are working in an org. Plain vars are cleartext and readable back. `--secret` seals a value at rest, write-only. See [Env vars and secrets](/guides/env-secrets.md) for the full model (scopes, naming, injection, host-bound secrets).

```bash
boxd env set DATABASE_URL postgres://…   # cleartext env var
boxd env set OPENAI_API_KEY sk-… --secret  # sealed, write-only, never readable back
boxd env set STRIPE_KEY sk_live_… --secret --domains api.stripe.com   # bound to the hosts it may be sent to
boxd env set STRIPE_KEY sk_live_… --secret               # rotate the value; the host binding is kept
boxd env set STRIPE_KEY sk_live_… --secret --no-domains  # drop the binding: a plain secret again
boxd env list                            # NAME / VALUE / SCOPE / HOSTS; secrets show (sealed) (alias: ls)
boxd env remove DATABASE_URL             # delete (alias: rm; --scope picks one when the name exists in several scopes)
boxd env scope OPENAI_API_KEY all        # move a secret to another scope (value preserved; --from <scope> is optional)
```

To put a literal **.env file** on **one** machine, rather than a scoped var, use `boxd env push`:

```bash
boxd env push myapp --file .env --dest ~/myapp/.env   # upload + chmod 600
```

`--file` defaults to `.env`, `--dest` to the file's name in the machine's home directory, and `--mode` to `600`.

## Usage and billing

A machine is 2 vCPU / 8 GiB RAM / 100 GB disk by default ([other sizes](/guides/resources.md#machine-sizes)). Your balance and payment live under `boxd manage billing`, and what each machine cost under `boxd manage usage`.

```bash
boxd manage billing              # balance, machines in use, default size and quota
boxd manage billing connect      # connect a payment method (opens Stripe)
boxd manage billing --open       # open the billing portal in your browser
boxd manage billing activity     # what changed the balance: top-ups, credits, usage charges
```

`manage billing activity` lists the newest first and sums usage charges per day (UTC). It defaults to the last 28 days; `--limit N` or `--all` shows more rows, and `--json` lists every individual entry.

```bash
boxd manage usage                                 # every machine in the org, most expensive first
boxd manage usage --since 7d                      # the last 7 days
boxd manage usage --since 2026-09-01 --until 2026-10-01
boxd machine usage myapp                          # one machine over its whole life
boxd machine usage myapp --since 24h
```

* **What you see.** Time running, in standby, hibernated and stopped, and the cost. `machine usage` adds vCPU-hours and RAM and disk GiB-hours. `manage usage` defaults to the last 28 days.
* **Windows.** `--since` and `--until` take a duration back from now (`24h`, `7d`, `30d`), a UTC date or time (`2026-09-01`, `2026-09-01T14:30Z`), or unix seconds. A window spans at most 366 days.
* **Estimated costs.** Usage is metered with a delay of up to 25 minutes. A cost marked `(estimated)` can still grow; one without it is final. Costs are priced at current rates, and `manage billing activity` is what was actually charged.
* **Deleted machines.** They stay in `manage usage`, and `machine usage` finds one by its name or id. If several deleted machines had the same name, the command lists their ids so you can pick one.
* **Who can see it.** Usage and billing activity are for org owners and admins.

Inside a machine, `boxd machine usage` works for that machine only and shows its own usage and cost. The other machines and the org-wide views are on your laptop.

See [boxd.sh/pricing](https://boxd.sh/pricing) for the rate card.

## Organizations

Every account works inside an organization, and every user has a default org of their own. Your active **context** decides which org a new machine is billed to and which machines `list` and `connect` see. Switching context is covered in [Org context](/cli/authentication.md#org-context). Sharing a machine opens it to every member of the org.

```bash
boxd auth switch acme            # work in the "acme" org context
boxd machine share myapp         # share a machine with the whole org (every member can reach it)
boxd machine unshare myapp       # stop sharing: private to you again (org keeps paying)
```

* In an org context, `boxd machine new` creates a machine **billed to the org but private to you**. Add `--shared` to make it visible to the whole org from creation.
* `boxd manage billing` and `boxd manage usage` follow the active context, so in an org they show the org's balance and its machines' usage.
* **Share and unshare are owner-only.** Any member can `connect` to a *shared* machine. A private machine is reachable only by its owner.
* An org has three roles: **owner**, **admin**, and **member**. See [Organizations and teams](/guides/organizations.md) for what each can do.

The org itself, its roster and its teams are managed under `boxd auth org` and `boxd teams`, the same operations the console's Organization page offers:

```bash
boxd auth org new "Acme"                             # create an org; you become its owner and the CLI switches to it
boxd auth org members                                # roster, plus pending invites for admins (alias: ls)
boxd auth org invite alice@example.com --role member # admin only
boxd auth org revoke-invite <token>                  # admin only
boxd auth org remove-member <user_id> -y             # admin only; plain members only
boxd auth org set-role <user_id> admin               # promote, or `member` to demote; demoting another admin is owner-only
boxd auth org rename "Acme Labs"                     # admin only
boxd teams new backend                               # a team: a group inside the org with an optional default snapshot (org admin only)
boxd teams list                                      # every team for an org admin, otherwise the teams you are in (alias: ls)
boxd teams get backend                               # roster and default snapshot
boxd teams rename backend platform                   # team admin only, like the commands below
boxd teams add-member backend <user_id>              # user ids are shown by `auth org members`
boxd teams remove-member backend <user_id>
boxd teams set-role backend <user_id> admin          # or `member`
boxd teams set-default-snapshot backend my-workspace # must be a shared snapshot
boxd teams set-default-snapshot backend --clear      # no default snapshot again
boxd teams destroy backend -y                        # delete the team (alias: rm)
```

> [!WARNING]
>
> Sharing a machine **wipes the agent logins inside it** (Claude Code, Codex, OpenCode) the instant it goes shared, so a colleague with a shell can never read your tokens. Unsharing restores Claude and Codex automatically, while OpenCode needs a one-time re-login. Forking a shared machine gives you a **private** fork with your logins intact. See [Machine sharing](/guides/share-a-vm.md) for the full handoff.

## Regions

Machines, snapshots and disks live in one region, Frankfurt (`fra`) or New York (`nyc`). Every org has both. Your account, API keys, env vars, secrets and billing work in every region. See [Regions](/guides/regions.md) for the model.

```bash
boxd manage regions                         # the regions, and which one is the org's default
boxd manage regions default nyc             # org admins: new machines and disks go to New York (`none` clears it)
boxd machine new web --region nyc           # machine, snapshot and disk commands take --region
boxd machine exec web.nyc -- uptime         # <name>.<region> names it in that region, as --region would
boxd machine list --region all              # every region in one table, with a REGION column
boxd config set region nyc                  # this laptop's default (BOXD_REGION does the same for one shell)
ssh web.nyc.boxd                            # SSH to a machine in New York
```

Without `--region`, a command uses `BOXD_REGION`, then `boxd config set region`, then the org's default region, then the closest region. `--region all` is for lists only (`machine list`, `snapshots list`, `disks list`, `teams list`, `manage domain get`), and a list of one region ends with a count of the rest, such as `and 3 in nyc`. A name that isn't in the current region but is in another gets an error that repeats your command with `--region` set. Inside a machine, `boxd info` shows the machine's region, and the in-machine `boxd` acts in that region only.

## Networks

Machines reach each other when they **share at least one network**, or when **neither has any**. Machines with no networks form the org's default network, so naming a network opts a machine out of that pool. The same rule governs direct connections, the `<machine>.boxd` DNS name, and `machine exec` / `cp` between machines.

```bash
boxd machine networks myapp                    # show current networks
boxd machine networks myapp backend,cache      # replace the whole set (not a merge)
boxd machine networks myapp --clear            # remove them all: back to the default network
```

Networks are labels you pick, with nothing to create first, and they never cross an organization or a [region](#regions). Changes take effect immediately, without a reboot. Set them at creation with `machine new --networks`, and edit them later from the machine's Networking tab in the console as well.

### Egress allowlist

Limit what a machine can reach on the internet. See [Egress allowlist](/guides/egress-allowlist.md).

```bash
boxd machine egress myapp                                  # show the current allowlist
boxd machine egress myapp api.stripe.com,*.github.com      # replace it: hostnames, wildcards, IPv4 addresses, CIDRs
boxd machine egress myapp none                             # nothing is reachable
boxd machine egress myapp --clear                          # unrestricted again
```

`machine new --isolated` sandboxes a machine. It never joins the default network and never reaches another isolated machine, and boxd removes everything that could reach into the rest of your org from it: the in-machine `boxd` CLI, the metadata endpoint, the `run` CLI and automations, the git and gh credential helpers, integrations, agent logins, the boxd skill, and the laptop bridge. Outbound internet (unless an egress allowlist is set), env vars in exec and SSH sessions, its HTTPS domain, and inbound SSH (unless you [turn it off](#turn-ssh-off)) still work. Isolation is fixed at creation and always inherited by forks and by machines created from a snapshot of it, while its `--networks` remain editable and are the only thing it can reach through. See [Sandboxes](/use-cases/sandboxes.md).

## Per-machine settings

The auto-suspend and auto-hibernate timeouts, whether the idle timers ignore outbound traffic, bot protection and SSH live under `boxd machine config`, as the keys `auto-suspend.timeout`, `auto-hibernate.timeout`, `idle.ignore-outbound`, `bot-protection` and `ssh`. You can also set the timeouts at creation with `--auto-suspend-timeout` and `--auto-hibernate-timeout`, and `idle.ignore-outbound` with `--idle-ignore-outbound`. The backup schedule keys (`backups.period`, `backups.retention`) live here too. See [Backups](#backups). So does the [delete-after](/guides/delete-after.md) timer, as the key `delete-after`.

```bash
boxd machine config list myapp                        # all settings for a machine
boxd machine config get myapp auto-suspend.timeout    # read one
boxd machine config set myapp auto-suspend.timeout 300    # standby after 300 idle seconds (0 = off, the default)
boxd machine config set myapp auto-hibernate.timeout 0    # never hibernate (default: 4 hours)
boxd machine config set myapp idle.ignore-outbound on     # only inbound connections keep it awake, see Suspend, resume, and hibernate
boxd machine config set myapp bot-protection on           # on, sleep_only or off, see Bot protection
boxd machine config set myapp ssh off                     # on or off, see Turn SSH off
boxd machine config set myapp delete-after 2h             # delete it 2 hours from now; setting it again replaces the timer
boxd machine config set myapp delete-after "0 18 * * *"   # or at the next 18:00 UTC (a cron expression)
boxd machine config set myapp delete-after off            # no timer
```

## CLI settings

`boxd config` persists laptop-side CLI settings (kept in `config.toml`).

```bash
boxd config list                              # api-url, region, client-utils.enable, client-utils.label, daemon.enable
boxd config get api-url                       # read one
boxd config set api-url https://boxd.sh       # persist the API server (flag/env still override)
boxd config set region nyc                    # the region commands use when neither --region nor BOXD_REGION is given
boxd config set client-utils.enable true      # enable the clipboard/files/browser bridge for this device
boxd config set client-utils.label "desktop"  # name this computer, so agents can pick it by label (stored with the device id)
```

Shell completions are covered in [Installation](/cli/installation.md#shell-completions).

## Open the docs

```bash
boxd docs                        # opens https://docs.boxd.sh in your browser
```

## Global flags

| Flag | Description |
| - | - |
| `--json` | Output as JSON |
| `--region` / `BOXD_REGION` | The [region](#regions) for machine, snapshot and disk commands and the org's wildcard domain, or `all` for lists. Default: `boxd config set region`, then the org's default region, then the closest region |
| `--api-url` / `BOXD_API_URL` | API server URL (hidden; default `https://boxd.sh`) |
| `--token` / `BOXD_TOKEN` | Auth token, overrides stored credentials (hidden) |
| `--org` | Run one invocation in a specific org context (hidden; persist with `boxd auth switch`) |
