@machine0/cli 1.0.85 → 1.0.87

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +60 -241
  2. package/dist/cli.js +191 -191
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -1,268 +1,87 @@
1
1
  <h1 align="center">machine0</h1>
2
- <p align="center">Instant, AI-ready cloud VMs from your terminal</p>
2
+ <p align="center">Cloud VMs from the CLI</p>
3
3
 
4
4
  <p align="center"><code>npm install -g @machine0/cli</code></p>
5
5
 
6
- # Overview
6
+ [machine0](https://machine0.io) is a CLI for creating, provisioning, and snapshotting persistent cloud VMs. One command gives you a VM with dedicated CPU/RAM, a static IP, and an HTTPS endpoint. Provision declaratively with NixOS flakes or Ubuntu with Ansible.
7
7
 
8
- machine0 lets you create, provision and snapshot cloud VMs from your terminal. VMs have dedicated resources (including GPUs). Small VMs boot instantly. The default image ships with dev tools, modern shell tooling, coding agents and Docker pre-installed.
8
+ ## Links
9
9
 
10
- Built on top of leading cloud infrastructure. Multi-region. Pay-as-you-go.
10
+ - [Documentation](https://docs.machine0.io)
11
+ - [Website](https://machine0.io)
12
+ - [Support](mailto:support@machine0.io)
11
13
 
12
- ## Quickstart
14
+ ## Features
13
15
 
14
- ```bash
15
- $ npm install -g @machine0/cli
16
- $ machine0 account login
17
- $ machine0 new my-vm
18
- $ machine0 ssh my-vm
19
- ```
20
-
21
- ## Authentication
16
+ - **NixOS with Flakes** — provision VMs declaratively. Deterministic builds, one-command rollbacks, no drift.
17
+ - **Or Ubuntu with Ansible** — pre-installed images with Docker, Node, Python, and popular agents. Ansible provisioning supported.
18
+ - **Dedicated resources** — real KVM/QEMU. 1 to 60 vCPU, up to 240 GB RAM. Not shared.
19
+ - **GPUs** H100, H200, MI300X, L40S, RTX 4000 Ada, W6000 Ada. Single or 8x configurations. From $0.836/hr.
20
+ - **Suspend & resume** — snapshot a VM's state, stop billing, restore later. Pay only image storage while suspended.
21
+ - **Static IPs & HTTPS** — every VM gets a public IP and authenticated HTTPS at `<vm>.mac0.io`.
22
+ - **Snapshots & images** — snapshot any VM into a reusable image. Version, promote, and set as default for new VMs.
23
+ - **File sync** — `sync push` and `sync pull` with `--watch` for continuous sync.
24
+ - **CLI + MCP** — every command has `--json`. A remote MCP server is also available for programmatic control.
25
+ - **4 regions** — New York, London, Amsterdam, Singapore. Same pricing everywhere.
26
+ - **Per-minute billing** — no commitments, refundable credits. A small VM runs 24/7 for ~$9/mo.
27
+ - **99.99% uptime SLA** — instance-level.
28
+ - **Firewall** — ufw enabled by default. Ports 22, 80, 443 open.
22
29
 
23
- ### Browser login (interactive)
30
+ ## Usage
24
31
 
25
32
  ```bash
26
- $ machine0 account login
27
- ```
28
-
29
- Opens your browser to authenticate. The session token is saved to `~/.machine0/auth-token`.
30
-
31
- ### API token (non-interactive / CI)
32
-
33
- Set the `MACHINE0_API_TOKEN` environment variable to skip the browser login flow. This is useful for CI pipelines, scripts, and automation.
34
-
35
- ```bash
36
- export MACHINE0_API_TOKEN=your-api-token
37
- machine0 ls
38
- ```
39
-
40
- The environment variable takes precedence over the session file. You can get a token by running `machine0 account login` and reading the session file, or from the [web dashboard](https://app.machine0.io).
41
-
42
- `machine0 account login` and `machine0 account logout` still work when `MACHINE0_API_TOKEN` is set — they manage the session file independently and will warn you about the environment variable.
43
-
44
- ## Using machine0 with AI agents
45
-
46
- When driven from a coding agent (Claude Code, Cursor, etc.) the CLI runs without a TTY. Two supported paths:
47
-
48
- 1. **MCP server (recommended for agents).** The API hosts an MCP endpoint at `https://app.machine0.io/mcp` with tools for listing, creating, starting, stopping and destroying VMs, managing images and keys, and running SSH commands. Point your agent at this URL and authenticate with OAuth or `MACHINE0_API_TOKEN`. This is the stable, structured interface.
49
- 2. **CLI with `MACHINE0_API_TOKEN`.** For scripts and CI, set the env var and the CLI works non-interactively. Destructive commands (`rm`, `update`) require `--yes` when there is no TTY — the CLI fails loudly rather than silently destroying resources.
50
-
51
- ## Benefits
52
-
53
- - 🧰 **Fully Loaded:** VMs come pre-installed with everything you need to work with AI.
54
- - ⚡ **Instant boot:** Small VMs are kept warm and boot in seconds.
55
- - 📐 **Multiple sizes:** From lightweight sandboxes to GPU instances.
56
- - 🌍 **Multiple regions:** Run VMs in the US, UK, EU or Asia.
57
- - 📌 **Fixed IPs:** Every VM gets a dedicated IP for its lifetime.
58
- - 🔒 **HTTPS endpoints:** Every VM gets `https://<vm>.mac0.io`.
59
- - 🔑 **SSH key management:** Use your own keys or create managed keypairs on the server.
60
- - 📦 **Ansible provisioning:** First-class support for running playbooks on your VMs.
61
- - 📸 **Snapshots:** Snapshot any VM into a reusable image.
62
- - 💳 **Pay-as-you-go:** Billed per minute. No commitments, no surprises.
63
-
64
- ## Use Cases
65
-
66
- - 🤖 **Agent sandboxes:** Small instances are cheap and boot instantly. Snapshot your setup once, then spin up identical sandboxes on demand.
67
- - 🦞 **OpenClaw:** Use the `openclaw` image to get a machine running OpenClaw out of the box. Use `medium` or larger.
68
- - 💻 **Dev environments:** The provisioned image comes with Node, Bun, Python, Rust, Go, Docker and Claude Code. SSH in and start building.
69
- - 🌐 **Hosting:** Every VM has dedicated resources, a fixed IP and an HTTPS endpoint. Host APIs, bots, databases — anything that needs to stay up.
70
- - 🔧 **Ansible provisioning:** Write a playbook, run `machine0 provision my-vm playbook.yml`, done. Use a coding agent to author playbooks and disposable VMs to test them.
71
-
72
- # Documentation
73
-
74
- machine0 is CLI-first, but there is also a [web UI](https://api.machine0.io).
75
-
76
- ## Creating a VM
77
-
78
- Small VMs boot instantly:
79
-
80
- ```
81
- $ machine0 new my-vm
82
- ✓ VM is starting
83
- $ machine0 ssh my-vm
84
- [ ubuntu@my-vm ] ~ $
85
- ```
86
-
87
- ## Images
88
-
89
- We provide the following system images to every account. These images are provisioned using our [Ansible Playbook](https://github.com/fdmtl/machine0-ansible).
90
-
91
- ```
92
- $ machine0 images ls
93
- ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
94
- │ Name Description │
95
- │ base-24-04 Includes the latest versions of Docker, node, python, go and rust. As well as coding agents such as Claude Code, Codex and OpenCode. │
96
- │ openclaw 'base-24-04' with OpenClaw pre-installed. Requires a 'medium' instance or larger. │
97
- │ ubuntu-24-04 Fresh Ubuntu 24.04 LTS. Used to provision the base image. │
98
- └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
99
- ```
100
-
101
- You can also create your own images (for example to clone your environment easily):
102
-
103
- ```bash
104
- # Create a fresh VM we'll use as a template.
105
- $ machine0 new my-vm
106
-
107
- # Update the VM using `machine0 ssh` or `machine0 provision`, then image it.
108
- $ machine0 image my-vm my-base-image
109
-
110
- # Create as many VMs from the image as you'd like.
111
- $ machine0 create my-clone --image my-base-image
112
-
113
- # Optionally, set the image as the default.
114
- $ machine0 config set DEFAULT_VM_IMAGE=my-base-image
115
- ```
116
-
117
- ## Ansible Provisioning
118
-
119
- machine0 has first-class support for provisioning VMs with [Ansible](https://github.com/ansible/ansible). Use coding agents to author playbooks and disposable VMs to test them.
120
-
121
- ```bash
122
- $ machine0 provision my-vm playbook.yml
123
- ```
124
-
125
- We use this functionality to create the `base-24-04` image using a fresh Ubuntu. If you'd like to learn more, you can check out our [Ansible Playbook](https://github.com/fdmtl/machine0-ansible).
126
-
127
- ## Sizes & Regions
128
-
129
- We provide the following machine sizes. The price is the same regardless of where you spin up: `us` (New York), `uk` (London), `eu` (Amsterdam) & `asia` (Singapore).
130
-
131
- ```bash
132
- $ machine0 sizes
133
- ┌──────────────────────────────────────────────────────────────┐
134
- │ Size CPU RAM Disk $/hour ~$/month │
135
- │ small 1 vCPU 1 GB 25 GB $0.013 $9 │
136
- │ medium 2 vCPU 2 GB 60 GB $0.034 $25 │
137
- │ large 2 vCPU 4 GB 80 GB $0.052 $38 │
138
- │ xl 4 vCPU 8 GB 160 GB $0.104 $76 │
139
- │ xxl 8 vCPU 16 GB 320 GB $0.208 $152 │
140
- │ xxxl 16 vCPU 64 GB 200 GB $0.825 $602 │
141
- └──────────────────────────────────────────────────────────────┘
142
- ```
143
-
144
- You can use CLI options to specify the size and region of a machine. The default size is `small` (instant boot) and the default region is `eu`. You can change them using the `config` command ([see below](#configuration)).
145
-
146
- ```bash
147
- $ machine0 new my-vm --size large --region us
148
- ```
149
-
150
- ## SSH Keys
151
-
152
- By default, machine0 uses your local public key (`~/.ssh/id_rsa.pub`). Your private key never leaves your machine. You can also create managed keypairs that are stored on the server — useful for teams or ephemeral setups.
153
-
154
- ```bash
155
- $ machine0 keys ls
156
- ┌────────────────────────────────────────────────────────┐
157
- │ Name Type Default │
158
- │ barnaby@Barnabys-MBP.localdomain PUBLIC * │
159
- └────────────────────────────────────────────────────────┘
160
-
161
- # Create a managed private / public keypair
162
- $ machine0 keys create my-managed-key --type managed --default
163
- ```
164
-
165
- ## Billing
166
-
167
- machine0 is pay-as-you-go. Resources are billed per minute.
168
-
169
- - **Machines** are billed while they exist (including when stopped, since they reserve cloud resources).
170
- - **Images** are billed based on disk size at $0.078/GB/month.
171
- - Creating a resource requires enough balance for at least 10 hours of usage.
172
- - If your balance drops below 1 hour of runway, resources are automatically torn down.
173
- - Auto top-up can be enabled to prevent accidental teardowns.
174
- - Minimum top-up is $5 USD.
175
- - Outstanding credits are refundable if you decide machine0 is not for you.
176
-
177
- Check your balance:
178
-
179
- ```
180
- $ machine0 account info
181
- ┌──────────────────────────────────────┐
182
- │ Email system@machine0.io │
183
- │ Wallet Balance $9.02 │
184
- │ Auto Top-Up enabled │
185
- └──────────────────────────────────────┘
186
- ```
187
-
188
- ## CLI Reference
189
-
190
- ```bash
191
- $ machine0
192
-
193
33
  USAGE
194
34
  machine0 <command> [flags]
195
35
 
196
36
  COMMANDS
197
- ls List VMs
198
- get <vm> Show VM details
199
- new <vm> [options] Create a VM
200
- start <vm> Start a VM
37
+ ls [flags] List VMs
38
+ get <vm> [flags] Show VM details
39
+ new <vm> [flags] Create a VM
40
+ update <vm> [flags] Update a VM
41
+ start <vm> Start a stopped or suspended VM
201
42
  stop <vm> Stop a VM
202
43
  reboot <vm> Reboot a VM
203
- rm [vm] [options] Remove a VM (--all for all)
204
- ssh <vm> [command] [options] SSH into a VM or run a command
205
- provision <vm> <source> [options] Provision a VM from a NixOS flake or Ansible playbook
206
- sizes Show available VM sizes and pricing
207
- openclaw Launch an OpenClaw instance and SSH into it
208
-
209
- IMAGES
210
- images ls List images
211
- images get <image> Show image details
212
- images new <vm> <image> [options] Snapshot a VM into an image
213
- images update <image> [options] Update image settings
214
- images rm [image] [options] Remove an image (--all for all)
44
+ suspend <vm> [flags] Suspend a VM (snapshot, delete, pay only for storage). Resume later.
45
+ rm [vm] [flags] Remove a VM (--all for all)
46
+ ssh <vm> [command] [flags] SSH into a VM or run a command
47
+ provision <vm> <source> [flags] Provision a VM (NixOS flake reference or Ansible playbook .yml)
48
+ sizes [flags] Show available VM sizes and pricing
215
49
 
216
50
  ACCOUNT
217
- account info Show account details
218
- account login Log in
219
- account logout Log out
51
+ whoami [flags] Show account details
52
+ login Log in
53
+ logout Log out
54
+ billing [month] [flags] Show usage breakdown for a month (default: current month)
55
+ topup [flags] Top up your wallet balance
220
56
 
221
- SSH KEYS
222
- keys ls List keys
223
- keys get <key> [options] Show key details
224
- keys new <key> [options] Add a key (managed or public)
225
- keys update <key> [options] Update key settings
226
- keys rm <key> [options] Remove a key
57
+ IMAGES
58
+ images ls [flags] List images
59
+ images get <image> [flags] Show image details and versions
60
+ images save <vm> <image> [flags] Snapshot a VM into an image
61
+ images update <image> [flags] Update image settings
62
+ images rm [image] [flags] Remove an image
63
+ images versions Manage image versions
64
+ images upload <url> [flags] Upload a custom image from a URL (creates a new version if the name already exists)
227
65
 
228
- managed = keypair stored on server, local = register your own public key
229
- ```
66
+ SSH KEYS
67
+ keys ls [flags] List keys
68
+ keys get <key> [flags] Show key details
69
+ keys new <key> [flags] Add a key (managed or public)
70
+ keys update <key> [flags] Update key settings
71
+ keys rm <key> [flags] Remove a key
230
72
 
231
- ### Configuration
73
+ managed = keypair stored on server, local = register your own public key
232
74
 
233
- machine0 stores configuration in `~/.machine0/config.env`. You can get and set variables as follows:
75
+ CONFIG
76
+ config get [flags] Show current configuration
77
+ config set <assignments> Set configuration variables (e.g. config set KEY=VALUE)
234
78
 
235
- ```
236
- $ machine0 config get
237
- ┌───────────────────────────────────────────────┐
238
- │ SSH_KEY_PATH ~/.ssh │
239
- │ DEFAULT_VM_SIZE medium │
240
- │ DEFAULT_VM_REGION eu │
241
- │ DEFAULT_VM_IMAGE ubuntu-24-04-provisioned │
242
- └───────────────────────────────────────────────┘
79
+ FILE SYNC
80
+ sync push <local> <remote> [flags] Push local files to a VM (e.g., sync push ./src myvm:~/app)
81
+ sync pull <remote> <local> [flags] Pull files from a VM to local (e.g., sync pull myvm:~/app ./src)
243
82
 
244
- $ machine0 config set DEFAULT_VM_IMAGE=my-image
245
- Config written to ~/.machine0/config.env
83
+ FLAGS
84
+ -h, --help Show help
85
+ -V, --version Show version
246
86
  ```
247
87
 
248
- ## Security
249
-
250
- - No keys stored on server by default.
251
- - SSH access only. Password authentication is disabled on all VMs.
252
- - Root login is disabled. All access is through the `ubuntu` user with sudo.
253
- - Managed keys can be downloaded once. Local keys never leave your machine.
254
- - Cloud-init randomizes the root password on every VM.
255
-
256
- # FAQ
257
-
258
- **Where is machine0 hosted?**
259
- VMs run on DigitalOcean's infrastructure. The API runs on GCP Cloud Run. Both are production-grade.
260
-
261
- **Can I export my data?**
262
- Yes. Your VMs are standard Ubuntu machines. SSH in and copy anything you need. There's no lock-in.
263
-
264
- **What if I run out of credits?**
265
- Resources are torn down when your balance can't cover 1 hour of usage. Enable auto top-up to prevent this.
266
-
267
- **How do I get support?**
268
- Send an email to [support@machine0.io](mailto:support@machine0.io), and we'll reply quickly.