@machine0/cli 1.0.0

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 +238 -0
  2. package/dist/cli.js +508 -0
  3. package/package.json +47 -0
package/README.md ADDED
@@ -0,0 +1,238 @@
1
+ <h1 align="center">machine0</h1>
2
+ <p align="center">Instant, AI-ready cloud VMs from your terminal</p>
3
+
4
+ <p align="center"><code>npm install -g @machine0/cli</code></p>
5
+
6
+ # Overview
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.
9
+
10
+ Built on top of leading cloud infrastructure. Multi-region. Pay-as-you-go.
11
+
12
+ ## Quickstart
13
+
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
+ ## Benefits
22
+
23
+ - 🧰 **Fully Loaded:** VMs come pre-installed with everything you need to work with AI.
24
+ - ⚡ **Instant boot:** Small VMs are kept warm and boot in seconds.
25
+ - 📐 **Multiple sizes:** From lightweight sandboxes to GPU instances.
26
+ - 🌍 **Multiple regions:** Run VMs in the US, UK, EU or Asia.
27
+ - 📌 **Fixed IPs:** Every VM gets a dedicated IP for its lifetime.
28
+ - 🔒 **HTTPS endpoints:** Every VM gets `https://<vm>.mac0.io`.
29
+ - 🔑 **SSH key management:** Use your own keys or create managed keypairs on the server.
30
+ - 📦 **Ansible provisioning:** First-class support for running playbooks on your VMs.
31
+ - 📸 **Snapshots:** Snapshot any VM into a reusable image.
32
+ - 💳 **Pay-as-you-go:** Billed per minute. No commitments, no surprises.
33
+
34
+ ## Use Cases
35
+
36
+ - 🤖 **Agent sandboxes:** Small instances are cheap and boot instantly. Snapshot your setup once, then spin up identical sandboxes on demand.
37
+ - 🦞 **OpenClaw:** Use the `openclaw` image to get a machine running OpenClaw out of the box. Use `medium` or larger.
38
+ - 💻 **Dev environments:** The provisioned image comes with Node, Bun, Python, Rust, Go, Docker and Claude Code. SSH in and start building.
39
+ - 🌐 **Hosting:** Every VM has dedicated resources, a fixed IP and an HTTPS endpoint. Host APIs, bots, databases — anything that needs to stay up.
40
+ - 🔧 **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.
41
+
42
+ # Documentation
43
+
44
+ machine0 is CLI-first, but there is also a [web UI](https://api.machine0.io).
45
+
46
+ ## Creating a VM
47
+
48
+ Small VMs boot instantly:
49
+
50
+ ```
51
+ $ machine0 new my-vm
52
+ ✓ VM is starting
53
+ $ machine0 ssh my-vm
54
+ [ ubuntu@my-vm ] ~ $
55
+ ```
56
+
57
+ ## Images
58
+
59
+ We provide the following system images to every account. These images are provisioned using our [Ansible Playbook](https://github.com/barnaby/machine0-ansible).
60
+
61
+ ```
62
+ $ machine0 images ls
63
+ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
64
+ │ Name Description │
65
+ │ 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. │
66
+ │ openclaw 'base-24-04' with OpenClaw pre-installed. Requires a 'medium' instance or larger. │
67
+ │ ubuntu-24-04 Fresh Ubuntu 24.04 LTS. Used to provision the base image. │
68
+ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
69
+ ```
70
+
71
+ You can also create your own images (for example to clone your environment easily):
72
+
73
+ ```bash
74
+ # Create a fresh VM we'll use as a template.
75
+ $ machine0 new my-vm
76
+
77
+ # Update the VM using `machine0 ssh` or `machine0 provision`, then image it.
78
+ $ machine0 image my-vm my-base-image
79
+
80
+ # Create as many VMs from the image as you'd like.
81
+ $ machine0 create my-clone --image my-base-image
82
+
83
+ # Optionally, set the image as the default.
84
+ $ machine0 config set DEFAULT_VM_IMAGE=my-base-image
85
+ ```
86
+
87
+ ## Ansible Provisioning
88
+
89
+ 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.
90
+
91
+ ```bash
92
+ $ machine0 provision my-vm playbook.yml
93
+ ```
94
+
95
+ 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/barnaby/machine0-ansible).
96
+
97
+ ## Sizes & Regions
98
+
99
+ 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).
100
+
101
+ ```bash
102
+ $ machine0 sizes
103
+ ┌────────────────────────────────────────────────────────────┐
104
+ │ Size CPU RAM Disk $/hour ~$/month │
105
+ │ small 1 vCPU 1 GB 25 GB $0.01 $7 │
106
+ │ medium 2 vCPU 2 GB 60 GB $0.02 $15 │
107
+ │ large 2 vCPU 4 GB 80 GB $0.04 $29 │
108
+ │ xl 4 vCPU 8 GB 160 GB $0.08 $58 │
109
+ │ xxl 8 vCPU 16 GB 320 GB $0.16 $117 │
110
+ │ xxxl 16 vCPU 32 GB 640 GB $0.32 $234 │
111
+ └────────────────────────────────────────────────────────────┘
112
+ ```
113
+
114
+ 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)).
115
+
116
+ ```bash
117
+ $ machine0 new my-vm --size large --region us
118
+ ```
119
+
120
+ ## SSH Keys
121
+
122
+ 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.
123
+
124
+ ```bash
125
+ $ machine0 keys ls
126
+ ┌────────────────────────────────────────────────────────┐
127
+ │ Name Type Default │
128
+ │ barnaby@Barnabys-MBP.localdomain PUBLIC * │
129
+ └────────────────────────────────────────────────────────┘
130
+
131
+ # Create a managed private / public keypair
132
+ $ machine0 keys create my-managed-key --type managed --default
133
+ ```
134
+
135
+ ## Billing
136
+
137
+ machine0 is pay-as-you-go. Resources are billed per minute.
138
+
139
+ - **Machines** are billed while they exist (including when stopped, since they reserve cloud resources).
140
+ - **Images** are billed based on disk size at $0.06/GB/month.
141
+ - Creating a resource requires enough balance for at least 10 hours of usage.
142
+ - If your balance drops below 1 hour of runway, resources are automatically torn down.
143
+ - Auto top-up can be enabled to prevent accidental teardowns.
144
+ - Minimum top-up is $5 USD.
145
+ - Outstanding credits are refundable if you decide machine0 is not for you.
146
+
147
+ Check your balance:
148
+
149
+ ```
150
+ $ machine0 account info
151
+ ┌──────────────────────────────────────┐
152
+ │ Email system@machine0.io │
153
+ │ Wallet Balance $9.02 │
154
+ │ Auto Top-Up enabled │
155
+ └──────────────────────────────────────┘
156
+ ```
157
+
158
+ ## CLI Reference
159
+
160
+ ```bash
161
+ $ machine0
162
+
163
+ USAGE
164
+ machine0 <command> [flags]
165
+
166
+ COMMANDS
167
+ ls List VMs
168
+ get <vm> Show VM details
169
+ new <vm> [options] Create a VM
170
+ start <vm> Start a VM
171
+ stop <vm> Stop a VM
172
+ reboot <vm> Reboot a VM
173
+ rm [vm] [options] Remove a VM (--all for all)
174
+ ssh <vm> [command] [options] SSH into a VM or run a command
175
+ provision <vm> <playbook> [options] Run an Ansible playbook on a VM
176
+ sizes Show available VM sizes and pricing
177
+
178
+ IMAGES
179
+ images ls List images
180
+ images get <image> Show image details
181
+ images create <vm> <image> [description] Snapshot a VM into an image
182
+ images update <image> [options] Update image settings
183
+ images rm [image] [options] Remove an image (--all for all)
184
+
185
+ ACCOUNT
186
+ account info Show account details
187
+ account login Log in
188
+ account logout Log out
189
+
190
+ KEYS
191
+ keys ls List keys
192
+ keys get <key> [options] Show key details
193
+ keys new <key> [options] Add a key (managed or public)
194
+ keys update <key> [options] Update key settings
195
+ keys rm <key> [options] Remove a key
196
+
197
+ managed = keypair stored on server, local = register your own public key
198
+ ```
199
+
200
+ ### Configuration
201
+
202
+ machine0 stores configuration in `~/.machine0/config.env`. You can get and set variables as follows:
203
+
204
+ ```
205
+ $ machine0 config get
206
+ ┌───────────────────────────────────────────────┐
207
+ │ SSH_KEY_PATH ~/.ssh │
208
+ │ DEFAULT_SSH_USER ubuntu │
209
+ │ DEFAULT_VM_SIZE medium │
210
+ │ DEFAULT_VM_REGION eu │
211
+ │ DEFAULT_VM_IMAGE ubuntu-24-04-provisioned │
212
+ └───────────────────────────────────────────────┘
213
+
214
+ $ machine0 config set DEFAULT_VM_IMAGE=my-image
215
+ ✓ Config written to ~/.machine0/config.env
216
+ ```
217
+
218
+ ## Security
219
+
220
+ - No keys stored on server by default.
221
+ - SSH access only. Password authentication is disabled on all VMs.
222
+ - Root login is disabled. All access is through the `ubuntu` user with sudo.
223
+ - Managed keys can be downloaded once. Local keys never leave your machine.
224
+ - Cloud-init randomizes the root password on every VM.
225
+
226
+ # FAQ
227
+
228
+ **Where is machine0 hosted?**
229
+ VMs run on DigitalOcean's infrastructure. The API runs on GCP Cloud Run. Both are production-grade.
230
+
231
+ **Can I export my data?**
232
+ Yes. Your VMs are standard Ubuntu machines. SSH in and copy anything you need. There's no lock-in.
233
+
234
+ **What if I run out of credits?**
235
+ Resources are torn down when your balance can't cover 1 hour of usage. Enable auto top-up to prevent this.
236
+
237
+ **How do I get support?**
238
+ Send an email to [support@machine0.io](mailto:support@machine0.io), and we'll reply quickly.