@exedev/sdk 0.1.0 → 0.3.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.
@@ -1,31 +1,46 @@
1
- import type { CommandResults } from "./types.js";
2
- /** Options every command method accepts. */
1
+ import { Transport } from "./client.js";
2
+ import type { ExedevOptions, SSHOptions, SSHResult } from "./client.js";
3
+ import type { CommandResults, RmResponse } from "./types.js";
3
4
  export interface CallOptions {
4
- /** Aborts the request. */
5
5
  signal?: AbortSignal;
6
6
  }
7
- /**
8
- * The JSON a command returns: the type CommandResults declares for its path,
9
- * or unknown.
10
- */
7
+ export interface WaitOptions extends CallOptions {
8
+ /**
9
+ * ssh (the default): the VM runs commands. setup: also, its setup script
10
+ * (exeuntu's exe-setup.service) has finished, and succeeded. Both need ssh permission.
11
+ */
12
+ waitUntil?: "ssh" | "setup";
13
+ /** Deadline in milliseconds, including requests and backoff. Default 60,000; 600,000 for setup. */
14
+ timeoutMs?: number;
15
+ }
16
+ export interface ReadyOptions extends Omit<WaitOptions, "waitUntil"> {
17
+ /** Default ssh. Use created to return without probing (and without ssh permission). */
18
+ waitUntil?: "ssh" | "setup" | "created";
19
+ }
20
+ export interface VMInfo {
21
+ readonly name: string;
22
+ readonly tags: readonly string[];
23
+ readonly sshDest?: string;
24
+ readonly httpsUrl?: string;
25
+ readonly status?: string;
26
+ readonly region?: string;
27
+ readonly comment?: string;
28
+ readonly createdAt?: string;
29
+ /** Why new's --prompt did not reach Shelley, when it did not. Setup scripts report through waitUntil: "setup". */
30
+ readonly promptError?: string;
31
+ }
11
32
  export type CommandResult<P extends string> = P extends keyof CommandResults ? CommandResults[P] : unknown;
12
- /**
13
- * How Commands.run writes an option on the command line: bool as --name or
14
- * --name=false, number and string as --name=value, and repeated as one
15
- * --name=value per element.
16
- */
17
33
  export type FlagKind = "bool" | "number" | "string" | "repeated";
18
- /** A positional argument as passed to Commands.run; arrays are spread. */
19
34
  export type Arg = string | readonly string[] | undefined;
20
- /** Options for {@link Commands.ls}. */
35
+ /** Options for {@link ExedevClient.ls}. */
21
36
  export interface LsOptions extends CallOptions {
22
37
  /** group VMs by none|tag|region|type (default: none) */
23
- group?: "none" | "tag" | "region";
38
+ group?: "none" | "tag" | "region" | "type";
24
39
  /** show detailed information */
25
40
  l?: boolean;
26
41
  }
