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

# CLI

```bash theme={"theme":"css-variables"}
curl -LsSf https://machine0.io/install.sh | sh
```

Or via npm: `npm install -g @machine0/cli`

## Authentication

```bash theme={"theme":"css-variables"}
machine0 login   # browser OAuth
machine0 logout  # revoke token
```

For automation, set `MACHINE0_API_TOKEN` instead.

## Commands

| Command                      | Description                          |
| ---------------------------- | ------------------------------------ |
| **Machines**                 |                                      |
| `new <vm>`                   | Create a VM                          |
| `ls`                         | List VMs                             |
| `get <vm>`                   | VM details                           |
| `start <vm>`                 | Start a stopped or suspended VM      |
| `stop <vm>`                  | Stop a VM                            |
| `reboot <vm>`                | Reboot                               |
| `suspend <vm>`               | Snapshot + destroy, pay only storage |
| `rm [vm]`                    | Destroy (`--all` for all)            |
| `ssh <vm> [cmd]`             | SSH in or run a command              |
| `update <vm>`                | Rename or update SSH username        |
| `provision <vm> <ref>`       | Provision with Nix flake or Ansible  |
| `sizes`                      | Show sizes and pricing               |
| **Images**                   |                                      |
| `images ls`                  | List images                          |
| `images get <img>`           | Image details                        |
| `images new <vm> <img>`      | Snapshot a VM                        |
| `images update <img>`        | Update image settings                |
| `images rm [img]`            | Delete (`--all` for all)             |
| **SSH Keys**                 |                                      |
| `keys ls`                    | List keys                            |
| `keys get <key>`             | Key details                          |
| `keys new <key>`             | Add a key                            |
| `keys update <key>`          | Update key settings                  |
| `keys rm <key>`              | Delete a key                         |
| **Sync**                     |                                      |
| `sync push <src> <vm>:<dst>` | Push files to VM                     |
| `sync pull <vm>:<src> <dst>` | Pull files from VM                   |
| **Account**                  |                                      |
| `login`                      | Log in                               |
| `logout`                     | Log out                              |
| `account`                    | Balance and account details          |
| `topup`                      | Add funds                            |
| `config get`                 | Show configuration                   |
| `config set KEY=VALUE`       | Set configuration                    |
| **Quick Launch**             |                                      |
| `use openclaw`               | Create an OpenClaw VM and SSH in     |
| `use webserver`              | Create a webserver VM                |

All commands support `--json` for machine-readable output.
