> ## 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.

# Machines

> CLI reference for creating, managing, and connecting to VMs.

## new

Create a VM.

```bash theme={"theme":"css-variables"}
machine0 new <vm> [flags]
```

| Flag           | Description              | Default               |
| -------------- | ------------------------ | --------------------- |
| `-s, --size`   | VM size                  | `small`               |
| `-r, --region` | `us`, `uk`, `eu`, `asia` | `eu`                  |
| `-i, --image`  | Image slug               | `ubuntu-24-04-loaded` |
| `-k, --key`    | SSH key name             | Default key           |

```bash theme={"theme":"css-variables"}
machine0 new my-vm
machine0 new my-vm --size large --region us
machine0 new my-gpu --size gpu-h100-1
```

***

## ls

List all VMs.

```bash theme={"theme":"css-variables"}
machine0 ls
machine0 ls --json
```

***

## get

Show VM details: specs, pricing, IP, SSH key, timestamps.

```bash theme={"theme":"css-variables"}
machine0 get <vm>
```

***

## start

Start a stopped or suspended VM. Suspended VMs are recreated from their snapshot with the same name, size, region, and key. Requires sufficient wallet balance.

```bash theme={"theme":"css-variables"}
machine0 start <vm>
```

***

## stop

Stop a running VM.

```bash theme={"theme":"css-variables"}
machine0 stop <vm>
```

<Warning>
  Stopped VMs still incur charges. Suspend or destroy to stop billing.
</Warning>

***

## reboot

```bash theme={"theme":"css-variables"}
machine0 reboot <vm>
```

***

## suspend

Snapshot the VM, delete the cloud instance, pay only image storage.

```bash theme={"theme":"css-variables"}
machine0 suspend <vm> [flags]
```

| Flag        | Description       |
| ----------- | ----------------- |
| `-y, --yes` | Skip confirmation |

The VM moves to `SUSPENDED`. Start again with `machine0 start`. Destroying a suspended VM also deletes its snapshot.

***

## rm

Destroy a VM.

```bash theme={"theme":"css-variables"}
machine0 rm [vm] [flags]
```

| Flag        | Description       |
| ----------- | ----------------- |
| `-a, --all` | Destroy all VMs   |
| `-y, --yes` | Skip confirmation |

***

## ssh

SSH into a VM or run a remote command.

```bash theme={"theme":"css-variables"}
machine0 ssh <vm> [command...]
```

| Flag         | Description  | Default  |
| ------------ | ------------ | -------- |
| `--username` | SSH username | `ubuntu` |

```bash theme={"theme":"css-variables"}
machine0 ssh my-vm
machine0 ssh my-vm "docker ps"
machine0 ssh my-vm --username nix
```

If the VM is still starting, the CLI waits for SSH. Commands run under the remote user's default non-login shell. For login-shell initialization, wrap with: `machine0 ssh my-vm bash -lc 'your-command'`.

***

## update

Update a VM's name or default SSH username.

```bash theme={"theme":"css-variables"}
machine0 update <vm> [flags]
```

| Flag                     | Description                           |
| ------------------------ | ------------------------------------- |
| `-n, --name`             | New name (updates `mac0.io` endpoint) |
| `--default-ssh-username` | Default SSH username                  |
| `-y, --yes`              | Skip confirmation                     |

***

## provision

Provision a VM with a Nix flake or Ansible playbook.

```bash theme={"theme":"css-variables"}
machine0 provision <vm> <source> [flags]
```

| Flag         | Description                             | Default |
| ------------ | --------------------------------------- | ------- |
| `--username` | SSH username                            | auto    |
| `--dry-run`  | Print planned actions without executing |         |

`<source>` can be a local directory, `flake.nix` path, remote flake ref, or `.yml` playbook. Append `#profile` to pick a specific NixOS configuration.

```bash theme={"theme":"css-variables"}
machine0 provision my-vm setup.yml
machine0 provision my-vm ./flake.nix#minimal
machine0 provision my-vm github:owner/repo#default
```

See [Provisioning](/platform/provisioning) for details.

***

## sizes

Show available VM sizes and pricing.

```bash theme={"theme":"css-variables"}
machine0 sizes [flags]
```

| Flag        | Description                |
| ----------- | -------------------------- |
| `-a, --all` | Include out-of-stock sizes |