27
- /** Options for {@link Commands.new}. */
28
- export interface NewOptions extends CallOptions {
42
+ /** Options for {@link ExedevClient.new}. */
43
+ export interface NewOptions extends ReadyOptions {
29
44
  /** short note about the VM (max 200 bytes) */
30
45
  comment?: string;
31
46
  /** number of CPUs (default 2; run 'billing plan' for plan limits) */
@@ -61,13 +76,15 @@ export interface NewOptions extends CallOptions {
61
76
  /** tag to add to the VM (can be specified multiple times or comma-separated) */
62
77
  tag?: string | readonly string[];
63
78
  }
64
- /** Options for {@link Commands.tag}. */
79
+ /** Options for {@link VM.tag}. */
65
80
  export interface TagOptions extends CallOptions {
66
81
  /** delete tag */
67
82
  d?: boolean;
68
83
  }
69
- /** Options for {@link Commands.cp}. */
70
- export interface CpOptions extends CallOptions {
84
+ /** Options for {@link VM.cp}. */
85
+ export interface CpOptions extends ReadyOptions {
86
+ /** Name of the copy; omitted to generate one. */
87
+ name?: string;
71
88
  /** copy tags from source VM (use --copy-tags=false to disable) (default: true) */
72
89
  "copy-tags"?: boolean;
73
90
  /** number of CPUs */
@@ -83,7 +100,7 @@ export interface CpOptions extends CallOptions {
83
100
  /** create the copy as a standalone VM with its own reserved capacity (requires a plan with standalone VMs and team approval) */
84
101
  standalone?: boolean;
85
102
  }
86
- /** Options for {@link Commands.resize}. */
103
+ /** Options for {@link VM.resize}. */
87
104
  export interface ResizeOptions extends CallOptions {
88
105
  /** number of CPUs */
89
106
  cpu?: number;
@@ -92,22 +109,22 @@ export interface ResizeOptions extends CallOptions {
92
109
  /** memory allocation (e.g., 4, 4GB, 8G) */
93
110
  memory?: string;
94
111
  }
95
- /** Options for {@link Commands.domainAdd}. */
112
+ /** Options for {@link VM.domainAdd}. */
96
113
  export interface DomainAddOptions extends CallOptions {
97
114
  /** issue a wildcard (*.<parent>) certificate via DNS-01 delegation */
98
115
  wildcard?: boolean;
99
116
  }
100
- /** Options for {@link Commands.domainLs}. */
117
+ /** Options for {@link ExedevClient.domainLs}. */
101
118
  export interface DomainLsOptions extends CallOptions {
102
119
  /** list domains across all your VMs */
103
120
  a?: boolean;
104
121
  }
105
- /** Options for {@link Commands.shareShow}. */
122
+ /** Options for {@link VM.shareShow}. */
106
123
  export interface ShareShowOptions extends CallOptions {
107
124
  /** show QR code for the URL */
108
125
  qr?: boolean;
109
126
  }
110
- /** Options for {@link Commands.shareAdd}. */
127
+ /** Options for {@link VM.shareAdd}. */
111
128
  export interface ShareAddOptions extends CallOptions {
112
129
  /** message to include in share invitation */
113
130
  message?: string;
@@ -116,27 +133,27 @@ export interface ShareAddOptions extends CallOptions {
116
133
  /** grant/revoke shell (SSH, Terminal, Shelley) access instead of web-only */
117
134
  root?: boolean;
118
135
  }
119
- /** Options for {@link Commands.shareRemove}. */
136
+ /** Options for {@link VM.shareRemove}. */
120
137
  export interface ShareRemoveOptions extends CallOptions {
121
138
  /** grant/revoke shell (SSH, Terminal, Shelley) access instead of web-only */
122
139
  root?: boolean;
123
140
  }
124
- /** Options for {@link Commands.shareAddLink}. */
141
+ /** Options for {@link VM.shareAddLink}. */
125
142
  export interface ShareAddLinkOptions extends CallOptions {
126
143
  /** show QR code for the URL */
127
144
  qr?: boolean;
128
145
  }
129
- /** Options for {@link Commands.shareReceiveEmail}. */
146
+ /** Options for {@link VM.shareReceiveEmail}. */
130
147
  export interface ShareReceiveEmailOptions extends CallOptions {
131
148
  /** restrict who the VM may email: all|known|owner|none */
132
149
  "reply-policy"?: string;
133
150
  }
134
- /** Options for {@link Commands.sshKeyAdd}. */
151
+ /** Options for {@link ExedevClient.sshKeyAdd}. */
135
152
  export interface SshKeyAddOptions extends CallOptions {
136
153
  /** scope key to VMs with this tag */
137
154
  tag?: string;
138
155
  }
139
- /** Options for {@link Commands.sshKeyGenerateApiKey}. */
156
+ /** Options for {@link ExedevClient.sshKeyGenerateApiKey}. */
140
157
  export interface SshKeyGenerateApiKeyOptions extends CallOptions {
141
158
  /** comma-separated list of allowed commands (empty = defaults) */
142
159
  cmds?: string;
@@ -147,12 +164,12 @@ export interface SshKeyGenerateApiKeyOptions extends CallOptions {
147
164
  /** scope key to a VM (authenticates to its HTTPS endpoints instead of exe.dev commands) */
148
165
  vm?: string;
149
166
  }
150
- /** Options for {@link Commands.integrationsList}. */
167
+ /** Options for {@link ExedevClient.integrationsList}. */
151
168
  export interface IntegrationsListOptions extends CallOptions {
152
169
  /** include per-VM usage (lastUsedAt, usedByVMs); JSON only */
153
170
  usage?: boolean;
154
171
  }
155
- /** Options for {@link Commands.integrationsSetupGithub}. */
172
+ /** Options for {@link ExedevClient.integrationsSetupGithub}. */
156
173
  export interface IntegrationsSetupGithubOptions extends CallOptions {
157
174
  /** disconnect GitHub account */
158
175
  d?: boolean;
@@ -163,7 +180,7 @@ export interface IntegrationsSetupGithubOptions extends CallOptions {
163
180
  /** verify GitHub connections are working */
164
181
  verify?: boolean;
165
182
  }
166
- /** Options for {@link Commands.integrationsSetupChatgpt}. */
183
+ /** Options for {@link ExedevClient.integrationsSetupChatgpt}. */
167
184
  export interface IntegrationsSetupChatgptOptions extends CallOptions {
168
185
  /** disconnect ChatGPT account */
169
186
  d?: boolean;
@@ -176,7 +193,7 @@ export interface IntegrationsSetupChatgptOptions extends CallOptions {
176
193
  /** verify ChatGPT connections are working */
177
194
  verify?: boolean;
178
195
  }
179
- /** Options for {@link Commands.integrationsAdd}. */
196
+ /** Options for {@link ExedevClient.integrationsAdd}. */
180
197
  export interface IntegrationsAddOptions extends CallOptions {
181
198
  /** authenticate as your GitHub user instead of the exe.dev app (github only); pushes and API calls are attributed to your GitHub account */
182
199
  "act-as-user"?: boolean;
@@ -213,17 +230,17 @@ export interface IntegrationsAddOptions extends CallOptions {
213
230
  /** create as a team integration */
214
231
  team?: boolean;
215
232
  }
216
- /** Options for {@link Commands.integrationsRemove}. */
233
+ /** Options for {@link ExedevClient.integrationsRemove}. */
217
234
  export interface IntegrationsRemoveOptions extends CallOptions {
218
235
  /** operate on a team integration */
219
236
  team?: boolean;
220
237
  }
221
- /** Options for {@link Commands.integrationsTest}. */
238
+ /** Options for {@link ExedevClient.integrationsTest}. */
222
239
  export interface IntegrationsTestOptions extends CallOptions {
223
240
  /** operate on a team integration */
224
241
  team?: boolean;
225
242
  }
226
- /** Options for {@link Commands.integrationsEdit}. */
243
+ /** Options for {@link ExedevClient.integrationsEdit}. */
227
244
  export interface IntegrationsEditOptions extends CallOptions {
228
245
  /** authenticate as your GitHub user instead of the exe.dev app (github only) */
229
246
  "act-as-user"?: boolean;
@@ -254,7 +271,7 @@ export interface IntegrationsEditOptions extends CallOptions {
254
271
  /** replacement Slack or Discord webhook URL */
255
272
  "webhook-url"?: string;
256
273
  }
257
- /** Options for {@link Commands.integrationsAttach}. */
274
+ /** Options for {@link ExedevClient.integrationsAttach}. */
258
275
  export interface IntegrationsAttachOptions extends CallOptions {
259
276
  /** time-box the attachment to a duration from now (e.g. 2h, 45m); access lapses automatically */
260
277
  for?: string;
@@ -263,32 +280,32 @@ export interface IntegrationsAttachOptions extends CallOptions {
263
280
  /** time-box the attachment until an RFC3339 instant (e.g. 2026-08-03T20:00:00Z) */
264
281
  until?: string;
265
282
  }
266
- /** Options for {@link Commands.integrationsDetach}. */
283
+ /** Options for {@link ExedevClient.integrationsDetach}. */
267
284
  export interface IntegrationsDetachOptions extends CallOptions {
268
285
  /** operate on a team integration */
269
286
  team?: boolean;
270
287
  }
271
- /** Options for {@link Commands.integrationsRename}. */
288
+ /** Options for {@link ExedevClient.integrationsRename}. */
272
289
  export interface IntegrationsRenameOptions extends CallOptions {
273
290
  /** operate on a team integration */
274
291
  team?: boolean;
275
292
  }
276
- /** Options for {@link Commands.teamDisable}. */
293
+ /** Options for {@link ExedevClient.teamDisable}. */
277
294
  export interface TeamDisableOptions extends CallOptions {
278
295
  /** skip the confirmation prompt (required for non-interactive use, e.g. the web UI) */
279
296
  yes?: boolean;
280
297
  }
281
- /** Options for {@link Commands.teamRemove}. */
298
+ /** Options for {@link ExedevClient.teamRemove}. */
282
299
  export interface TeamRemoveOptions extends CallOptions {
283
300
  /** transfer the member's VMs to this team member before removing them */
284
301
  "transfer-vms-to"?: string;
285
302
  }
286
- /** Options for {@link Commands.teamBillingPlan}. */
303
+ /** Options for {@link ExedevClient.teamBillingPlan}. */
287
304
  export interface TeamBillingPlanOptions extends CallOptions {
288
305
  /** list the plans you can switch to */
289
306
  all?: boolean;
290
307
  }
291
- /** Options for {@link Commands.teamBillingUpdate}. */
308
+ /** Options for {@link ExedevClient.teamBillingUpdate}. */
292
309
  export interface TeamBillingUpdateOptions extends CallOptions {
293
310
  /** billing address city */
294
311
  "address-city"?: string;
@@ -315,7 +332,7 @@ export interface TeamBillingUpdateOptions extends CallOptions {
315
332
  /** tax ID value shown on invoices */
316
333
  "tax-id-value"?: string;
317
334
  }
318
- /** Options for {@link Commands.teamAuthSet}. */
335
+ /** Options for {@link ExedevClient.teamAuthSet}. */
319
336
  export interface TeamAuthSetOptions extends CallOptions {
320
337
  /** OIDC client ID */
321
338
  "client-id"?: string;
@@ -326,21 +343,21 @@ export interface TeamAuthSetOptions extends CallOptions {
326
343
  /** OIDC issuer URL (e.g. https://accounts.google.com) */
327
344
  "issuer-url"?: string;
328
345
  }
329
- /** Options for {@link Commands.teamSettingsVmPlacementMemberPool}. */
346
+ /** Options for {@link ExedevClient.teamSettingsVmPlacementMemberPool}. */
330
347
  export interface TeamSettingsVmPlacementMemberPoolOptions extends CallOptions {
331
348
  /** CPUs to reserve for each member pool (required) */
332
349
  cpus?: number;
333
350
  /** maximum VMs in each member pool (Work defaults to 25 per vCPU, up to 1000) (default: 100) */
334
351
  "max-vms"?: number;
335
352
  }
336
- /** Options for {@link Commands.teamVmLs}. */
353
+ /** Options for {@link ExedevClient.teamVmLs}. */
337
354
  export interface TeamVmLsOptions extends CallOptions {
338
355
  /** group VMs by none|tag|region|type|user|access (default: none) */
339
- group?: "none" | "tag" | "region" | "user" | "access";
356
+ group?: "none" | "tag" | "region" | "type" | "user" | "access";
340
357
  /** show detailed information */
341
358
  l?: boolean;
342
359
  }
343
- /** Options for {@link Commands.poolNew}. */
360
+ /** Options for {@link ExedevClient.poolNew}. */
344
361
  export interface PoolNewOptions extends CallOptions {
345
362
  /** number of CPUs reserved for the pool (required; an even number of vCPUs from 2 through 512 (2, 4, 6, and so on; memory is 2 GiB per vCPU)) */
346
363
  cpus?: number;
@@ -349,28 +366,28 @@ export interface PoolNewOptions extends CallOptions {
349
366
  /** region code for the pool (required unless your team has dedicated hosts, which decide the region) */
350
367
  region?: string;
351
368
  }
352
- /** Options for {@link Commands.poolList}. */
369
+ /** Options for {@link ExedevClient.poolList}. */
353
370
  export interface PoolListOptions extends CallOptions {
354
371
  /** statistics range: live, 24h, 7d, or 30d (requires --usage) (default: live) */
355
372
  range?: string;
356
373
  /** show live or historical CPU and starvation statistics */
357
374
  usage?: boolean;
358
375
  }
359
- /** Options for {@link Commands.poolAdopt}. */
376
+ /** Options for {@link ExedevClient.poolAdopt}. */
360
377
  export interface PoolAdoptOptions extends CallOptions {
361
378
  /** pool to adopt into (required) */
362
379
  pool?: string;
363
380
  /** VM to adopt (required) */
364
381
  vm?: string;
365
382
  }
366
- /** Options for {@link Commands.poolDetach}. */
383
+ /** Options for {@link ExedevClient.poolDetach}. */
367
384
  export interface PoolDetachOptions extends CallOptions {
368
385
  /** leave the VM outside any pool instead of making it standalone (only while your team has poolless VMs) */
369
386
  poolless?: boolean;
370
387
  /** VM to detach from its pool (required) */
371
388
  vm?: string;
372
389
  }
373
- /** Options for {@link Commands.poolResize}. */
390
+ /** Options for {@link ExedevClient.poolResize}. */
374
391
  export interface PoolResizeOptions extends CallOptions {
375
392
  /** new pool size in vCPUs (required unless --max-vms is set; even, from 2 up to the placement limit) */
376
393
  cpus?: number;
@@ -379,19 +396,19 @@ export interface PoolResizeOptions extends CallOptions {
379
396
  /** maximum VMs in the pool (Work: at most 25 per vCPU, up to 1000) */
380
397
  "max-vms"?: string;
381
398
  }
382
- /** Options for {@link Commands.billingPlan}. */
399
+ /** Options for {@link ExedevClient.billingPlan}. */
383
400
  export interface BillingPlanOptions extends CallOptions {
384
401
  /** list the plans you can switch to */
385
402
  all?: boolean;
386
403
  }
387
- /** Options for {@link Commands.billingUsage}. */
404
+ /** Options for {@link ExedevClient.billingUsage}. */
388
405
  export interface BillingUsageOptions extends CallOptions {
389
406
  /** group usage by: vm */
390
407
  group?: string;
391
408
  /** time range: cycle (current billing cycle), 24h, 7d, or 30d (default: cycle) */
392
409
  range?: string;
393
410
  }
394
- /** Options for {@link Commands.billingCreditsUsage}. */
411
+ /** Options for {@link ExedevClient.billingCreditsUsage}. */
395
412
  export interface BillingCreditsUsageOptions extends CallOptions {
396
413
  /** break each group down: models under a day or VM, VMs under a model */
397
414
  detail?: boolean;
@@ -400,26 +417,26 @@ export interface BillingCreditsUsageOptions extends CallOptions {
400
417
  /** calendar month to report, as YYYY-MM (default: this month, UTC) */
401
418
  month?: string;
402
419
  }
403
- /** Options for {@link Commands.billingCreditsTransactions}. */
420
+ /** Options for {@link ExedevClient.billingCreditsTransactions}. */
404
421
  export interface BillingCreditsTransactionsOptions extends CallOptions {
405
422
  /** how many transactions to show, 1-100 (default 20) */
406
423
  limit?: string;
407
424
  }
408
- /** Options for {@link Commands.billingCreditsBuy}. */
425
+ /** Options for {@link ExedevClient.billingCreditsBuy}. */
409
426
  export interface BillingCreditsBuyOptions extends CallOptions {
410
427
  /** retry key so a repeated purchase of the same amount charges once */
411
428
  "idempotency-key"?: string;
412
429
  /** skip the confirmation prompt (required when not running interactively) */
413
430
  yes?: boolean;
414
431
  }
415
- /** Options for {@link Commands.billingCapacity}. */
432
+ /** Options for {@link ExedevClient.billingCapacity}. */
416
433
  export interface BillingCapacityOptions extends CallOptions {
417
434
  /** Personal capacity in vCPUs: 2, 4, 8, or 16 */
418
435
  cpu?: number;
419
436
  /** skip interactive confirmation (required for non-interactive changes) */
420
437
  yes?: boolean;
421
438
  }
422
- /** Options for {@link Commands.billingUpdate}. */
439
+ /** Options for {@link ExedevClient.billingUpdate}. */
423
440
  export interface BillingUpdateOptions extends CallOptions {
424
441
  /** billing address city */
425
442
  "address-city"?: string;
@@ -446,31 +463,31 @@ export interface BillingUpdateOptions extends CallOptions {
446
463
  /** tax ID value shown on invoices */
447
464
  "tax-id-value"?: string;
448
465
  }
449
- /** Options for {@link Commands.billingInvoicesList}. */
466
+ /** Options for {@link ExedevClient.billingInvoicesList}. */
450
467
  export interface BillingInvoicesListOptions extends CallOptions {
451
468
  /** account whose invoices to list: personal or team (default: personal) */
452
469
  account?: string;
453
470
  }
454
- /** Options for {@link Commands.billingInvoicesShow}. */
471
+ /** Options for {@link ExedevClient.billingInvoicesShow}. */
455
472
  export interface BillingInvoicesShowOptions extends CallOptions {
456
473
  /** list VMs without a pool individually */
457
474
  vms?: boolean;
458
475
  }
459
- /** Options for {@link Commands.billingReceipts}. */
476
+ /** Options for {@link ExedevClient.billingReceipts}. */
460
477
  export interface BillingReceiptsOptions extends CallOptions {
461
478
  /** start of the period, YYYY-MM-DD */
462
479
  from?: string;
463
480
  /** end of the period, YYYY-MM-DD */
464
481
  to?: string;
465
482
  }
466
- /** Options for {@link Commands.billingStatement}. */
483
+ /** Options for {@link ExedevClient.billingStatement}. */
467
484
  export interface BillingStatementOptions extends CallOptions {
468
485
  /** start of the period, YYYY-MM-DD */
469
486
  from?: string;
470
487
  /** end of the period, YYYY-MM-DD */
471
488
  to?: string;
472
489
  }
473
- /** Options for {@link Commands.billingProviderLink}. */
490
+ /** Options for {@link ExedevClient.billingProviderLink}. */
474
491
  export interface BillingProviderLinkOptions extends CallOptions {
475
492
  /** team size: no marketplace team plans are available */
476
493
  size?: string;
@@ -479,22 +496,27 @@ export interface BillingProviderLinkOptions extends CallOptions {
479
496
  /** marketplace link token from the exe.dev link page */
480
497
  token?: string;
481
498
  }
482
- /** Options for {@link Commands.browser}. */
499
+ /** Options for {@link ExedevClient.browser}. */
483
500
  export interface BrowserOptions extends CallOptions {
484
501
  /** show QR code for the URL */
485
502
  qr?: boolean;
486
503
  }
487
- /** Options for {@link Commands.stat}. */
504
+ /** Options for {@link VM.stat}. */
488
505
  export interface StatOptions extends CallOptions {
489
506
  /** time range: 24h, 7d, or 30d (default: 24h) */
490
507
  range?: string;
491
508
  }
492
- export declare abstract class Commands {
509
+ export declare class ExedevClient {
510
+ #private;
511
+ constructor(options: ExedevOptions);
512
+ /** Reference an existing VM without a request. Use refresh() to fetch its metadata. */
513
+ vm(name: string): VM;
493
514
  /**
494
- * Runs the command at path. Undefined args are omitted; options are written
495
- * as flags per flags, keyed by flag name.
515
+ * Delete VMs in one request; the server deletes several at a time. Unlike
516
+ * vm.rm(), VMs that were missing or could not be deleted do not throw: they
517
+ * are listed in failed, with reasons in errors. Requires rm permission.
496
518
  */
497
- protected abstract run(path: string, args: readonly Arg[], options: CallOptions | undefined, flags: Readonly<Record<string, FlagKind>>): Promise<any>;
519
+ rm(vms: readonly (string | VM)[], options?: CallOptions): Promise<RmResponse>;
498
520
  /**
499
521
  * Browse documentation
500
522
  *
@@ -510,7 +532,7 @@ export declare abstract class Commands {
510
532
  *
511
533
  * Tag-scoped API keys may run this command.
512
534
  */
513
- ls(nameOrPattern?: string, options?: LsOptions): Promise<CommandResult<"ls">>;
535
+ ls(nameOrPattern?: string, options?: LsOptions): Promise<VM[]>;
514
536
  /**
515
537
  * Create a new VM
516
538
  *
@@ -528,225 +550,13 @@ export declare abstract class Commands {
528
550
  *
529
551
  * Tag-scoped API keys may run this command.
530
552
  */
531
- new(options?: NewOptions): Promise<CommandResult<"new">>;
532
- /**
533
- * Delete a VM
534
- *
535
- * Usage: `rm <vmname>...`
536
- *
537
- * Tag-scoped API keys may run this command.
538
- */
539
- rm(vmnames: string | readonly string[], options?: CallOptions): Promise<CommandResult<"rm">>;
540
- /**
541
- * Restart a VM
542
- *
543
- * Usage: `restart <vmname>`
544
- *
545
- * Tag-scoped API keys may run this command.
546
- */
547
- restart(vmname: string, options?: CallOptions): Promise<CommandResult<"restart">>;
548
- /**
549
- * Pause a VM (snapshot RAM to disk, free its CPU and memory)
550
- *
551
- * Usage: `pause <vmname>`
552
- *
553
- * CLI examples:
554
- * ```
555
- * pause my-vm # snapshot RAM to disk; resume later with 'resume my-vm'
556
- * ```
557
- *
558
- * Tag-scoped API keys may run this command.
559
- */
560
- pause(vmname: string, options?: CallOptions): Promise<CommandResult<"pause">>;
561
- /**
562
- * Resume a paused VM (restore RAM from disk)
563
- *
564
- * Usage: `resume <vmname>`
565
- *
566
- * Tag-scoped API keys may run this command.
567
- */
568
- resume(vmname: string, options?: CallOptions): Promise<CommandResult<"resume">>;
569
- /**
570
- * rename a vm
571
- *
572
- * Usage: `rename <oldname> <newname>`
573
- *
574
- * Tag-scoped API keys may run this command.
575
- */
576
- rename(oldname: string, newname: string, options?: CallOptions): Promise<CommandResult<"rename">>;
577
- /**
578
- * Add or remove tags on a VM
579
- *
580
- * Usage: `tag [-d] <vm> <tag-name> [tag-name...]`
581
- *
582
- * CLI examples:
583
- * ```
584
- * tag my-vm prod web # add tags
585
- * tag -d my-vm prod web # remove tags
586
- * ```
587
- *
588
- * Tag-scoped API keys may run this command.
589
- */
590
- tag(vm: string, tagNames: string | readonly string[], options?: TagOptions): Promise<CommandResult<"tag">>;
591
- /**
592
- * Copy an existing VM
593
- *
594
- * Usage: `cp <source-vm> [new-name] [--pool=<name>] [--memory=<size>] [--cpu=<count>] [--disk=<size>]`
595
- *
596
- * CLI examples:
597
- * ```
598
- * cp my-vm # copy with auto-generated name
599
- * cp my-vm my-vm-copy # copy with specific name
600
- * cp my-vm --cpu=4 --memory=16GB # copy with different resources
601
- * cp my-vm my-pool-copy --pool=build # copy into a team pool
602
- * cp my-vm --copy-tags=false # copy without tags
603
- * ```
604
- *
605
- * Tag-scoped API keys may run this command.
606
- */
607
- cp(sourceVm: string, newName?: string, options?: CpOptions): Promise<CommandResult<"cp">>;
608
- /**
609
- * Resize a VM's resources (memory, CPU, disk)
610
- *
611
- * Usage: `resize <vmname> [--memory=<size>] [--cpu=<count>] [--disk=<size>]`
612
- *
613
- * Tag-scoped API keys may run this command.
614
- */
615
- resize(vmname: string, options?: ResizeOptions): Promise<CommandResult<"resize">>;
616
- /**
617
- * Set or clear a short comment on a VM
618
- *
619
- * Usage: `comment <hostname> <text>`
620
- *
621
- * CLI examples:
622
- * ```
623
- * comment my-vm staging copy
624
- * comment my-vm "" # clear the comment
625
- * ```
626
- *
627
- * Tag-scoped API keys may run this command.
628
- */
629
- comment(hostname: string, text: string, options?: CallOptions): Promise<CommandResult<"comment">>;
630
- /**
631
- * Link a custom domain to a VM
632
- *
633
- * Usage: `domain add [--wildcard] <vm> <domain>`
634
- */
635
- domainAdd(vm: string, domain: string, options?: DomainAddOptions): Promise<CommandResult<"domain add">>;
636
- /**
637
- * Remove a custom domain from a VM
638
- *
639
- * Usage: `domain rm <vm> <domain>`
640
- */
641
- domainRm(vm: string, domain: string, options?: CallOptions): Promise<CommandResult<"domain rm">>;
553
+ new(options?: NewOptions): Promise<VM>;
642
554
  /**
643
555
  * List custom domains for a VM (or -a for all your VMs)
644
556
  *
645
557
  * Usage: `domain ls <vm> | domain ls -a`
646
558
  */
647
559
  domainLs(args?: readonly string[], options?: DomainLsOptions): Promise<CommandResult<"domain ls">>;
648
- /**
649
- * Show current shares for a VM
650
- *
651
- * Usage: `share show <vm>`
652
- *
653
- * Tag-scoped API keys may run this command.
654
- */
655
- shareShow(vm: string, options?: ShareShowOptions): Promise<CommandResult<"share show">>;
656
- /**
657
- * Set the HTTP proxy port for a VM
658
- *
659
- * Usage: `share port <vm> [port]`
660
- *
661
- * CLI examples:
662
- * ```
663
- * share port mybox 8080
664
- * ```
665
- *
666
- * Tag-scoped API keys may run this command.
667
- */
668
- sharePort(vm: string, port?: string, options?: CallOptions): Promise<CommandResult<"share port">>;
669
- /**
670
- * Make the HTTP proxy publicly accessible
671
- *
672
- * Usage: `share set-public <vm>`
673
- *
674
- * Tag-scoped API keys may run this command.
675
- */
676
- shareSetPublic(vm: string, options?: CallOptions): Promise<CommandResult<"share set-public">>;
677
- /**
678
- * Restrict the HTTP proxy to authenticated users
679
- *
680
- * Usage: `share set-private <vm>`
681
- *
682
- * Tag-scoped API keys may run this command.
683
- */
684
- shareSetPrivate(vm: string, options?: CallOptions): Promise<CommandResult<"share set-private">>;
685
- /**
686
- * Share VM with a user via email, or grant shell access with --root
687
- *
688
- * Usage: `share add <vm> <email|team> [--root] [--message='...']`
689
- *
690
- * CLI examples:
691
- * ```
692
- * share add mybox user@example.com
693
- * share add mybox user@example.com --message='Check this out'
694
- * share add mybox team
695
- * share add mybox teammate@example.com --root
696
- * share add mybox team --root
697
- * ```
698
- *
699
- * Tag-scoped API keys may run this command.
700
- */
701
- shareAdd(vm: string, emailOrTeam: string, options?: ShareAddOptions): Promise<CommandResult<"share add">>;
702
- /**
703
- * Revoke a user's access to a VM, or downgrade shell access to web with --root
704
- *
705
- * Usage: `share remove <vm> <email|team> [--root]`
706
- *
707
- * CLI examples:
708
- * ```
709
- * share remove mybox user@example.com
710
- * share remove mybox team
711
- * share remove mybox teammate@example.com --root
712
- * share remove mybox team --root
713
- * ```
714
- *
715
- * Tag-scoped API keys may run this command.
716
- */
717
- shareRemove(vm: string, emailOrTeam: string, options?: ShareRemoveOptions): Promise<CommandResult<"share remove">>;
718
- /**
719
- * Create a shareable link for a VM
720
- *
721
- * Usage: `share add-link <vm>`
722
- *
723
- * Tag-scoped API keys may run this command.
724
- */
725
- shareAddLink(vm: string, options?: ShareAddLinkOptions): Promise<CommandResult<"share add-link">>;
726
- /**
727
- * Revoke a shareable link
728
- *
729
- * Usage: `share remove-link <vm> <token>`
730
- *
731
- * Tag-scoped API keys may run this command.
732
- */
733
- shareRemoveLink(vm: string, token: string, options?: CallOptions): Promise<CommandResult<"share remove-link">>;
734
- /**
735
- * Enable or disable inbound email for a VM
736
- *
737
- * Usage: `share receive-email <vm> [on|off] [--reply-policy=all|known|owner|none]`
738
- *
739
- * CLI examples:
740
- * ```
741
- * share receive-email mybox on
742
- * share receive-email mybox off
743
- * share receive-email mybox --reply-policy=known
744
- * share receive-email mybox
745
- * ```
746
- *
747
- * Tag-scoped API keys may run this command.
748
- */
749
- shareReceiveEmail(vm: string, onOrOff?: "on" | "off", options?: ShareReceiveEmailOptions): Promise<CommandResult<"share receive-email">>;
750
560
  /**
751
561
  * Show user information (email, keys, etc)
752
562
  *
@@ -1392,19 +1202,254 @@ export declare abstract class Commands {
1392
1202
  */
1393
1203
  inviteManage(options?: CallOptions): Promise<CommandResult<"invite manage">>;
1394
1204
  /**
1395
- * Install or upgrade Shelley to the current version
1205
+ * Generate a magic link to log in to the website
1396
1206
  *
1397
- * Usage: `shelley install <vm>`
1207
+ * Usage: `browser`
1208
+ */
1209
+ browser(options?: BrowserOptions): Promise<CommandResult<"browser">>;
1210
+ }
1211
+ /** A VM reference. info is a snapshot; refresh() fetches current metadata. */
1212
+ export declare class VM {
1213
+ #private;
1214
+ /** @internal Obtain VMs through exe.new(), exe.ls(), exe.vm(), or vm.cp(). */
1215
+ constructor(transport: Transport, info: VMInfo);
1216
+ get info(): Readonly<VMInfo>;
1217
+ get name(): string;
1218
+ get httpsUrl(): string | undefined;
1219
+ get sshDest(): string | undefined;
1220
+ get tags(): readonly string[];
1221
+ /** Run a shell command once. Nonzero exit codes are results, not exceptions. */
1222
+ ssh(command: string, options?: SSHOptions): Promise<SSHResult>;
1223
+ /** Refresh metadata without changing this reference's identity. Requires ls permission. */
1224
+ refresh(options?: CallOptions): Promise<this>;
1225
+ /**
1226
+ * Probe SSH with `true` until it exits successfully. Never reruns a user command.
1227
+ * With waitUntil: "setup", then poll exe-setup.service until the setup script
1228
+ * has finished, throwing VMSetupError (as VMReadyError's cause) if it failed.
1229
+ * Images without that unit (anything but exeuntu) have no setup to wait for.
1230
+ * This does not wait for application servers. Requires ssh permission.
1231
+ */
1232
+ waitUntilReady(options?: WaitOptions): Promise<this>;
1233
+ /**
1234
+ * Delete a VM
1235
+ *
1236
+ * Usage: `rm <vmname>...`
1398
1237
  *
1399
1238
  * Tag-scoped API keys may run this command.
1400
1239
  */
1401
- shelleyInstall(vm: string, options?: CallOptions): Promise<CommandResult<"shelley install">>;
1240
+ rm(options?: CallOptions): Promise<RmResponse>;
1402
1241
  /**
1403
- * Generate a magic link to log in to the website
1242
+ * Restart a VM
1404
1243
  *
1405
- * Usage: `browser`
1244
+ * Usage: `restart <vmname>`
1245
+ *
1246
+ * Tag-scoped API keys may run this command.
1406
1247
  */
1407
- browser(options?: BrowserOptions): Promise<CommandResult<"browser">>;
1248
+ restart(options?: ReadyOptions): Promise<this>;
1249
+ /**
1250
+ * Pause a VM (snapshot RAM to disk, free its CPU and memory)
1251
+ *
1252
+ * Usage: `pause <vmname>`
1253
+ *
1254
+ * CLI examples:
1255
+ * ```
1256
+ * pause my-vm # snapshot RAM to disk; resume later with 'resume my-vm'
1257
+ * ```
1258
+ *
1259
+ * Tag-scoped API keys may run this command.
1260
+ */
1261
+ pause(options?: CallOptions): Promise<CommandResult<"pause">>;
1262
+ /**
1263
+ * Resume a paused VM (restore RAM from disk)
1264
+ *
1265
+ * Usage: `resume <vmname>`
1266
+ *
1267
+ * Tag-scoped API keys may run this command.
1268
+ */
1269
+ resume(options?: ReadyOptions): Promise<this>;
1270
+ /**
1271
+ * rename a vm
1272
+ *
1273
+ * Usage: `rename <oldname> <newname>`
1274
+ *
1275
+ * Tag-scoped API keys may run this command.
1276
+ */
1277
+ rename(newname: string, options?: CallOptions): Promise<this>;
1278
+ /**
1279
+ * Add or remove tags on a VM
1280
+ *
1281
+ * Usage: `tag [-d] <vm> <tag-name> [tag-name...]`
1282
+ *
1283
+ * CLI examples:
1284
+ * ```
1285
+ * tag my-vm prod web # add tags
1286
+ * tag -d my-vm prod web # remove tags
1287
+ * ```
1288
+ *
1289
+ * Tag-scoped API keys may run this command.
1290
+ */
1291
+ tag(tagNames: string | readonly string[], options?: TagOptions): Promise<CommandResult<"tag">>;
1292
+ /**
1293
+ * Copy an existing VM
1294
+ *
1295
+ * Usage: `cp <source-vm> [new-name] [--pool=<name>] [--memory=<size>] [--cpu=<count>] [--disk=<size>]`
1296
+ *
1297
+ * CLI examples:
1298
+ * ```
1299
+ * cp my-vm # copy with auto-generated name
1300
+ * cp my-vm my-vm-copy # copy with specific name
1301
+ * cp my-vm --cpu=4 --memory=16GB # copy with different resources
1302
+ * cp my-vm my-pool-copy --pool=build # copy into a team pool
1303
+ * cp my-vm --copy-tags=false # copy without tags
1304
+ * ```
1305
+ *
1306
+ * Tag-scoped API keys may run this command.
1307
+ */
1308
+ cp(options?: CpOptions): Promise<VM>;
1309
+ /**
1310
+ * Resize a VM's resources (memory, CPU, disk)
1311
+ *
1312
+ * Usage: `resize <vmname> [--memory=<size>] [--cpu=<count>] [--disk=<size>]`
1313
+ *
1314
+ * Tag-scoped API keys may run this command.
1315
+ */
1316
+ resize(options?: ResizeOptions): Promise<CommandResult<"resize">>;
1317
+ /**
1318
+ * Set or clear a short comment on a VM
1319
+ *
1320
+ * Usage: `comment <hostname> <text>`
1321
+ *
1322
+ * CLI examples:
1323
+ * ```
1324
+ * comment my-vm staging copy
1325
+ * comment my-vm "" # clear the comment
1326
+ * ```
1327
+ *
1328
+ * Tag-scoped API keys may run this command.
1329
+ */
1330
+ comment(text: string, options?: CallOptions): Promise<CommandResult<"comment">>;
1331
+ /**
1332
+ * Link a custom domain to a VM
1333
+ *
1334
+ * Usage: `domain add [--wildcard] <vm> <domain>`
1335
+ */
1336
+ domainAdd(domain: string, options?: DomainAddOptions): Promise<CommandResult<"domain add">>;
1337
+ /**
1338
+ * Remove a custom domain from a VM
1339
+ *
1340
+ * Usage: `domain rm <vm> <domain>`
1341
+ */
1342
+ domainRm(domain: string, options?: CallOptions): Promise<CommandResult<"domain rm">>;
1343
+ /**
1344
+ * Show current shares for a VM
1345
+ *
1346
+ * Usage: `share show <vm>`
1347
+ *
1348
+ * Tag-scoped API keys may run this command.
1349
+ */
1350
+ shareShow(options?: ShareShowOptions): Promise<CommandResult<"share show">>;
1351
+ /**
1352
+ * Set the HTTP proxy port for a VM
1353
+ *
1354
+ * Usage: `share port <vm> [port]`
1355
+ *
1356
+ * CLI examples:
1357
+ * ```
1358
+ * share port mybox 8080
1359
+ * ```
1360
+ *
1361
+ * Tag-scoped API keys may run this command.
1362
+ */
1363
+ sharePort(port?: string, options?: CallOptions): Promise<CommandResult<"share port">>;
1364
+ /**
1365
+ * Make the HTTP proxy publicly accessible
1366
+ *
1367
+ * Usage: `share set-public <vm>`
1368
+ *
1369
+ * Tag-scoped API keys may run this command.
1370
+ */
1371
+ shareSetPublic(options?: CallOptions): Promise<CommandResult<"share set-public">>;
1372
+ /**
1373
+ * Restrict the HTTP proxy to authenticated users
1374
+ *
1375
+ * Usage: `share set-private <vm>`
1376
+ *
1377
+ * Tag-scoped API keys may run this command.
1378
+ */
1379
+ shareSetPrivate(options?: CallOptions): Promise<CommandResult<"share set-private">>;
1380
+ /**
1381
+ * Share VM with a user via email, or grant shell access with --root
1382
+ *
1383
+ * Usage: `share add <vm> <email|team> [--root] [--message='...']`
1384
+ *
1385
+ * CLI examples:
1386
+ * ```
1387
+ * share add mybox user@example.com
1388
+ * share add mybox user@example.com --message='Check this out'
1389
+ * share add mybox team
1390
+ * share add mybox teammate@example.com --root
1391
+ * share add mybox team --root
1392
+ * ```
1393
+ *
1394
+ * Tag-scoped API keys may run this command.
1395
+ */
1396
+ shareAdd(emailOrTeam: string, options?: ShareAddOptions): Promise<CommandResult<"share add">>;
1397
+ /**
1398
+ * Revoke a user's access to a VM, or downgrade shell access to web with --root
1399
+ *
1400
+ * Usage: `share remove <vm> <email|team> [--root]`
1401
+ *
1402
+ * CLI examples:
1403
+ * ```
1404
+ * share remove mybox user@example.com
1405
+ * share remove mybox team
1406
+ * share remove mybox teammate@example.com --root
1407
+ * share remove mybox team --root
1408
+ * ```
1409
+ *
1410
+ * Tag-scoped API keys may run this command.
1411
+ */
1412
+ shareRemove(emailOrTeam: string, options?: ShareRemoveOptions): Promise<CommandResult<"share remove">>;
1413
+ /**
1414
+ * Create a shareable link for a VM
1415
+ *
1416
+ * Usage: `share add-link <vm>`
1417
+ *
1418
+ * Tag-scoped API keys may run this command.
1419
+ */
1420
+ shareAddLink(options?: ShareAddLinkOptions): Promise<CommandResult<"share add-link">>;
1421
+ /**
1422
+ * Revoke a shareable link
1423
+ *
1424
+ * Usage: `share remove-link <vm> <token>`
1425
+ *
1426
+ * Tag-scoped API keys may run this command.
1427
+ */
1428
+ shareRemoveLink(token: string, options?: CallOptions): Promise<CommandResult<"share remove-link">>;
1429
+ /**
1430
+ * Enable or disable inbound email for a VM
1431
+ *
1432
+ * Usage: `share receive-email <vm> [on|off] [--reply-policy=all|known|owner|none]`
1433
+ *
1434
+ * CLI examples:
1435
+ * ```
1436
+ * share receive-email mybox on
1437
+ * share receive-email mybox off
1438
+ * share receive-email mybox --reply-policy=known
1439
+ * share receive-email mybox
1440
+ * ```
1441
+ *
1442
+ * Tag-scoped API keys may run this command.
1443
+ */
1444
+ shareReceiveEmail(onOrOff?: "on" | "off", options?: ShareReceiveEmailOptions): Promise<CommandResult<"share receive-email">>;
1445
+ /**
1446
+ * Install or upgrade Shelley to the current version
1447
+ *
1448
+ * Usage: `shelley install <vm>`
1449
+ *
1450
+ * Tag-scoped API keys may run this command.
1451
+ */
1452
+ shelleyInstall(options?: CallOptions): Promise<CommandResult<"shelley install">>;
1408
1453
  /**
1409
1454
  * Allow exe.dev support to log in to a VM
1410
1455
  *
@@ -1412,7 +1457,7 @@ export declare abstract class Commands {
1412
1457
  *
1413
1458
  * Tag-scoped API keys may run this command.
1414
1459
  */
1415
- grantSupportRoot(vmname: string, onOrOff: "on" | "off", options?: CallOptions): Promise<CommandResult<"grant-support-root">>;
1460
+ grantSupportRoot(onOrOff: "on" | "off", options?: CallOptions): Promise<CommandResult<"grant-support-root">>;
1416
1461
  /**
1417
1462
  * Show vCPU, disk, IO, and network (RX/TX) metrics for a VM
1418
1463
  *
@@ -1427,6 +1472,26 @@ export declare abstract class Commands {
1427
1472
  *
1428
1473
  * Tag-scoped API keys may run this command.
1429
1474
  */
1430
- stat(vmName: string, options?: StatOptions): Promise<CommandResult<"stat">>;
1475
+ stat(options?: StatOptions): Promise<CommandResult<"stat">>;
1476
+ }
1477
+ /** Readiness failed after a VM was obtained/created. The VM is not deleted. */
1478
+ export declare class VMReadyError extends Error {
1479
+ readonly vm: VM;
1480
+ constructor(vm: VM, cause: unknown);
1481
+ }
1482
+ /** The VM's setup script failed. details() has the end of its journal. */
1483
+ export declare class VMSetupError extends Error {
1484
+ #private;
1485
+ /** systemd's Result for exe-setup.service, e.g. "exit-code", "signal", or "timeout". */
1486
+ readonly result: string;
1487
+ readonly exitCode: number | undefined;
1488
+ readonly signal: number | undefined;
1489
+ constructor(
1490
+ /** systemd's Result for exe-setup.service, e.g. "exit-code", "signal", or "timeout". */
1491
+ result: string, exitCode: number | undefined, signal: number | undefined, output: string);
1492
+ /** The script's last journal lines; may contain secrets. */
1493
+ details(): {
1494
+ output: string;
1495
+ };
1431
1496
  }
1432
1497
  //# sourceMappingURL=commands.gen.d.ts.map