loaner-sdk 0.4.0 → 0.5.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.
@@ -0,0 +1,2746 @@
1
+ {
2
+ "app": "loaner",
3
+ "version": "0.5.0",
4
+ "commands": [
5
+ {
6
+ "name": "deploy",
7
+ "job": "deploy",
8
+ "summary": "Put a folder online at a URL of its name, built and kept running",
9
+ "description": "Packs the folder (inside a git repository what git keeps; never node_modules, .git or .env files), uploads it, and waits while Loaner builds and starts it. Prints its URL, which stays the same when you deploy the same name again. Next.js, Astro, Vite and any app with a \"start\" script listening on $PORT need nothing else; a loaner.json says what to run otherwise. In a monorepo, give the app’s own folder: a lockfile at the top isn’t in it, so it installs with npm install.",
10
+ "positional": [
11
+ "folder"
12
+ ],
13
+ "flags": [
14
+ {
15
+ "name": "folder",
16
+ "key": "folder",
17
+ "type": "string",
18
+ "description": "The app’s folder.",
19
+ "required": false,
20
+ "multiple": false,
21
+ "default": "."
22
+ },
23
+ {
24
+ "name": "name",
25
+ "key": "name",
26
+ "type": "string",
27
+ "description": "Its name, also in its URL (default: package.json’s name, else the folder’s).",
28
+ "required": false,
29
+ "multiple": false
30
+ },
31
+ {
32
+ "name": "preview",
33
+ "key": "preview",
34
+ "type": "boolean",
35
+ "description": "A preview: stops after 2 idle hours, instead of running until deleted.",
36
+ "required": false,
37
+ "multiple": false,
38
+ "default": false
39
+ },
40
+ {
41
+ "name": "env-file",
42
+ "key": "env-file",
43
+ "type": "string",
44
+ "description": "A .env file whose values its build and start get.",
45
+ "required": false,
46
+ "multiple": false
47
+ },
48
+ {
49
+ "name": "env",
50
+ "key": "env",
51
+ "type": "string",
52
+ "description": "KEY=value for its build and start; give it again for more.",
53
+ "required": false,
54
+ "multiple": true
55
+ }
56
+ ],
57
+ "examples": [
58
+ {
59
+ "run": "deploy",
60
+ "about": "This folder, named after its package.json"
61
+ },
62
+ {
63
+ "run": "deploy ./site --name docs-site --env-file .env.production",
64
+ "about": "A folder, a name, its secrets"
65
+ },
66
+ {
67
+ "run": "deploy --preview",
68
+ "about": "A preview that stops when idle"
69
+ }
70
+ ],
71
+ "readOnly": false,
72
+ "destructive": false
73
+ },
74
+ {
75
+ "name": "logs",
76
+ "job": "logs",
77
+ "summary": "Read a deployment’s build and app logs, or follow its app",
78
+ "description": "Shows the last lines of each build step and of the running app, apart. --follow prints the app’s output as it comes, until Ctrl-C or the app ends.",
79
+ "positional": [
80
+ "name"
81
+ ],
82
+ "flags": [
83
+ {
84
+ "name": "name",
85
+ "key": "name",
86
+ "type": "string",
87
+ "description": "The deployment’s name.",
88
+ "required": true,
89
+ "multiple": false
90
+ },
91
+ {
92
+ "name": "of",
93
+ "key": "of",
94
+ "type": "string",
95
+ "description": "all, build or app.",
96
+ "required": false,
97
+ "multiple": false,
98
+ "default": "all"
99
+ },
100
+ {
101
+ "name": "lines",
102
+ "key": "lines",
103
+ "type": "number",
104
+ "description": "How many last lines of each (at most 1000).",
105
+ "required": false,
106
+ "multiple": false,
107
+ "default": 40
108
+ },
109
+ {
110
+ "name": "follow",
111
+ "key": "follow",
112
+ "type": "boolean",
113
+ "description": "Then print the app’s output as it comes.",
114
+ "required": false,
115
+ "multiple": false,
116
+ "default": false
117
+ }
118
+ ],
119
+ "examples": [
120
+ {
121
+ "run": "logs docs-site",
122
+ "about": "Its build and its app, the last 40 lines of each"
123
+ },
124
+ {
125
+ "run": "logs docs-site --of build",
126
+ "about": "Why a build failed"
127
+ },
128
+ {
129
+ "run": "logs docs-site --follow",
130
+ "about": "Watch the app, like tail -f"
131
+ }
132
+ ],
133
+ "readOnly": false,
134
+ "destructive": false
135
+ },
136
+ {
137
+ "name": "open",
138
+ "job": "open",
139
+ "summary": "Open a deployment’s URL in the browser",
140
+ "description": "Open a deployment’s URL in the browser",
141
+ "positional": [
142
+ "name"
143
+ ],
144
+ "flags": [
145
+ {
146
+ "name": "name",
147
+ "key": "name",
148
+ "type": "string",
149
+ "description": "The deployment’s name.",
150
+ "required": true,
151
+ "multiple": false
152
+ }
153
+ ],
154
+ "examples": [
155
+ {
156
+ "run": "open docs-site",
157
+ "about": "Its page, in your browser"
158
+ }
159
+ ],
160
+ "readOnly": false,
161
+ "destructive": false
162
+ },
163
+ {
164
+ "name": "app install",
165
+ "tool": "install_app",
166
+ "route": "POST /api/v1/machines/{machine}/apps/{app}",
167
+ "summary": "Install an app",
168
+ "description": "Installs one of list_apps on a machine (packages and its files), the way unkernel’s desktop does. Slow installs keep going in the background: follow them with get_command. Faster than working out the packages yourself for these.",
169
+ "positional": [
170
+ "machine",
171
+ "app"
172
+ ],
173
+ "flags": [
174
+ {
175
+ "name": "machine",
176
+ "key": "machine",
177
+ "type": "string",
178
+ "multiple": false,
179
+ "description": "The machine’s id (mch_…), from create_machine or list_machines.",
180
+ "required": true
181
+ },
182
+ {
183
+ "name": "app",
184
+ "key": "app",
185
+ "type": "string",
186
+ "multiple": false,
187
+ "description": "The app’s id from list_apps, e.g. \"postgres\".",
188
+ "required": true
189
+ },
190
+ {
191
+ "name": "wait",
192
+ "key": "wait",
193
+ "type": "integer",
194
+ "multiple": false,
195
+ "description": "Seconds to wait (default 20).",
196
+ "required": false
197
+ }
198
+ ],
199
+ "examples": [
200
+ {
201
+ "run": "app install <machine> --app python",
202
+ "about": "Install Python 3"
203
+ }
204
+ ],
205
+ "readOnly": false,
206
+ "destructive": false
207
+ },
208
+ {
209
+ "name": "app list",
210
+ "tool": "list_apps",
211
+ "route": "GET /api/v1/apps",
212
+ "summary": "Apps you can install",
213
+ "description": "Tools, runtimes and servers install_app puts on a machine in one call: git, go, rust, node, python, bun, postgres, sqlite, valkey, nginx, docker and more.",
214
+ "positional": [],
215
+ "flags": [],
216
+ "examples": [
217
+ {
218
+ "run": "app list",
219
+ "about": "What can be installed"
220
+ }
221
+ ],
222
+ "readOnly": true,
223
+ "destructive": false
224
+ },
225
+ {
226
+ "name": "auth status",
227
+ "tool": "who_am_i",
228
+ "route": "GET /api/me",
229
+ "summary": "Who am I",
230
+ "description": "Who you are calling as (which key, person or agent) and whether you may make and revoke keys. Use it to check that a key works.",
231
+ "positional": [],
232
+ "flags": [],
233
+ "examples": [
234
+ {
235
+ "run": "auth status",
236
+ "about": "Which key, person or agent you call as"
237
+ }
238
+ ],
239
+ "readOnly": true,
240
+ "destructive": false
241
+ },
242
+ {
243
+ "name": "command input",
244
+ "tool": "send_input",
245
+ "route": "POST /api/v1/commands/{id}/input",
246
+ "summary": "Type into a command",
247
+ "description": "Types into a command started with interactive: true (answer its prompt; end a line with \\n). eof closes its stdin.",
248
+ "positional": [
249
+ "id"
250
+ ],
251
+ "flags": [
252
+ {
253
+ "name": "id",
254
+ "key": "id",
255
+ "type": "string",
256
+ "multiple": false,
257
+ "description": "The command’s id (cmd_…), from run_command or list_commands.",
258
+ "required": true
259
+ },
260
+ {
261
+ "name": "data",
262
+ "key": "data",
263
+ "type": "string",
264
+ "multiple": false,
265
+ "description": "What to type, e.g. \"y\\n\".",
266
+ "required": true
267
+ },
268
+ {
269
+ "name": "eof",
270
+ "key": "eof",
271
+ "type": "boolean",
272
+ "multiple": false,
273
+ "description": "Close its stdin after this.",
274
+ "required": false
275
+ }
276
+ ],
277
+ "examples": [
278
+ {
279
+ "run": "command input <id> --data \"y\\n\"",
280
+ "about": "Answer yes"
281
+ }
282
+ ],
283
+ "readOnly": false,
284
+ "destructive": false
285
+ },
286
+ {
287
+ "name": "command list",
288
+ "tool": "list_commands",
289
+ "route": "GET /api/v1/commands",
290
+ "summary": "Commands",
291
+ "description": "Commands, the newest first. machine plus state=running finds what is still going after you lost track of it.",
292
+ "positional": [],
293
+ "flags": [
294
+ {
295
+ "name": "machine",
296
+ "key": "machine",
297
+ "type": "string",
298
+ "multiple": false,
299
+ "description": "Only this machine’s commands.",
300
+ "required": false
301
+ },
302
+ {
303
+ "name": "state",
304
+ "key": "state",
305
+ "type": "string",
306
+ "multiple": false,
307
+ "enum": [
308
+ "running",
309
+ "exited",
310
+ "killed",
311
+ "timed_out",
312
+ "lost",
313
+ "not_started"
314
+ ],
315
+ "description": "Only commands in this state.",
316
+ "required": false
317
+ },
318
+ {
319
+ "name": "limit",
320
+ "key": "limit",
321
+ "type": "integer",
322
+ "multiple": false,
323
+ "description": "At most this many (default 50).",
324
+ "required": false
325
+ },
326
+ {
327
+ "name": "cursor",
328
+ "key": "cursor",
329
+ "type": "string",
330
+ "multiple": false,
331
+ "description": "Where the next page starts: the cursor the last page ended with.",
332
+ "required": false
333
+ }
334
+ ],
335
+ "examples": [
336
+ {
337
+ "run": "command list --machine <machine> --state running",
338
+ "about": "What still runs there"
339
+ }
340
+ ],
341
+ "readOnly": true,
342
+ "destructive": false
343
+ },
344
+ {
345
+ "name": "command output",
346
+ "tool": "read_output",
347
+ "route": "GET /api/v1/commands/{id}/output",
348
+ "summary": "Read output",
349
+ "description": "Reads a command’s output (stdout and stderr together) from a byte offset: start at 0, then pass back nextOffset. With wait it waits for new output, so it follows a running command without missing or repeating anything.",
350
+ "positional": [
351
+ "id"
352
+ ],
353
+ "flags": [
354
+ {
355
+ "name": "id",
356
+ "key": "id",
357
+ "type": "string",
358
+ "multiple": false,
359
+ "description": "The command’s id (cmd_…), from run_command or list_commands.",
360
+ "required": true
361
+ },
362
+ {
363
+ "name": "offset",
364
+ "key": "offset",
365
+ "type": "integer",
366
+ "multiple": false,
367
+ "description": "The byte to start at: 0, or the nextOffset the last read gave.",
368
+ "required": false
369
+ },
370
+ {
371
+ "name": "limit",
372
+ "key": "limit",
373
+ "type": "integer",
374
+ "multiple": false,
375
+ "description": "At most this many bytes (default 65536).",
376
+ "required": false
377
+ },
378
+ {
379
+ "name": "wait",
380
+ "key": "wait",
381
+ "type": "integer",
382
+ "multiple": false,
383
+ "description": "Seconds to wait for new output when there is none yet.",
384
+ "required": false
385
+ }
386
+ ],
387
+ "examples": [
388
+ {
389
+ "run": "command output <id> --offset 0",
390
+ "about": "Everything it printed"
391
+ }
392
+ ],
393
+ "readOnly": true,
394
+ "destructive": false
395
+ },
396
+ {
397
+ "name": "command run",
398
+ "tool": "run_command",
399
+ "route": "POST /api/v1/machines/{machine}/commands",
400
+ "summary": "Run a command",
401
+ "description": "Runs a shell command on a machine as \"user\" (passwordless sudo) in the home folder, and answers with its exit code and output when it finishes. A long one (an install, a build, a test suite) keeps running in the background: you get its id and how to follow it. Servers: timeoutSeconds 0. Never start an interactive editor; for prompts use interactive: true and send_input.",
402
+ "positional": [
403
+ "machine"
404
+ ],
405
+ "flags": [
406
+ {
407
+ "name": "machine",
408
+ "key": "machine",
409
+ "type": "string",
410
+ "multiple": false,
411
+ "description": "The machine’s id (mch_…), from create_machine or list_machines.",
412
+ "required": true
413
+ },
414
+ {
415
+ "name": "cmd",
416
+ "key": "cmd",
417
+ "type": "string",
418
+ "multiple": false,
419
+ "description": "The shell command line, e.g. \"apt-get install -y python3 && python3 --version\".",
420
+ "required": true
421
+ },
422
+ {
423
+ "name": "cwd",
424
+ "key": "cwd",
425
+ "type": "string",
426
+ "multiple": false,
427
+ "description": "Where to run it (default the home folder).",
428
+ "required": false
429
+ },
430
+ {
431
+ "name": "timeout-seconds",
432
+ "key": "timeoutSeconds",
433
+ "type": "integer",
434
+ "multiple": false,
435
+ "description": "Stop it after this long (default 600). 0: never (a server).",
436
+ "required": false
437
+ },
438
+ {
439
+ "name": "stdin",
440
+ "key": "stdin",
441
+ "type": "string",
442
+ "multiple": false,
443
+ "description": "Text for its stdin.",
444
+ "required": false
445
+ },
446
+ {
447
+ "name": "interactive",
448
+ "key": "interactive",
449
+ "type": "boolean",
450
+ "multiple": false,
451
+ "description": "Keep stdin open for send_input.",
452
+ "required": false
453
+ },
454
+ {
455
+ "name": "wait",
456
+ "key": "wait",
457
+ "type": "integer",
458
+ "multiple": false,
459
+ "description": "Seconds to wait for it before answering (default 20).",
460
+ "required": false
461
+ }
462
+ ],
463
+ "examples": [
464
+ {
465
+ "run": "command run <machine> --cmd \"uname -a\"",
466
+ "about": "Run one command and see its output"
467
+ }
468
+ ],
469
+ "readOnly": false,
470
+ "destructive": false
471
+ },
472
+ {
473
+ "name": "command script",
474
+ "tool": "run_script",
475
+ "route": "POST /api/v1/machines/{id}/scripts",
476
+ "summary": "Run a script",
477
+ "description": "Runs a whole script on a machine as one command: bulk or multi-step work (a loop over files, setup steps, a data job) in one call instead of many run_command calls. bash by default (or sh, python3, node); bash and sh stop at the first failing line (failFast). Answers like run_command: the exit code and output when it ends, or its id to follow. The script is saved on the machine; cmd names its path.",
478
+ "positional": [
479
+ "machine"
480
+ ],
481
+ "flags": [
482
+ {
483
+ "name": "machine",
484
+ "key": "machine",
485
+ "type": "string",
486
+ "multiple": false,
487
+ "description": "The machine’s id (mch_…), from create_machine or list_machines.",
488
+ "required": true
489
+ },
490
+ {
491
+ "name": "script",
492
+ "key": "script",
493
+ "type": "string",
494
+ "multiple": false,
495
+ "description": "The whole script, many lines.",
496
+ "required": true
497
+ },
498
+ {
499
+ "name": "interpreter",
500
+ "key": "interpreter",
501
+ "type": "string",
502
+ "multiple": false,
503
+ "enum": [
504
+ "bash",
505
+ "sh",
506
+ "python3",
507
+ "node"
508
+ ],
509
+ "description": "What runs it (default bash).",
510
+ "required": false
511
+ },
512
+ {
513
+ "name": "args",
514
+ "key": "args",
515
+ "type": "string",
516
+ "multiple": true,
517
+ "description": "Its arguments.",
518
+ "required": false
519
+ },
520
+ {
521
+ "name": "fail-fast",
522
+ "key": "failFast",
523
+ "type": "boolean",
524
+ "multiple": false,
525
+ "description": "bash/sh: stop at the first failing command (default true).",
526
+ "required": false
527
+ },
528
+ {
529
+ "name": "cwd",
530
+ "key": "cwd",
531
+ "type": "string",
532
+ "multiple": false,
533
+ "description": "Where to run it (default the home folder).",
534
+ "required": false
535
+ },
536
+ {
537
+ "name": "timeout-seconds",
538
+ "key": "timeoutSeconds",
539
+ "type": "integer",
540
+ "multiple": false,
541
+ "description": "Stop it after this long (default 600). 0: never.",
542
+ "required": false
543
+ },
544
+ {
545
+ "name": "wait",
546
+ "key": "wait",
547
+ "type": "integer",
548
+ "multiple": false,
549
+ "description": "Seconds to wait for it before answering (default 20).",
550
+ "required": false
551
+ }
552
+ ],
553
+ "examples": [
554
+ {
555
+ "run": "command script <machine> --script \"set -x; uname -a; df -h\"",
556
+ "about": "Run several steps in one go"
557
+ }
558
+ ],
559
+ "readOnly": false,
560
+ "destructive": false
561
+ },
562
+ {
563
+ "name": "command stop",
564
+ "tool": "signal_command",
565
+ "route": "POST /api/v1/commands/{id}/signal",
566
+ "summary": "Stop a command",
567
+ "description": "Stops a running command and everything it started: TERM (default), INT (like Ctrl-C) or KILL. A program that ignores TERM is KILLed 5 s later.",
568
+ "positional": [
569
+ "id"
570
+ ],
571
+ "flags": [
572
+ {
573
+ "name": "id",
574
+ "key": "id",
575
+ "type": "string",
576
+ "multiple": false,
577
+ "description": "The command’s id (cmd_…), from run_command or list_commands.",
578
+ "required": true
579
+ },
580
+ {
581
+ "name": "signal",
582
+ "key": "signal",
583
+ "type": "string",
584
+ "multiple": false,
585
+ "enum": [
586
+ "INT",
587
+ "TERM",
588
+ "KILL",
589
+ "HUP"
590
+ ],
591
+ "description": "TERM (default), INT (like Ctrl-C), KILL or HUP.",
592
+ "required": false
593
+ }
594
+ ],
595
+ "examples": [
596
+ {
597
+ "run": "command stop <id>",
598
+ "about": "Stop it"
599
+ }
600
+ ],
601
+ "readOnly": false,
602
+ "destructive": true
603
+ },
604
+ {
605
+ "name": "command view",
606
+ "tool": "get_command",
607
+ "route": "GET /api/v1/commands/{id}",
608
+ "summary": "Check a command",
609
+ "description": "A command’s status, exit code and the end of its output. wait=25 waits for it to end (answering as soon as it does), so one call per 25 s follows a long one.",
610
+ "positional": [
611
+ "id"
612
+ ],
613
+ "flags": [
614
+ {
615
+ "name": "id",
616
+ "key": "id",
617
+ "type": "string",
618
+ "multiple": false,
619
+ "description": "The command’s id (cmd_…), from run_command or list_commands.",
620
+ "required": true
621
+ },
622
+ {
623
+ "name": "wait",
624
+ "key": "wait",
625
+ "type": "integer",
626
+ "multiple": false,
627
+ "description": "Seconds to wait for it to end (0 to 25).",
628
+ "required": false
629
+ }
630
+ ],
631
+ "examples": [
632
+ {
633
+ "run": "command view <id> --wait 25",
634
+ "about": "Wait for it to end"
635
+ }
636
+ ],
637
+ "readOnly": true,
638
+ "destructive": false
639
+ },
640
+ {
641
+ "name": "deployment create",
642
+ "tool": "deploy_app",
643
+ "route": "POST /api/v1/deployments",
644
+ "summary": "Deploy an app",
645
+ "description": "Puts a web app or repository online at a URL of its name, built, started and kept running on a machine of its own. Code from a git repository (git: url, ref, path for a monorepo folder, token for a private one) or a folder on one of your machines (write the app there first, e.g. ~/app). What runs comes from its files: loaner.json (install, build, start or static, port), else package.json (Next.js, Astro and Vite need nothing; otherwise a \"start\" script that listens on $PORT on 0.0.0.0); a plain index.html is served as it is. Pass the variables it reads in env. kind \"app\" keeps it online until deleted; a preview (the default) stops after 2 idle hours. The same name again deploys a new version at the same URL. Answers at once: get_deployment with wait 25 until ready (its url) or failed (step and error say why; deployment_logs has each step). The deploy-an-app prompt walks through it.",
646
+ "positional": [],
647
+ "flags": [
648
+ {
649
+ "name": "name",
650
+ "key": "name",
651
+ "type": "string",
652
+ "multiple": false,
653
+ "description": "Its name, and its URL’s: 3 to 40 lower-case letters, digits and dashes.",
654
+ "required": true
655
+ },
656
+ {
657
+ "name": "machine",
658
+ "key": "machine",
659
+ "type": "string",
660
+ "multiple": false,
661
+ "description": "A machine of yours with the app’s folder on it.",
662
+ "required": false
663
+ },
664
+ {
665
+ "name": "path",
666
+ "key": "path",
667
+ "type": "string",
668
+ "multiple": false,
669
+ "description": "The app’s folder: on that machine (default ~/app), or inside the git repository (a monorepo’s apps/web).",
670
+ "required": false
671
+ },
672
+ {
673
+ "name": "git",
674
+ "key": "git",
675
+ "type": "string",
676
+ "multiple": false,
677
+ "description": "An https git URL to deploy instead.",
678
+ "required": false
679
+ },
680
+ {
681
+ "name": "ref",
682
+ "key": "ref",
683
+ "type": "string",
684
+ "multiple": false,
685
+ "description": "The git branch or tag (default: the repository’s default).",
686
+ "required": false
687
+ },
688
+ {
689
+ "name": "env",
690
+ "key": "env",
691
+ "type": "object",
692
+ "multiple": false,
693
+ "description": "Environment for its build and start.",
694
+ "required": false
695
+ },
696
+ {
697
+ "name": "kind",
698
+ "key": "kind",
699
+ "type": "string",
700
+ "multiple": false,
701
+ "enum": [
702
+ "preview",
703
+ "app"
704
+ ],
705
+ "description": "preview (the default): stops after 2 idle hours. app: keeps running until delete_deployment.",
706
+ "required": false
707
+ }
708
+ ],
709
+ "examples": [
710
+ {
711
+ "run": "deployment create --name docs-site --git https://github.com/honojs/starter.git",
712
+ "about": "From git"
713
+ },
714
+ {
715
+ "run": "deployment create --name focus --machine <machine> --path ~/app",
716
+ "about": "From a machine"
717
+ }
718
+ ],
719
+ "readOnly": false,
720
+ "destructive": false
721
+ },
722
+ {
723
+ "name": "deployment delete",
724
+ "tool": "delete_deployment",
725
+ "route": "DELETE /api/v1/deployments/{name}",
726
+ "summary": "Take a deployment down",
727
+ "description": "Stops its machine (its URL answers 404 from then on) and forgets it.",
728
+ "positional": [
729
+ "name"
730
+ ],
731
+ "flags": [
732
+ {
733
+ "name": "name",
734
+ "key": "name",
735
+ "type": "string",
736
+ "multiple": false,
737
+ "description": "The deployment’s name.",
738
+ "required": true
739
+ }
740
+ ],
741
+ "examples": [
742
+ {
743
+ "run": "deployment delete docs-site",
744
+ "about": "Take it down"
745
+ }
746
+ ],
747
+ "readOnly": false,
748
+ "destructive": true
749
+ },
750
+ {
751
+ "name": "deployment list",
752
+ "tool": "list_deployments",
753
+ "route": "GET /api/v1/deployments",
754
+ "summary": "Deployments",
755
+ "description": "Your deployments, with their status and URL.",
756
+ "positional": [],
757
+ "flags": [],
758
+ "examples": [
759
+ {
760
+ "run": "deployment list",
761
+ "about": "Everything deployed"
762
+ }
763
+ ],
764
+ "readOnly": true,
765
+ "destructive": false
766
+ },
767
+ {
768
+ "name": "deployment logs",
769
+ "tool": "deployment_logs",
770
+ "route": "GET /api/v1/deployments/{name}/logs",
771
+ "summary": "A deployment’s logs",
772
+ "description": "Its build log (source, install, build: each step’s state and last lines) and its running app’s own output, apart. of: \"build\" or \"app\" for one; lines for more (40 by default). Read on or follow with read_output and the command it names.",
773
+ "positional": [
774
+ "name"
775
+ ],
776
+ "flags": [
777
+ {
778
+ "name": "name",
779
+ "key": "name",
780
+ "type": "string",
781
+ "multiple": false,
782
+ "description": "The deployment’s name.",
783
+ "required": true
784
+ },
785
+ {
786
+ "name": "of",
787
+ "key": "of",
788
+ "type": "string",
789
+ "multiple": false,
790
+ "enum": [
791
+ "all",
792
+ "build",
793
+ "app"
794
+ ],
795
+ "description": "Which log: build, app, or both (the default).",
796
+ "required": false
797
+ },
798
+ {
799
+ "name": "lines",
800
+ "key": "lines",
801
+ "type": "integer",
802
+ "multiple": false,
803
+ "description": "How many last lines of each (40).",
804
+ "required": false
805
+ }
806
+ ],
807
+ "examples": [
808
+ {
809
+ "run": "deployment logs docs-site --of build",
810
+ "about": "Why its build failed"
811
+ },
812
+ {
813
+ "run": "deployment logs docs-site --of app --lines 200",
814
+ "about": "What the running app printed"
815
+ }
816
+ ],
817
+ "readOnly": true,
818
+ "destructive": false
819
+ },
820
+ {
821
+ "name": "deployment view",
822
+ "tool": "get_deployment",
823
+ "route": "GET /api/v1/deployments/{name}",
824
+ "summary": "One deployment",
825
+ "description": "A deployment and how far it got: with wait it answers as soon as its build ends. Ready: its url. Failed: step and error (the end of the failing step’s output); deployment_logs has more.",
826
+ "positional": [
827
+ "name"
828
+ ],
829
+ "flags": [
830
+ {
831
+ "name": "name",
832
+ "key": "name",
833
+ "type": "string",
834
+ "multiple": false,
835
+ "description": "The deployment’s name.",
836
+ "required": true
837
+ },
838
+ {
839
+ "name": "wait",
840
+ "key": "wait",
841
+ "type": "integer",
842
+ "multiple": false,
843
+ "description": "Seconds to wait for a build in progress (at most 25).",
844
+ "required": false
845
+ }
846
+ ],
847
+ "examples": [
848
+ {
849
+ "run": "deployment view docs-site --wait 25",
850
+ "about": "Until it is up"
851
+ }
852
+ ],
853
+ "readOnly": true,
854
+ "destructive": false
855
+ },
856
+ {
857
+ "name": "event list",
858
+ "tool": "wait_for_events",
859
+ "route": "GET /api/v1/events",
860
+ "summary": "Wait for what happens next",
861
+ "description": "Events after `after` (0 for all kept): machines made, about to stop idle, stopped (with why), commands started and ended, network denials. With wait (up to 25 s) it answers the moment one happens. Call it again with the nextAfter it gave to follow along without missing anything.",
862
+ "positional": [],
863
+ "flags": [
864
+ {
865
+ "name": "after",
866
+ "key": "after",
867
+ "type": "integer",
868
+ "multiple": false,
869
+ "description": "Only events after this seq: 0, or the nextAfter the last call gave.",
870
+ "required": false
871
+ },
872
+ {
873
+ "name": "machine",
874
+ "key": "machine",
875
+ "type": "string",
876
+ "multiple": false,
877
+ "description": "Only events about this machine or its commands.",
878
+ "required": false
879
+ },
880
+ {
881
+ "name": "types",
882
+ "key": "types",
883
+ "type": "string",
884
+ "multiple": true,
885
+ "enum": [
886
+ "machine.created",
887
+ "machine.running",
888
+ "machine.expiring",
889
+ "machine.disk_low",
890
+ "machine.stopping",
891
+ "machine.stopped",
892
+ "machine.forked",
893
+ "machine.adopted",
894
+ "command.started",
895
+ "command.ended",
896
+ "snapshot.saved",
897
+ "port.opened",
898
+ "network.denied",
899
+ "webhook.disabled"
900
+ ],
901
+ "description": "Only these types, e.g. [\"command.ended\", \"machine.stopped\"].",
902
+ "required": false
903
+ },
904
+ {
905
+ "name": "wait",
906
+ "key": "wait",
907
+ "type": "integer",
908
+ "multiple": false,
909
+ "description": "Seconds to wait for the next event when there is none yet.",
910
+ "required": false
911
+ }
912
+ ],
913
+ "examples": [
914
+ {
915
+ "run": "event list --after 0",
916
+ "about": "Everything kept"
917
+ },
918
+ {
919
+ "run": "event list --machine <machine> --wait 25",
920
+ "about": "Wait for what happens to one machine"
921
+ }
922
+ ],
923
+ "readOnly": true,
924
+ "destructive": false
925
+ },
926
+ {
927
+ "name": "feature list",
928
+ "tool": "list_features",
929
+ "route": "GET /api/features",
930
+ "summary": "Features",
931
+ "description": "Every feature that can be switched off, whether it works for you and why (its own switch, a feature it needs, or FEATURES_OFF), and when one that is on cannot work now, what it waits on. A feature that is off answers its tools with 403 feature_disabled.",
932
+ "positional": [],
933
+ "flags": [],
934
+ "examples": [
935
+ {
936
+ "run": "feature list",
937
+ "about": "Which features are on"
938
+ }
939
+ ],
940
+ "readOnly": true,
941
+ "destructive": false
942
+ },
943
+ {
944
+ "name": "feature switch",
945
+ "tool": "switch_feature",
946
+ "route": "PATCH /api/features/{key}",
947
+ "summary": "Switch a feature",
948
+ "description": "Switches a feature on or off for everyone, one person (person:<email>) or one API key (key:<name>); state default removes that switch, so the next less specific one decides. Owner only, and only on the user’s word: a feature found off is reported to the user, never switched on to finish a task. Features that need it stop too: try with preview first, which changes nothing and lists what would change.",
949
+ "positional": [
950
+ "key"
951
+ ],
952
+ "flags": [
953
+ {
954
+ "name": "key",
955
+ "key": "key",
956
+ "type": "string",
957
+ "multiple": false,
958
+ "description": "The feature’s key, from list_features.",
959
+ "required": true
960
+ },
961
+ {
962
+ "name": "state",
963
+ "key": "state",
964
+ "type": "string",
965
+ "multiple": false,
966
+ "enum": [
967
+ "on",
968
+ "off",
969
+ "default"
970
+ ],
971
+ "description": "on, off, or default to remove this scope’s switch.",
972
+ "required": true
973
+ },
974
+ {
975
+ "name": "scope",
976
+ "key": "scope",
977
+ "type": "string",
978
+ "multiple": false,
979
+ "description": "everyone (the default), person:<email> or key:<name>.",
980
+ "required": false
981
+ },
982
+ {
983
+ "name": "preview",
984
+ "key": "preview",
985
+ "type": "boolean",
986
+ "multiple": false,
987
+ "description": "true: change nothing, say what would change.",
988
+ "required": false
989
+ }
990
+ ],
991
+ "examples": [
992
+ {
993
+ "run": "feature switch webhooks --state off --preview",
994
+ "about": "What switching it off would stop"
995
+ }
996
+ ],
997
+ "readOnly": false,
998
+ "destructive": false
999
+ },
1000
+ {
1001
+ "name": "file edit",
1002
+ "tool": "edit_file",
1003
+ "route": "PATCH /api/v1/machines/{machine}/files",
1004
+ "summary": "Edit a file",
1005
+ "description": "Changes part of a text file: replaces oldText, which must appear exactly once (whitespace and all; replaceAll for every one), with newText. Several edits apply in order, all or none. Or insertAfterLine with text. Answers the changed lines, numbered. Prefer it to write_file for any change to an existing file.",
1006
+ "positional": [
1007
+ "machine"
1008
+ ],
1009
+ "flags": [
1010
+ {
1011
+ "name": "machine",
1012
+ "key": "machine",
1013
+ "type": "string",
1014
+ "multiple": false,
1015
+ "description": "The machine’s id (mch_…), from create_machine or list_machines.",
1016
+ "required": true
1017
+ },
1018
+ {
1019
+ "name": "path",
1020
+ "key": "path",
1021
+ "type": "string",
1022
+ "multiple": false,
1023
+ "description": "e.g. \"~/app/main.py\"; ~ is the home folder.",
1024
+ "required": true
1025
+ },
1026
+ {
1027
+ "name": "old-text",
1028
+ "key": "oldText",
1029
+ "type": "string",
1030
+ "multiple": false,
1031
+ "description": "The exact text to replace, copied from read_file (without line numbers).",
1032
+ "required": false
1033
+ },
1034
+ {
1035
+ "name": "new-text",
1036
+ "key": "newText",
1037
+ "type": "string",
1038
+ "multiple": false,
1039
+ "description": "What goes in its place; empty deletes it.",
1040
+ "required": false
1041
+ },
1042
+ {
1043
+ "name": "replace-all",
1044
+ "key": "replaceAll",
1045
+ "type": "boolean",
1046
+ "multiple": false,
1047
+ "description": "Replace every match instead of one.",
1048
+ "required": false
1049
+ },
1050
+ {
1051
+ "name": "edits",
1052
+ "key": "edits",
1053
+ "type": "object",
1054
+ "multiple": true,
1055
+ "description": "Several replacements at once, in order (instead of oldText/newText).",
1056
+ "required": false
1057
+ },
1058
+ {
1059
+ "name": "insert-after-line",
1060
+ "key": "insertAfterLine",
1061
+ "type": "integer",
1062
+ "multiple": false,
1063
+ "description": "Insert text after this line (0 = at the top).",
1064
+ "required": false
1065
+ },
1066
+ {
1067
+ "name": "text",
1068
+ "key": "text",
1069
+ "type": "string",
1070
+ "multiple": false,
1071
+ "description": "With insertAfterLine: the lines to insert.",
1072
+ "required": false
1073
+ }
1074
+ ],
1075
+ "examples": [
1076
+ {
1077
+ "run": "file edit <machine> --path ~/app.py --old-text \"debug = True\" --new-text \"debug = False\"",
1078
+ "about": "Replace one line"
1079
+ }
1080
+ ],
1081
+ "readOnly": false,
1082
+ "destructive": false
1083
+ },
1084
+ {
1085
+ "name": "file list",
1086
+ "tool": "list_dir",
1087
+ "route": "GET /api/v1/machines/{machine}/dir",
1088
+ "summary": "List a folder",
1089
+ "description": "Lists a folder on a machine: names, types, sizes and last changes, folders first. Default: the home folder.",
1090
+ "positional": [
1091
+ "machine"
1092
+ ],
1093
+ "flags": [
1094
+ {
1095
+ "name": "machine",
1096
+ "key": "machine",
1097
+ "type": "string",
1098
+ "multiple": false,
1099
+ "description": "The machine’s id (mch_…), from create_machine or list_machines.",
1100
+ "required": true
1101
+ },
1102
+ {
1103
+ "name": "path",
1104
+ "key": "path",
1105
+ "type": "string",
1106
+ "multiple": false,
1107
+ "description": "Default \"~\".",
1108
+ "required": false
1109
+ }
1110
+ ],
1111
+ "examples": [
1112
+ {
1113
+ "run": "file list <machine> --path ~",
1114
+ "about": "The home folder"
1115
+ }
1116
+ ],
1117
+ "readOnly": true,
1118
+ "destructive": false
1119
+ },
1120
+ {
1121
+ "name": "file read",
1122
+ "tool": "read_file",
1123
+ "route": "GET /api/v1/machines/{machine}/files",
1124
+ "summary": "Read a file",
1125
+ "description": "Reads a file from a machine, with line numbers (text), or base64 for a binary one; the first 1024 KB of a bigger one. lines (\"40-80\") reads part of a long file. Read before edit_file so your oldText matches exactly.",
1126
+ "positional": [
1127
+ "machine"
1128
+ ],
1129
+ "flags": [
1130
+ {
1131
+ "name": "machine",
1132
+ "key": "machine",
1133
+ "type": "string",
1134
+ "multiple": false,
1135
+ "description": "The machine’s id (mch_…), from create_machine or list_machines.",
1136
+ "required": true
1137
+ },
1138
+ {
1139
+ "name": "path",
1140
+ "key": "path",
1141
+ "type": "string",
1142
+ "multiple": false,
1143
+ "description": "e.g. \"~/app/main.py\"; ~ is the home folder.",
1144
+ "required": true
1145
+ },
1146
+ {
1147
+ "name": "lines",
1148
+ "key": "lines",
1149
+ "type": "string",
1150
+ "multiple": false,
1151
+ "description": "Only these lines: \"40-80\", or \"40-\" to the end.",
1152
+ "required": false
1153
+ }
1154
+ ],
1155
+ "examples": [
1156
+ {
1157
+ "run": "file read <machine> --path ~/notes.txt",
1158
+ "about": "Print a file"
1159
+ }
1160
+ ],
1161
+ "readOnly": true,
1162
+ "destructive": false
1163
+ },
1164
+ {
1165
+ "name": "file search",
1166
+ "tool": "search_files",
1167
+ "route": "GET /api/v1/machines/{machine}/search",
1168
+ "summary": "Search files",
1169
+ "description": "Finds lines matching pattern (a regular expression) in the files under path, with file and line number; or, with only glob, the files named like it (\"*.py\"). Skips .git and node_modules unless all. Faster and tidier than grep through run_command.",
1170
+ "positional": [
1171
+ "machine"
1172
+ ],
1173
+ "flags": [
1174
+ {
1175
+ "name": "machine",
1176
+ "key": "machine",
1177
+ "type": "string",
1178
+ "multiple": false,
1179
+ "description": "The machine’s id (mch_…), from create_machine or list_machines.",
1180
+ "required": true
1181
+ },
1182
+ {
1183
+ "name": "path",
1184
+ "key": "path",
1185
+ "type": "string",
1186
+ "multiple": false,
1187
+ "description": "Where to look (default \"~\").",
1188
+ "required": false
1189
+ },
1190
+ {
1191
+ "name": "pattern",
1192
+ "key": "pattern",
1193
+ "type": "string",
1194
+ "multiple": false,
1195
+ "description": "What to find, e.g. \"def login|class User\".",
1196
+ "required": false
1197
+ },
1198
+ {
1199
+ "name": "glob",
1200
+ "key": "glob",
1201
+ "type": "string",
1202
+ "multiple": false,
1203
+ "description": "Only these files, e.g. \"*.ts\".",
1204
+ "required": false
1205
+ },
1206
+ {
1207
+ "name": "ignore-case",
1208
+ "key": "ignoreCase",
1209
+ "type": "boolean",
1210
+ "multiple": false,
1211
+ "description": "Match in any case.",
1212
+ "required": false
1213
+ },
1214
+ {
1215
+ "name": "all",
1216
+ "key": "all",
1217
+ "type": "boolean",
1218
+ "multiple": false,
1219
+ "description": "Also look in .git and node_modules.",
1220
+ "required": false
1221
+ },
1222
+ {
1223
+ "name": "limit",
1224
+ "key": "limit",
1225
+ "type": "integer",
1226
+ "multiple": false,
1227
+ "description": "At most this many (default 100).",
1228
+ "required": false
1229
+ }
1230
+ ],
1231
+ "examples": [
1232
+ {
1233
+ "run": "file search <machine> --pattern \"TODO\" --glob \"*.py\"",
1234
+ "about": "TODOs in Python files"
1235
+ }
1236
+ ],
1237
+ "readOnly": true,
1238
+ "destructive": false
1239
+ },
1240
+ {
1241
+ "name": "file write",
1242
+ "tool": "write_file",
1243
+ "route": "PUT /api/v1/machines/{machine}/files",
1244
+ "summary": "Write a file",
1245
+ "description": "Creates or replaces a whole file on a machine, making its folders. Use it for new files, rather than echo or heredocs; edit_file changes part of one.",
1246
+ "positional": [
1247
+ "machine"
1248
+ ],
1249
+ "flags": [
1250
+ {
1251
+ "name": "machine",
1252
+ "key": "machine",
1253
+ "type": "string",
1254
+ "multiple": false,
1255
+ "description": "The machine’s id (mch_…), from create_machine or list_machines.",
1256
+ "required": true
1257
+ },
1258
+ {
1259
+ "name": "path",
1260
+ "key": "path",
1261
+ "type": "string",
1262
+ "multiple": false,
1263
+ "description": "e.g. \"~/app/main.py\"; ~ is the home folder.",
1264
+ "required": true
1265
+ },
1266
+ {
1267
+ "name": "content",
1268
+ "key": "content",
1269
+ "type": "string",
1270
+ "multiple": false,
1271
+ "description": "The whole new content.",
1272
+ "required": true
1273
+ },
1274
+ {
1275
+ "name": "encoding",
1276
+ "key": "encoding",
1277
+ "type": "string",
1278
+ "multiple": false,
1279
+ "enum": [
1280
+ "utf8",
1281
+ "base64"
1282
+ ],
1283
+ "description": "utf8 (default) or base64 for binary.",
1284
+ "required": false
1285
+ }
1286
+ ],
1287
+ "examples": [
1288
+ {
1289
+ "run": "file write <machine> --path ~/hello.py --content \"print(1)\"",
1290
+ "about": "Write a file"
1291
+ }
1292
+ ],
1293
+ "readOnly": false,
1294
+ "destructive": false
1295
+ },
1296
+ {
1297
+ "name": "file write-many",
1298
+ "tool": "write_files",
1299
+ "route": "POST /api/v1/machines/{machine}/files/batch",
1300
+ "summary": "Write many files",
1301
+ "description": "Writes up to 100 files at once (a small project, a set of configs), making folders. Each file works or fails on its own.",
1302
+ "positional": [
1303
+ "machine"
1304
+ ],
1305
+ "flags": [
1306
+ {
1307
+ "name": "machine",
1308
+ "key": "machine",
1309
+ "type": "string",
1310
+ "multiple": false,
1311
+ "description": "The machine’s id (mch_…), from create_machine or list_machines.",
1312
+ "required": true
1313
+ },
1314
+ {
1315
+ "name": "files",
1316
+ "key": "files",
1317
+ "type": "object",
1318
+ "multiple": true,
1319
+ "description": "Each file: path and its whole content.",
1320
+ "required": true
1321
+ }
1322
+ ],
1323
+ "examples": [
1324
+ {
1325
+ "run": "file write-many <machine> --input files.json",
1326
+ "about": "Write the files listed in files.json"
1327
+ }
1328
+ ],
1329
+ "readOnly": false,
1330
+ "destructive": false
1331
+ },
1332
+ {
1333
+ "name": "key create",
1334
+ "tool": "create_key",
1335
+ "route": "POST /api/keys",
1336
+ "summary": "Make an API key",
1337
+ "description": "Makes an API key for one app, machine or person and returns it once: hand it to its holder, never keep it in a file or a message. Only a key set in the deployment or a signed-in person may make keys.",
1338
+ "positional": [],
1339
+ "flags": [
1340
+ {
1341
+ "name": "name",
1342
+ "key": "name",
1343
+ "type": "string",
1344
+ "multiple": false,
1345
+ "description": "Who or what holds it, e.g. `billing-app`: lowercase letters, digits and hyphens.",
1346
+ "required": true
1347
+ },
1348
+ {
1349
+ "name": "scopes",
1350
+ "key": "scopes",
1351
+ "type": "string",
1352
+ "multiple": true,
1353
+ "enum": [
1354
+ "read",
1355
+ "write",
1356
+ "admin"
1357
+ ],
1358
+ "description": "What it may do. Left out: read and write. Add admin only for a holder that manages the service itself.",
1359
+ "required": false
1360
+ }
1361
+ ],
1362
+ "examples": [
1363
+ {
1364
+ "run": "key create --name billing-app",
1365
+ "about": "A key for the billing app, shown once"
1366
+ }
1367
+ ],
1368
+ "readOnly": false,
1369
+ "destructive": false
1370
+ },
1371
+ {
1372
+ "name": "key delete",
1373
+ "tool": "delete_key",
1374
+ "route": "DELETE /api/keys/{id}",
1375
+ "summary": "Revoke an API key",
1376
+ "description": "Revokes an API key at once: its next request is refused. Only a key set in the deployment or a signed-in person may revoke keys.",
1377
+ "positional": [
1378
+ "id"
1379
+ ],
1380
+ "flags": [
1381
+ {
1382
+ "name": "id",
1383
+ "key": "id",
1384
+ "type": "string",
1385
+ "multiple": false,
1386
+ "description": "The key’s id (`key_…`), from list_keys.",
1387
+ "required": true
1388
+ }
1389
+ ],
1390
+ "examples": [
1391
+ {
1392
+ "run": "key delete key_a1b2c3 --yes",
1393
+ "about": "Revoke a key at once"
1394
+ }
1395
+ ],
1396
+ "readOnly": false,
1397
+ "destructive": true
1398
+ },
1399
+ {
1400
+ "name": "key list",
1401
+ "tool": "list_keys",
1402
+ "route": "GET /api/keys",
1403
+ "summary": "API keys",
1404
+ "description": "The API keys made through the API, with when each was last used, and the names of the keys set in the deployment. The keys themselves are never shown again.",
1405
+ "positional": [],
1406
+ "flags": [],
1407
+ "examples": [
1408
+ {
1409
+ "run": "key list",
1410
+ "about": "Every key, and when each was last used"
1411
+ }
1412
+ ],
1413
+ "readOnly": true,
1414
+ "destructive": false
1415
+ },
1416
+ {
1417
+ "name": "key policy",
1418
+ "tool": "set_key_policy",
1419
+ "route": "PUT /api/v1/key-policies/{name}",
1420
+ "summary": "Limit a key",
1421
+ "description": "Bounds what a key made with create_key may do: only machines named with namePrefix, at most maxMachines at once, idle time up to maxTtlMinutes, these network modes. For handing an agent a key of its own. A deployment key or the owner only.",
1422
+ "positional": [
1423
+ "name"
1424
+ ],
1425
+ "flags": [
1426
+ {
1427
+ "name": "name",
1428
+ "key": "name",
1429
+ "type": "string",
1430
+ "multiple": false,
1431
+ "description": "The key’s name.",
1432
+ "required": true
1433
+ },
1434
+ {
1435
+ "name": "name-prefix",
1436
+ "key": "namePrefix",
1437
+ "type": "string",
1438
+ "multiple": false,
1439
+ "description": "e.g. \"mcp-\"; null lifts it.",
1440
+ "required": false
1441
+ },
1442
+ {
1443
+ "name": "max-machines",
1444
+ "key": "maxMachines",
1445
+ "type": "integer",
1446
+ "multiple": false,
1447
+ "description": "The most machines at once; null lifts it.",
1448
+ "required": false
1449
+ },
1450
+ {
1451
+ "name": "max-ttl-minutes",
1452
+ "key": "maxTtlMinutes",
1453
+ "type": "integer",
1454
+ "multiple": false,
1455
+ "description": "The longest idle time; null lifts it.",
1456
+ "required": false
1457
+ },
1458
+ {
1459
+ "name": "network-modes",
1460
+ "key": "networkModes",
1461
+ "type": "string",
1462
+ "multiple": true,
1463
+ "enum": [
1464
+ "off",
1465
+ "open",
1466
+ "allowlist"
1467
+ ],
1468
+ "description": "Allowed network modes.",
1469
+ "required": false
1470
+ }
1471
+ ],
1472
+ "examples": [
1473
+ {
1474
+ "run": "key policy agent-1 --name-prefix mcp- --max-machines 3",
1475
+ "about": "A key for one agent"
1476
+ }
1477
+ ],
1478
+ "readOnly": false,
1479
+ "destructive": false
1480
+ },
1481
+ {
1482
+ "name": "key view",
1483
+ "tool": "get_key",
1484
+ "route": "GET /api/keys/{id}",
1485
+ "summary": "One API key",
1486
+ "description": "One API key made through the API: name, start, maker, last use. Never the key itself.",
1487
+ "positional": [
1488
+ "id"
1489
+ ],
1490
+ "flags": [
1491
+ {
1492
+ "name": "id",
1493
+ "key": "id",
1494
+ "type": "string",
1495
+ "multiple": false,
1496
+ "description": "The key’s id (`key_…`), from list_keys.",
1497
+ "required": true
1498
+ }
1499
+ ],
1500
+ "examples": [
1501
+ {
1502
+ "run": "key view key_a1b2c3",
1503
+ "about": "One key: its name, start and last use"
1504
+ }
1505
+ ],
1506
+ "readOnly": true,
1507
+ "destructive": false
1508
+ },
1509
+ {
1510
+ "name": "machine console",
1511
+ "tool": "read_console",
1512
+ "route": "GET /api/v1/machines/{machine}/console",
1513
+ "summary": "Read a machine’s console",
1514
+ "description": "A machine’s console log: its boot, kernel messages (out of memory kills, crashes) and console shell. Read it when a machine or command ended as lost, or behaves oddly. Start at offset 0, then pass back nextOffset.",
1515
+ "positional": [
1516
+ "machine"
1517
+ ],
1518
+ "flags": [
1519
+ {
1520
+ "name": "machine",
1521
+ "key": "machine",
1522
+ "type": "string",
1523
+ "multiple": false,
1524
+ "description": "The machine’s id (mch_…), from create_machine or list_machines.",
1525
+ "required": true
1526
+ },
1527
+ {
1528
+ "name": "offset",
1529
+ "key": "offset",
1530
+ "type": "integer",
1531
+ "multiple": false,
1532
+ "description": "The byte to start at: 0, or the nextOffset the last read gave.",
1533
+ "required": false
1534
+ },
1535
+ {
1536
+ "name": "wait",
1537
+ "key": "wait",
1538
+ "type": "integer",
1539
+ "multiple": false,
1540
+ "description": "Seconds to wait for new bytes.",
1541
+ "required": false
1542
+ }
1543
+ ],
1544
+ "examples": [
1545
+ {
1546
+ "run": "machine console <machine>",
1547
+ "about": "Its boot and kernel messages"
1548
+ }
1549
+ ],
1550
+ "readOnly": true,
1551
+ "destructive": false
1552
+ },
1553
+ {
1554
+ "name": "machine create",
1555
+ "tool": "create_machine",
1556
+ "route": "POST /api/v1/machines",
1557
+ "summary": "Make a Linux machine",
1558
+ "description": "Boots a fresh Linux machine (Debian 13 by default) in about a second, ready for run_command. It has internet access and passwordless sudo as \"user\". Start here. fromSnapshot makes a copy of a saved machine instead.",
1559
+ "positional": [],
1560
+ "flags": [
1561
+ {
1562
+ "name": "name",
1563
+ "key": "name",
1564
+ "type": "string",
1565
+ "multiple": false,
1566
+ "description": "A name to find it by. One running machine has it at a time; a taken one is an error unless ifExists is \"return\".",
1567
+ "required": false
1568
+ },
1569
+ {
1570
+ "name": "if-exists",
1571
+ "key": "ifExists",
1572
+ "type": "string",
1573
+ "multiple": false,
1574
+ "enum": [
1575
+ "fail",
1576
+ "return"
1577
+ ],
1578
+ "description": "\"return\": if a running machine already has this name, get it back instead (find-or-make).",
1579
+ "required": false
1580
+ },
1581
+ {
1582
+ "name": "labels",
1583
+ "key": "labels",
1584
+ "type": "object",
1585
+ "multiple": false,
1586
+ "description": "Labels to find it by later (list_machines labels), e.g. {\"task\": \"fix-login\"}.",
1587
+ "required": false
1588
+ },
1589
+ {
1590
+ "name": "network",
1591
+ "key": "network",
1592
+ "type": "object",
1593
+ "multiple": false,
1594
+ "description": "What it may reach: {\"mode\":\"open\"} (default: the internet, not the LAN), {\"mode\":\"allowlist\",\"allow\":[\"*.github.com\"]}, or {\"mode\":\"off\"}.",
1595
+ "required": false
1596
+ },
1597
+ {
1598
+ "name": "distro",
1599
+ "key": "distro",
1600
+ "type": "string",
1601
+ "multiple": false,
1602
+ "enum": [
1603
+ "debian",
1604
+ "alpine"
1605
+ ],
1606
+ "description": "debian (default, apt) or alpine (apk).",
1607
+ "required": false
1608
+ },
1609
+ {
1610
+ "name": "template",
1611
+ "key": "template",
1612
+ "type": "string",
1613
+ "multiple": false,
1614
+ "description": "Start from this template (list_templates): an image or Dockerfile with its tools installed once.",
1615
+ "required": false
1616
+ },
1617
+ {
1618
+ "name": "runtime",
1619
+ "key": "runtime",
1620
+ "type": "string",
1621
+ "multiple": false,
1622
+ "enum": [
1623
+ "wasm",
1624
+ "container",
1625
+ "vm"
1626
+ ],
1627
+ "description": "What runs it, if this server has more than one (list_runtimes): wasm (memory forks, slower compute) or container (Docker: native speed, file-only forks, network through an HTTP proxy). Default: the server’s first.",
1628
+ "required": false
1629
+ },
1630
+ {
1631
+ "name": "memory-mi-b",
1632
+ "key": "memoryMiB",
1633
+ "type": "integer",
1634
+ "multiple": false,
1635
+ "description": "Guest memory in MiB (default 1024).",
1636
+ "required": false
1637
+ },
1638
+ {
1639
+ "name": "disk-mi-b",
1640
+ "key": "diskMiB",
1641
+ "type": "integer",
1642
+ "multiple": false,
1643
+ "description": "The most it may write to its disk, in MiB (default 10240), where capabilities.diskQuota: past it, it stops.",
1644
+ "required": false
1645
+ },
1646
+ {
1647
+ "name": "cpus",
1648
+ "key": "cpus",
1649
+ "type": "integer",
1650
+ "multiple": false,
1651
+ "description": "CPUs, 1 to 4 (default 1).",
1652
+ "required": false
1653
+ },
1654
+ {
1655
+ "name": "ttl-minutes",
1656
+ "key": "ttlMinutes",
1657
+ "type": "integer",
1658
+ "multiple": false,
1659
+ "description": "Stop it after this many idle minutes (default 120).",
1660
+ "required": false
1661
+ },
1662
+ {
1663
+ "name": "from-snapshot",
1664
+ "key": "fromSnapshot",
1665
+ "type": "string",
1666
+ "multiple": false,
1667
+ "description": "A snapshot id (list_snapshots) to start from.",
1668
+ "required": false
1669
+ }
1670
+ ],
1671
+ "examples": [
1672
+ {
1673
+ "run": "machine create --name build-box",
1674
+ "about": "A fresh Debian machine"
1675
+ }
1676
+ ],
1677
+ "readOnly": false,
1678
+ "destructive": false
1679
+ },
1680
+ {
1681
+ "name": "machine delete",
1682
+ "tool": "delete_machine",
1683
+ "route": "DELETE /api/v1/machines/{machine}",
1684
+ "summary": "Delete a machine",
1685
+ "description": "Powers a machine off for good, with its files. Commands still running end as lost.",
1686
+ "positional": [
1687
+ "machine"
1688
+ ],
1689
+ "flags": [
1690
+ {
1691
+ "name": "machine",
1692
+ "key": "machine",
1693
+ "type": "string",
1694
+ "multiple": false,
1695
+ "description": "The machine’s id (mch_…), from create_machine or list_machines.",
1696
+ "required": true
1697
+ }
1698
+ ],
1699
+ "examples": [
1700
+ {
1701
+ "run": "machine delete <machine> --yes",
1702
+ "about": "Power it off for good"
1703
+ }
1704
+ ],
1705
+ "readOnly": false,
1706
+ "destructive": true
1707
+ },
1708
+ {
1709
+ "name": "machine extend",
1710
+ "tool": "extend_machine",
1711
+ "route": "PATCH /api/v1/machines/{id}",
1712
+ "summary": "Keep a machine longer",
1713
+ "description": "Keeps a machine from stopping idle: it may now sit unused for ttlMinutes from now. Use it when you will come back to a machine later, or after a machine.expiring event.",
1714
+ "positional": [
1715
+ "machine"
1716
+ ],
1717
+ "flags": [
1718
+ {
1719
+ "name": "machine",
1720
+ "key": "machine",
1721
+ "type": "string",
1722
+ "multiple": false,
1723
+ "description": "The machine’s id (mch_…), from create_machine or list_machines.",
1724
+ "required": true
1725
+ },
1726
+ {
1727
+ "name": "ttl-minutes",
1728
+ "key": "ttlMinutes",
1729
+ "type": "integer",
1730
+ "multiple": false,
1731
+ "description": "Idle minutes allowed from now (up to 1440).",
1732
+ "required": true
1733
+ }
1734
+ ],
1735
+ "examples": [
1736
+ {
1737
+ "run": "machine extend <machine> --ttl-minutes 240",
1738
+ "about": "Four more hours idle"
1739
+ }
1740
+ ],
1741
+ "readOnly": false,
1742
+ "destructive": false
1743
+ },
1744
+ {
1745
+ "name": "machine fork",
1746
+ "tool": "fork_machine",
1747
+ "route": "POST /api/v1/machines/{machine}/fork",
1748
+ "summary": "Copy a machine",
1749
+ "description": "Makes count running copies of a machine as it is now (files, installed tools, running processes), each on its own from then on, in about a second. Use it to try several fixes or approaches at once, then keep the one that works and delete the rest. Commands you started stay with the source. Each copy works or fails on its own.",
1750
+ "positional": [
1751
+ "machine"
1752
+ ],
1753
+ "flags": [
1754
+ {
1755
+ "name": "machine",
1756
+ "key": "machine",
1757
+ "type": "string",
1758
+ "multiple": false,
1759
+ "description": "The machine’s id (mch_…), from create_machine or list_machines.",
1760
+ "required": true
1761
+ },
1762
+ {
1763
+ "name": "count",
1764
+ "key": "count",
1765
+ "type": "integer",
1766
+ "multiple": false,
1767
+ "description": "How many copies (up to 10, and the free machine slots). Leave it out when commands says.",
1768
+ "required": false
1769
+ },
1770
+ {
1771
+ "name": "commands",
1772
+ "key": "commands",
1773
+ "type": "string",
1774
+ "multiple": true,
1775
+ "description": "One shell command per copy, started as soon as it runs (copy 1 runs the first…): try a different fix on each in one call. The answer has each command’s exit code and output.",
1776
+ "required": false
1777
+ },
1778
+ {
1779
+ "name": "cwd",
1780
+ "key": "cwd",
1781
+ "type": "string",
1782
+ "multiple": false,
1783
+ "description": "Where each command runs (default the home folder; \"~/app\" works).",
1784
+ "required": false
1785
+ },
1786
+ {
1787
+ "name": "wait",
1788
+ "key": "wait",
1789
+ "type": "integer",
1790
+ "multiple": false,
1791
+ "description": "Seconds to wait for the commands (default 20).",
1792
+ "required": false
1793
+ },
1794
+ {
1795
+ "name": "name",
1796
+ "key": "name",
1797
+ "type": "string",
1798
+ "multiple": false,
1799
+ "description": "Copies are called <name>-1 … <name>-<count>.",
1800
+ "required": false
1801
+ },
1802
+ {
1803
+ "name": "labels",
1804
+ "key": "labels",
1805
+ "type": "object",
1806
+ "multiple": false,
1807
+ "description": "Labels to find it by later (list_machines labels), e.g. {\"task\": \"fix-login\"}.",
1808
+ "required": false
1809
+ },
1810
+ {
1811
+ "name": "ttl-minutes",
1812
+ "key": "ttlMinutes",
1813
+ "type": "integer",
1814
+ "multiple": false,
1815
+ "description": "Idle minutes for the copies.",
1816
+ "required": false
1817
+ }
1818
+ ],
1819
+ "examples": [
1820
+ {
1821
+ "run": "machine fork <machine> --count 3 --name try",
1822
+ "about": "Three copies: try-1, try-2, try-3"
1823
+ }
1824
+ ],
1825
+ "readOnly": false,
1826
+ "destructive": false
1827
+ },
1828
+ {
1829
+ "name": "machine list",
1830
+ "tool": "list_machines",
1831
+ "route": "GET /api/v1/machines",
1832
+ "summary": "Machines",
1833
+ "description": "Your machines, the newest first. status=running keeps the ones you can use; labels or name finds the ones you made earlier.",
1834
+ "positional": [],
1835
+ "flags": [
1836
+ {
1837
+ "name": "status",
1838
+ "key": "status",
1839
+ "type": "string",
1840
+ "multiple": false,
1841
+ "enum": [
1842
+ "booting",
1843
+ "running",
1844
+ "stopped",
1845
+ "lost"
1846
+ ],
1847
+ "description": "Only machines in this state.",
1848
+ "required": false
1849
+ },
1850
+ {
1851
+ "name": "name",
1852
+ "key": "name",
1853
+ "type": "string",
1854
+ "multiple": false,
1855
+ "description": "Only machines with this name.",
1856
+ "required": false
1857
+ },
1858
+ {
1859
+ "name": "forked-from",
1860
+ "key": "forkedFrom",
1861
+ "type": "string",
1862
+ "multiple": false,
1863
+ "description": "Only the copies fork_machine made of this machine (mch_…); with status=running, the ones to clean up.",
1864
+ "required": false
1865
+ },
1866
+ {
1867
+ "name": "labels",
1868
+ "key": "labels",
1869
+ "type": "string",
1870
+ "multiple": false,
1871
+ "description": "Only machines with every one of these labels: \"task=fix-login,agent=a1\".",
1872
+ "required": false
1873
+ },
1874
+ {
1875
+ "name": "limit",
1876
+ "key": "limit",
1877
+ "type": "integer",
1878
+ "multiple": false,
1879
+ "description": "At most this many (default 50).",
1880
+ "required": false
1881
+ },
1882
+ {
1883
+ "name": "cursor",
1884
+ "key": "cursor",
1885
+ "type": "string",
1886
+ "multiple": false,
1887
+ "description": "Where the next page starts: the cursor the last page ended with.",
1888
+ "required": false
1889
+ }
1890
+ ],
1891
+ "examples": [
1892
+ {
1893
+ "run": "machine list --status running",
1894
+ "about": "The ones you can use"
1895
+ }
1896
+ ],
1897
+ "readOnly": true,
1898
+ "destructive": false
1899
+ },
1900
+ {
1901
+ "name": "machine runtimes",
1902
+ "tool": "list_runtimes",
1903
+ "route": "GET /api/v1/runtimes",
1904
+ "summary": "Runtimes",
1905
+ "description": "What can run machines on this server (the default first) and what each can do: create_machine takes one as runtime.",
1906
+ "positional": [],
1907
+ "flags": [],
1908
+ "examples": [
1909
+ {
1910
+ "run": "machine runtimes",
1911
+ "about": "What can run a machine here"
1912
+ }
1913
+ ],
1914
+ "readOnly": true,
1915
+ "destructive": false
1916
+ },
1917
+ {
1918
+ "name": "machine stats",
1919
+ "tool": "machine_stats",
1920
+ "route": "GET /api/v1/machines/{machine}/stats",
1921
+ "summary": "Check a machine",
1922
+ "description": "What a machine is doing right now: CPU, memory, disk, network and the busiest processes. Use it to tell a stuck command from a busy one (a long install shows dpkg or a compiler near 100%), or to find what fills memory.",
1923
+ "positional": [
1924
+ "machine"
1925
+ ],
1926
+ "flags": [
1927
+ {
1928
+ "name": "machine",
1929
+ "key": "machine",
1930
+ "type": "string",
1931
+ "multiple": false,
1932
+ "description": "The machine’s id (mch_…), from create_machine or list_machines.",
1933
+ "required": true
1934
+ },
1935
+ {
1936
+ "name": "processes",
1937
+ "key": "processes",
1938
+ "type": "integer",
1939
+ "multiple": false,
1940
+ "description": "How many processes to list (default 20).",
1941
+ "required": false
1942
+ }
1943
+ ],
1944
+ "examples": [
1945
+ {
1946
+ "run": "machine stats <machine>",
1947
+ "about": "CPU, memory and the busiest processes"
1948
+ }
1949
+ ],
1950
+ "readOnly": true,
1951
+ "destructive": false
1952
+ },
1953
+ {
1954
+ "name": "machine update",
1955
+ "tool": "update_machine",
1956
+ "route": "PATCH /api/v1/machines/{machine}",
1957
+ "summary": "Change a machine",
1958
+ "description": "Renames a machine, sets labels (null removes one), or changes how long it may sit unused (ttlMinutes, from now).",
1959
+ "positional": [
1960
+ "machine"
1961
+ ],
1962
+ "flags": [
1963
+ {
1964
+ "name": "machine",
1965
+ "key": "machine",
1966
+ "type": "string",
1967
+ "multiple": false,
1968
+ "description": "The machine’s id (mch_…), from create_machine or list_machines.",
1969
+ "required": true
1970
+ },
1971
+ {
1972
+ "name": "name",
1973
+ "key": "name",
1974
+ "type": "string",
1975
+ "multiple": false,
1976
+ "description": "A new name, or null to drop it.",
1977
+ "required": false
1978
+ },
1979
+ {
1980
+ "name": "labels",
1981
+ "key": "labels",
1982
+ "type": "object",
1983
+ "multiple": false,
1984
+ "description": "Labels to set; null removes one; the rest stay.",
1985
+ "required": false
1986
+ },
1987
+ {
1988
+ "name": "ttl-minutes",
1989
+ "key": "ttlMinutes",
1990
+ "type": "integer",
1991
+ "multiple": false,
1992
+ "description": "Idle minutes allowed from now on.",
1993
+ "required": false
1994
+ }
1995
+ ],
1996
+ "examples": [
1997
+ {
1998
+ "run": "machine update <machine> --name api-tests",
1999
+ "about": "Rename it"
2000
+ }
2001
+ ],
2002
+ "readOnly": false,
2003
+ "destructive": false
2004
+ },
2005
+ {
2006
+ "name": "machine view",
2007
+ "tool": "get_machine",
2008
+ "route": "GET /api/v1/machines/{machine}",
2009
+ "summary": "One machine",
2010
+ "description": "A machine’s status, why it ended if it did, and its free memory while it runs.",
2011
+ "positional": [
2012
+ "machine"
2013
+ ],
2014
+ "flags": [
2015
+ {
2016
+ "name": "machine",
2017
+ "key": "machine",
2018
+ "type": "string",
2019
+ "multiple": false,
2020
+ "description": "The machine’s id (mch_…), from create_machine or list_machines.",
2021
+ "required": true
2022
+ }
2023
+ ],
2024
+ "examples": [
2025
+ {
2026
+ "run": "machine view <machine>",
2027
+ "about": "Its status and memory"
2028
+ }
2029
+ ],
2030
+ "readOnly": true,
2031
+ "destructive": false
2032
+ },
2033
+ {
2034
+ "name": "network set",
2035
+ "tool": "set_network",
2036
+ "route": "PATCH /api/v1/machines/{id}",
2037
+ "summary": "Change what a machine may reach",
2038
+ "description": "Sets a running machine’s network rules, from its next connection: mode open (the internet, not the LAN) or allowlist (only what allow names), allow and deny rules like \"github.com\", \"*.pypi.org\", \"10.0.0.0/8\", \"1.1.1.1:53\".",
2039
+ "positional": [
2040
+ "machine"
2041
+ ],
2042
+ "flags": [
2043
+ {
2044
+ "name": "machine",
2045
+ "key": "machine",
2046
+ "type": "string",
2047
+ "multiple": false,
2048
+ "description": "The machine’s id (mch_…), from create_machine or list_machines.",
2049
+ "required": true
2050
+ },
2051
+ {
2052
+ "name": "mode",
2053
+ "key": "mode",
2054
+ "type": "string",
2055
+ "multiple": false,
2056
+ "enum": [
2057
+ "open",
2058
+ "allowlist"
2059
+ ],
2060
+ "description": "open or allowlist.",
2061
+ "required": true
2062
+ },
2063
+ {
2064
+ "name": "allow",
2065
+ "key": "allow",
2066
+ "type": "string",
2067
+ "multiple": true,
2068
+ "description": "What it may reach.",
2069
+ "required": false
2070
+ },
2071
+ {
2072
+ "name": "deny",
2073
+ "key": "deny",
2074
+ "type": "string",
2075
+ "multiple": true,
2076
+ "description": "What it may never reach.",
2077
+ "required": false
2078
+ }
2079
+ ],
2080
+ "examples": [
2081
+ {
2082
+ "run": "network set <machine> --mode allowlist --allow \"*.github.com\"",
2083
+ "about": "Only GitHub"
2084
+ }
2085
+ ],
2086
+ "readOnly": false,
2087
+ "destructive": false
2088
+ },
2089
+ {
2090
+ "name": "network view",
2091
+ "tool": "get_network",
2092
+ "route": "GET /api/v1/machines/{machine}/network",
2093
+ "summary": "A machine’s network",
2094
+ "description": "What a machine may reach, and the connections it was refused lately with the change that would allow each. A refused connection looks like \"connection reset\" (wasm) or a 403 from its proxy (container) inside the machine: check here when a download or API call fails.",
2095
+ "positional": [
2096
+ "machine"
2097
+ ],
2098
+ "flags": [
2099
+ {
2100
+ "name": "machine",
2101
+ "key": "machine",
2102
+ "type": "string",
2103
+ "multiple": false,
2104
+ "description": "The machine’s id (mch_…), from create_machine or list_machines.",
2105
+ "required": true
2106
+ }
2107
+ ],
2108
+ "examples": [
2109
+ {
2110
+ "run": "network view <machine>",
2111
+ "about": "Its rules and what was refused"
2112
+ }
2113
+ ],
2114
+ "readOnly": true,
2115
+ "destructive": false
2116
+ },
2117
+ {
2118
+ "name": "port fetch",
2119
+ "tool": "fetch_port",
2120
+ "route": "POST /api/v1/machines/{machine}/ports/{port}/fetch",
2121
+ "summary": "Call a server in a machine",
2122
+ "description": "Sends an HTTP request to a server running inside a machine (e.g. a dev server you started on port 8000) and shows its answer. Start the server with run_command and timeoutSeconds 0 first.",
2123
+ "positional": [
2124
+ "machine",
2125
+ "port"
2126
+ ],
2127
+ "flags": [
2128
+ {
2129
+ "name": "machine",
2130
+ "key": "machine",
2131
+ "type": "string",
2132
+ "multiple": false,
2133
+ "description": "The machine’s id (mch_…), from create_machine or list_machines.",
2134
+ "required": true
2135
+ },
2136
+ {
2137
+ "name": "port",
2138
+ "key": "port",
2139
+ "type": "integer",
2140
+ "multiple": false,
2141
+ "description": "The port the server listens on.",
2142
+ "required": true
2143
+ },
2144
+ {
2145
+ "name": "path",
2146
+ "key": "path",
2147
+ "type": "string",
2148
+ "multiple": false,
2149
+ "description": "Path and query (default /).",
2150
+ "required": false
2151
+ },
2152
+ {
2153
+ "name": "method",
2154
+ "key": "method",
2155
+ "type": "string",
2156
+ "multiple": false,
2157
+ "enum": [
2158
+ "GET",
2159
+ "POST",
2160
+ "PUT",
2161
+ "PATCH",
2162
+ "DELETE",
2163
+ "HEAD"
2164
+ ],
2165
+ "description": "Default GET.",
2166
+ "required": false
2167
+ },
2168
+ {
2169
+ "name": "headers",
2170
+ "key": "headers",
2171
+ "type": "object",
2172
+ "multiple": false,
2173
+ "description": "Request headers.",
2174
+ "required": false
2175
+ },
2176
+ {
2177
+ "name": "body",
2178
+ "key": "body",
2179
+ "type": "string",
2180
+ "multiple": false,
2181
+ "description": "Request body.",
2182
+ "required": false
2183
+ }
2184
+ ],
2185
+ "examples": [
2186
+ {
2187
+ "run": "port fetch <machine> --port 8000 --path /",
2188
+ "about": "GET a dev server"
2189
+ }
2190
+ ],
2191
+ "readOnly": false,
2192
+ "destructive": false
2193
+ },
2194
+ {
2195
+ "name": "port list",
2196
+ "tool": "list_ports",
2197
+ "route": "GET /api/v1/machines/{machine}/ports",
2198
+ "summary": "Ports a machine listens on",
2199
+ "description": "Every TCP port a server listens on inside a machine, which process holds it, and whether fetch_port reaches it.",
2200
+ "positional": [
2201
+ "machine"
2202
+ ],
2203
+ "flags": [
2204
+ {
2205
+ "name": "machine",
2206
+ "key": "machine",
2207
+ "type": "string",
2208
+ "multiple": false,
2209
+ "description": "The machine’s id (mch_…), from create_machine or list_machines.",
2210
+ "required": true
2211
+ }
2212
+ ],
2213
+ "examples": [
2214
+ {
2215
+ "run": "port list <machine>",
2216
+ "about": "What servers listen"
2217
+ }
2218
+ ],
2219
+ "readOnly": true,
2220
+ "destructive": false
2221
+ },
2222
+ {
2223
+ "name": "port share",
2224
+ "tool": "share_port",
2225
+ "route": "POST /api/v1/machines/{machine}/ports/{port}/share",
2226
+ "summary": "Share a port at a public URL",
2227
+ "description": "Gives a server inside a machine a public URL anyone can open (a browser, curl, a webhook sender): for a preview, a demo, or a callback. Start the server first (run_command with timeoutSeconds 0, then wait_for_port), bound to 0.0.0.0.",
2228
+ "positional": [
2229
+ "machine",
2230
+ "port"
2231
+ ],
2232
+ "flags": [
2233
+ {
2234
+ "name": "machine",
2235
+ "key": "machine",
2236
+ "type": "string",
2237
+ "multiple": false,
2238
+ "description": "The machine’s id (mch_…), from create_machine or list_machines.",
2239
+ "required": true
2240
+ },
2241
+ {
2242
+ "name": "port",
2243
+ "key": "port",
2244
+ "type": "integer",
2245
+ "multiple": false,
2246
+ "description": "The port it listens on.",
2247
+ "required": true
2248
+ }
2249
+ ],
2250
+ "examples": [
2251
+ {
2252
+ "run": "port share <machine> --port 8000",
2253
+ "about": "Its public URL"
2254
+ }
2255
+ ],
2256
+ "readOnly": false,
2257
+ "destructive": false
2258
+ },
2259
+ {
2260
+ "name": "port unshare",
2261
+ "tool": "unshare_port",
2262
+ "route": "DELETE /api/v1/machines/{machine}/ports/{port}/share",
2263
+ "summary": "Stop sharing a port",
2264
+ "description": "Ends a port’s public URL at once.",
2265
+ "positional": [
2266
+ "machine",
2267
+ "port"
2268
+ ],
2269
+ "flags": [
2270
+ {
2271
+ "name": "machine",
2272
+ "key": "machine",
2273
+ "type": "string",
2274
+ "multiple": false,
2275
+ "description": "The machine’s id (mch_…), from create_machine or list_machines.",
2276
+ "required": true
2277
+ },
2278
+ {
2279
+ "name": "port",
2280
+ "key": "port",
2281
+ "type": "integer",
2282
+ "multiple": false,
2283
+ "description": "The port that was shared.",
2284
+ "required": true
2285
+ }
2286
+ ],
2287
+ "examples": [
2288
+ {
2289
+ "run": "port unshare <machine> --port 8000",
2290
+ "about": "End its URL"
2291
+ }
2292
+ ],
2293
+ "readOnly": false,
2294
+ "destructive": true
2295
+ },
2296
+ {
2297
+ "name": "port wait",
2298
+ "tool": "wait_for_port",
2299
+ "route": "GET /api/v1/machines/{machine}/ports/{port}",
2300
+ "summary": "Wait for a server to be ready",
2301
+ "description": "Waits (up to 25 s) until a server listens on a port inside a machine, and answers the moment it does. Call it after starting a server with run_command (timeoutSeconds 0, wait 0), before fetch_port.",
2302
+ "positional": [
2303
+ "machine",
2304
+ "port"
2305
+ ],
2306
+ "flags": [
2307
+ {
2308
+ "name": "machine",
2309
+ "key": "machine",
2310
+ "type": "string",
2311
+ "multiple": false,
2312
+ "description": "The machine’s id (mch_…), from create_machine or list_machines.",
2313
+ "required": true
2314
+ },
2315
+ {
2316
+ "name": "port",
2317
+ "key": "port",
2318
+ "type": "integer",
2319
+ "multiple": false,
2320
+ "description": "The port the server will listen on.",
2321
+ "required": true
2322
+ },
2323
+ {
2324
+ "name": "wait",
2325
+ "key": "wait",
2326
+ "type": "integer",
2327
+ "multiple": false,
2328
+ "description": "Seconds to wait (default 20).",
2329
+ "required": false
2330
+ }
2331
+ ],
2332
+ "examples": [
2333
+ {
2334
+ "run": "port wait <machine> --port 8000",
2335
+ "about": "Until the dev server is up"
2336
+ }
2337
+ ],
2338
+ "readOnly": true,
2339
+ "destructive": false
2340
+ },
2341
+ {
2342
+ "name": "snapshot delete",
2343
+ "tool": "delete_snapshot",
2344
+ "route": "DELETE /api/v1/snapshots/{id}",
2345
+ "summary": "Delete a snapshot",
2346
+ "description": "Deletes a snapshot for good.",
2347
+ "positional": [
2348
+ "id"
2349
+ ],
2350
+ "flags": [
2351
+ {
2352
+ "name": "id",
2353
+ "key": "id",
2354
+ "type": "string",
2355
+ "multiple": false,
2356
+ "description": "The snapshot’s id (snp_…).",
2357
+ "required": true
2358
+ }
2359
+ ],
2360
+ "examples": [
2361
+ {
2362
+ "run": "snapshot delete <id> --yes",
2363
+ "about": "Delete it"
2364
+ }
2365
+ ],
2366
+ "readOnly": false,
2367
+ "destructive": true
2368
+ },
2369
+ {
2370
+ "name": "snapshot list",
2371
+ "tool": "list_snapshots",
2372
+ "route": "GET /api/v1/snapshots",
2373
+ "summary": "Snapshots",
2374
+ "description": "Saved machines you can start copies of, the newest first.",
2375
+ "positional": [],
2376
+ "flags": [
2377
+ {
2378
+ "name": "limit",
2379
+ "key": "limit",
2380
+ "type": "integer",
2381
+ "multiple": false,
2382
+ "description": "At most this many (default 50).",
2383
+ "required": false
2384
+ },
2385
+ {
2386
+ "name": "cursor",
2387
+ "key": "cursor",
2388
+ "type": "string",
2389
+ "multiple": false,
2390
+ "description": "Where the next page starts.",
2391
+ "required": false
2392
+ }
2393
+ ],
2394
+ "examples": [
2395
+ {
2396
+ "run": "snapshot list",
2397
+ "about": "What you can start from"
2398
+ }
2399
+ ],
2400
+ "readOnly": true,
2401
+ "destructive": false
2402
+ },
2403
+ {
2404
+ "name": "snapshot save",
2405
+ "tool": "save_snapshot",
2406
+ "route": "POST /api/v1/machines/{machine}/snapshots",
2407
+ "summary": "Save a machine",
2408
+ "description": "Saves a running machine as a snapshot (its files, installed tools, everything in memory). Later, create_machine with fromSnapshot starts a ready copy in a fraction of a second, instead of installing again.",
2409
+ "positional": [
2410
+ "machine"
2411
+ ],
2412
+ "flags": [
2413
+ {
2414
+ "name": "machine",
2415
+ "key": "machine",
2416
+ "type": "string",
2417
+ "multiple": false,
2418
+ "description": "The machine’s id (mch_…), from create_machine or list_machines.",
2419
+ "required": true
2420
+ },
2421
+ {
2422
+ "name": "name",
2423
+ "key": "name",
2424
+ "type": "string",
2425
+ "multiple": false,
2426
+ "description": "What it is, e.g. \"python-and-git\".",
2427
+ "required": true
2428
+ }
2429
+ ],
2430
+ "examples": [
2431
+ {
2432
+ "run": "snapshot save <machine> --name base",
2433
+ "about": "Save it as a starting point"
2434
+ }
2435
+ ],
2436
+ "readOnly": false,
2437
+ "destructive": false
2438
+ },
2439
+ {
2440
+ "name": "telemetry view",
2441
+ "tool": "get_telemetry",
2442
+ "route": "GET /api/telemetry",
2443
+ "summary": "Usage report",
2444
+ "description": "Whether this deployment sends its daily anonymous usage report, and exactly the body it would send: coarse ranges and yes/no answers, never ids or text.",
2445
+ "positional": [],
2446
+ "flags": [],
2447
+ "examples": [
2448
+ {
2449
+ "run": "telemetry view",
2450
+ "about": "Whether the report is on, and what it sends"
2451
+ }
2452
+ ],
2453
+ "readOnly": true,
2454
+ "destructive": false
2455
+ },
2456
+ {
2457
+ "name": "template create",
2458
+ "tool": "create_template",
2459
+ "route": "POST /api/v1/templates",
2460
+ "summary": "Make a template",
2461
+ "description": "Builds a template machines start from, from an image (\"python:3.13-slim\", \"node:22\") or a Dockerfile (FROM, RUN, ENV): tools installed once, every machine ready in a second. Builds in the background; get_template with wait 25 until ready, then create_machine with template.",
2462
+ "positional": [],
2463
+ "flags": [
2464
+ {
2465
+ "name": "name",
2466
+ "key": "name",
2467
+ "type": "string",
2468
+ "multiple": false,
2469
+ "description": "Its name: lower-case letters, digits and dashes.",
2470
+ "required": true
2471
+ },
2472
+ {
2473
+ "name": "image",
2474
+ "key": "image",
2475
+ "type": "string",
2476
+ "multiple": false,
2477
+ "description": "An image to start from (Debian, Ubuntu or Alpine based).",
2478
+ "required": false
2479
+ },
2480
+ {
2481
+ "name": "dockerfile",
2482
+ "key": "dockerfile",
2483
+ "type": "string",
2484
+ "multiple": false,
2485
+ "description": "A Dockerfile instead: FROM a Debian, Ubuntu or Alpine image, then RUN and ENV.",
2486
+ "required": false
2487
+ }
2488
+ ],
2489
+ "examples": [
2490
+ {
2491
+ "run": "template create --name py --image python:3.13-slim",
2492
+ "about": "Python ready"
2493
+ }
2494
+ ],
2495
+ "readOnly": false,
2496
+ "destructive": false
2497
+ },
2498
+ {
2499
+ "name": "template delete",
2500
+ "tool": "delete_template",
2501
+ "route": "DELETE /api/v1/templates/{name}",
2502
+ "summary": "Delete a template",
2503
+ "description": "No new machine starts from it; running ones go on.",
2504
+ "positional": [
2505
+ "name"
2506
+ ],
2507
+ "flags": [
2508
+ {
2509
+ "name": "name",
2510
+ "key": "name",
2511
+ "type": "string",
2512
+ "multiple": false,
2513
+ "description": "The template’s name.",
2514
+ "required": true
2515
+ }
2516
+ ],
2517
+ "examples": [
2518
+ {
2519
+ "run": "template delete py",
2520
+ "about": "Remove it"
2521
+ }
2522
+ ],
2523
+ "readOnly": false,
2524
+ "destructive": true
2525
+ },
2526
+ {
2527
+ "name": "template list",
2528
+ "tool": "list_templates",
2529
+ "route": "GET /api/v1/templates",
2530
+ "summary": "Templates",
2531
+ "description": "The templates machines can start from (create_machine with template).",
2532
+ "positional": [],
2533
+ "flags": [],
2534
+ "examples": [
2535
+ {
2536
+ "run": "template list",
2537
+ "about": "What machines can start from"
2538
+ }
2539
+ ],
2540
+ "readOnly": true,
2541
+ "destructive": false
2542
+ },
2543
+ {
2544
+ "name": "template view",
2545
+ "tool": "get_template",
2546
+ "route": "GET /api/v1/templates/{name}",
2547
+ "summary": "One template",
2548
+ "description": "A template and how its build went; with wait it answers as soon as a build in progress ends.",
2549
+ "positional": [
2550
+ "name"
2551
+ ],
2552
+ "flags": [
2553
+ {
2554
+ "name": "name",
2555
+ "key": "name",
2556
+ "type": "string",
2557
+ "multiple": false,
2558
+ "description": "The template’s name.",
2559
+ "required": true
2560
+ },
2561
+ {
2562
+ "name": "wait",
2563
+ "key": "wait",
2564
+ "type": "integer",
2565
+ "multiple": false,
2566
+ "description": "Seconds to wait for a build in progress (at most 25).",
2567
+ "required": false
2568
+ }
2569
+ ],
2570
+ "examples": [
2571
+ {
2572
+ "run": "template view py --wait 25",
2573
+ "about": "Wait for its build"
2574
+ }
2575
+ ],
2576
+ "readOnly": true,
2577
+ "destructive": false
2578
+ },
2579
+ {
2580
+ "name": "update apply",
2581
+ "tool": "update_loaner",
2582
+ "route": "POST /api/v1/updates/requests",
2583
+ "summary": "Update Loaner",
2584
+ "description": "Asks for an update to a newer Loaner version (the newest known when version is left out). The updater checks the release’s signature, starts it, and puts the old one back if it doesn’t come up; follow with get_updates.",
2585
+ "positional": [],
2586
+ "flags": [
2587
+ {
2588
+ "name": "version",
2589
+ "key": "version",
2590
+ "type": "string",
2591
+ "multiple": false,
2592
+ "description": "The version to move to, as 1.2.3.",
2593
+ "required": false
2594
+ }
2595
+ ],
2596
+ "examples": [
2597
+ {
2598
+ "run": "update apply --version 0.3.0",
2599
+ "about": "Move to 0.3.0"
2600
+ }
2601
+ ],
2602
+ "readOnly": false,
2603
+ "destructive": false
2604
+ },
2605
+ {
2606
+ "name": "update status",
2607
+ "tool": "get_updates",
2608
+ "route": "GET /api/v1/updates",
2609
+ "summary": "Updates",
2610
+ "description": "The Loaner version running, the newest release the last check named, and how an update happens here (needs a key that reaches everything).",
2611
+ "positional": [],
2612
+ "flags": [],
2613
+ "examples": [
2614
+ {
2615
+ "run": "update status",
2616
+ "about": "What runs and what is newest"
2617
+ }
2618
+ ],
2619
+ "readOnly": true,
2620
+ "destructive": false
2621
+ },
2622
+ {
2623
+ "name": "webhook create",
2624
+ "tool": "create_webhook",
2625
+ "route": "POST /api/v1/webhooks",
2626
+ "summary": "Post events to a URL",
2627
+ "description": "Subscribes a URL to events (machines stopping, commands ending…): each is POSTed as signed JSON within seconds. Answers its secret once, to check signatures. For a script or service to hear about work as it ends; an agent can follow events itself with wait_for_events. Part of the feature Webhooks (`webhooks`), which an owner can switch off: then it answers 403 feature_disabled.",
2628
+ "positional": [],
2629
+ "flags": [
2630
+ {
2631
+ "name": "url",
2632
+ "key": "url",
2633
+ "type": "string",
2634
+ "multiple": false,
2635
+ "description": "Where events are posted.",
2636
+ "required": true
2637
+ },
2638
+ {
2639
+ "name": "types",
2640
+ "key": "types",
2641
+ "type": "string",
2642
+ "multiple": true,
2643
+ "enum": [
2644
+ "machine.created",
2645
+ "machine.running",
2646
+ "machine.expiring",
2647
+ "machine.disk_low",
2648
+ "machine.stopping",
2649
+ "machine.stopped",
2650
+ "machine.forked",
2651
+ "machine.adopted",
2652
+ "command.started",
2653
+ "command.ended",
2654
+ "snapshot.saved",
2655
+ "port.opened",
2656
+ "network.denied",
2657
+ "webhook.disabled"
2658
+ ],
2659
+ "description": "Only these types (default every event).",
2660
+ "required": false
2661
+ }
2662
+ ],
2663
+ "examples": [
2664
+ {
2665
+ "run": "webhook create --url https://example.com/hook --types command.ended",
2666
+ "about": "Hear when commands end"
2667
+ }
2668
+ ],
2669
+ "readOnly": false,
2670
+ "destructive": false
2671
+ },
2672
+ {
2673
+ "name": "webhook delete",
2674
+ "tool": "delete_webhook",
2675
+ "route": "DELETE /api/v1/webhooks/{id}",
2676
+ "summary": "Delete a webhook",
2677
+ "description": "Stops posting events to a URL. Part of the feature Webhooks (`webhooks`), which an owner can switch off: then it answers 403 feature_disabled.",
2678
+ "positional": [
2679
+ "id"
2680
+ ],
2681
+ "flags": [
2682
+ {
2683
+ "name": "id",
2684
+ "key": "id",
2685
+ "type": "string",
2686
+ "multiple": false,
2687
+ "description": "The webhook’s id (whk_…).",
2688
+ "required": true
2689
+ }
2690
+ ],
2691
+ "examples": [
2692
+ {
2693
+ "run": "webhook delete <id> --yes",
2694
+ "about": "Stop posting to it"
2695
+ }
2696
+ ],
2697
+ "readOnly": false,
2698
+ "destructive": true
2699
+ },
2700
+ {
2701
+ "name": "webhook deliveries",
2702
+ "tool": "webhook_deliveries",
2703
+ "route": "GET /api/v1/webhooks/{id}/deliveries",
2704
+ "summary": "A webhook’s deliveries",
2705
+ "description": "The last events sent to a webhook: delivered, still being tried (and when next), or failed with why. Part of the feature Webhooks (`webhooks`), which an owner can switch off: then it answers 403 feature_disabled.",
2706
+ "positional": [
2707
+ "id"
2708
+ ],
2709
+ "flags": [
2710
+ {
2711
+ "name": "id",
2712
+ "key": "id",
2713
+ "type": "string",
2714
+ "multiple": false,
2715
+ "description": "The webhook’s id (whk_…).",
2716
+ "required": true
2717
+ }
2718
+ ],
2719
+ "examples": [
2720
+ {
2721
+ "run": "webhook deliveries <id>",
2722
+ "about": "What it was sent"
2723
+ }
2724
+ ],
2725
+ "readOnly": true,
2726
+ "destructive": false
2727
+ },
2728
+ {
2729
+ "name": "webhook list",
2730
+ "tool": "list_webhooks",
2731
+ "route": "GET /api/v1/webhooks",
2732
+ "summary": "Webhooks",
2733
+ "description": "Every webhook, and whether it is still on. Part of the feature Webhooks (`webhooks`), which an owner can switch off: then it answers 403 feature_disabled.",
2734
+ "positional": [],
2735
+ "flags": [],
2736
+ "examples": [
2737
+ {
2738
+ "run": "webhook list",
2739
+ "about": "Where events go"
2740
+ }
2741
+ ],
2742
+ "readOnly": true,
2743
+ "destructive": false
2744
+ }
2745
+ ]
2746
+ }