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