@exedev/sdk 0.1.0 → 0.2.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,40 @@
1
+ import { Transport } from "./client.js";
2
+ import type { ExedevOptions, SSHOptions, SSHResult } from "./client.js";
1
3
  import type { CommandResults } from "./types.js";
2
- /** Options every command method accepts. */
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
+ /** SSH readiness deadline, in milliseconds. Default 60,000. */
9
+ timeoutMs?: number;
10
+ }
11
+ export interface ReadyOptions extends WaitOptions {
12
+ /** Default ssh. Use created to return without probing (and without ssh permission). */
13
+ waitUntil?: "ssh" | "created";
14
+ }
15
+ export interface VMInfo {
16
+ readonly name: string;
17
+ readonly tags: readonly string[];
18
+ readonly sshDest?: string;
19
+ readonly httpsUrl?: string;
20
+ readonly status?: string;
21
+ readonly region?: string;
22
+ readonly comment?: string;
23
+ readonly createdAt?: string;
24
+ readonly setupError?: string;
25
+ }
11
26
  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
27
  export type FlagKind = "bool" | "number" | "string" | "repeated";
18
- /** A positional argument as passed to Commands.run; arrays are spread. */
19
28
  export type Arg = string | readonly string[] | undefined;
20
- /** Options for {@link Commands.ls}. */
29
+ /** Options for {@link ExedevClient.ls}. */
21
30
  export interface LsOptions extends CallOptions {
22
31
  /** group VMs by none|tag|region|type (default: none) */
23
32
  group?: "none" | "tag" | "region";
24
33
  /** show detailed information */
25
34
  l?: boolean;
26
35
  }
27
- /** Options for {@link Commands.new}. */
28
- export interface NewOptions extends CallOptions {
36
+ /** Options for {@link ExedevClient.new}. */
37
+ export interface NewOptions extends ReadyOptions {
29
38
  /** short note about the VM (max 200 bytes) */
30
39
  comment?: string;
31
40
  /** number of CPUs (default 2; run 'billing plan' for plan limits) */
@@ -61,13 +70,15 @@ export interface NewOptions extends CallOptions {
61
70
  /** tag to add to the VM (can be specified multiple times or comma-separated) */
62
71
  tag?: string | readonly string[];
63
72
  }
64
- /** Options for {@link Commands.tag}. */
73
+ /** Options for {@link VM.tag}. */
65
74
  export interface TagOptions extends CallOptions {
66
75
  /** delete tag */
67
76
  d?: boolean;
68
77
  }
69
- /** Options for {@link Commands.cp}. */
70
- export interface CpOptions extends CallOptions {
78
+ /** Options for {@link VM.cp}. */
79
+ export interface CpOptions extends ReadyOptions {
80
+ /** Name of the copy; omitted to generate one. */
81
+ name?: string;
71
82
  /** copy tags from source VM (use --copy-tags=false to disable) (default: true) */
72
83
  "copy-tags"?: boolean;
73
84
  /** number of CPUs */
@@ -83,7 +94,7 @@ export interface CpOptions extends CallOptions {
83
94
  /** create the copy as a standalone VM with its own reserved capacity (requires a plan with standalone VMs and team approval) */
84
95
  standalone?: boolean;
85
96
  }
86
- /** Options for {@link Commands.resize}. */
97
+ /** Options for {@link VM.resize}. */
87
98
  export interface ResizeOptions extends CallOptions {
88
99
  /** number of CPUs */
89
100
  cpu?: number;
@@ -92,22 +103,22 @@ export interface ResizeOptions extends CallOptions {
92
103
  /** memory allocation (e.g., 4, 4GB, 8G) */
93
104
  memory?: string;
94
105
  }
95
- /** Options for {@link Commands.domainAdd}. */
106
+ /** Options for {@link VM.domainAdd}. */
96
107
  export interface DomainAddOptions extends CallOptions {
97
108
  /** issue a wildcard (*.<parent>) certificate via DNS-01 delegation */
98
109
  wildcard?: boolean;
99
110
  }
100
- /** Options for {@link Commands.domainLs}. */
111
+ /** Options for {@link ExedevClient.domainLs}. */
101
112
  export interface DomainLsOptions extends CallOptions {
102
113
  /** list domains across all your VMs */
103
114
  a?: boolean;
104
115
  }
105
- /** Options for {@link Commands.shareShow}. */
116
+ /** Options for {@link VM.shareShow}. */
106
117
  export interface ShareShowOptions extends CallOptions {
107
118
  /** show QR code for the URL */
108
119
  qr?: boolean;
109
120
  }
110
- /** Options for {@link Commands.shareAdd}. */
121
+ /** Options for {@link VM.shareAdd}. */
111
122
  export interface ShareAddOptions extends CallOptions {
112
123
  /** message to include in share invitation */
113
124
  message?: string;
@@ -116,27 +127,27 @@ export interface ShareAddOptions extends CallOptions {
116
127
  /** grant/revoke shell (SSH, Terminal, Shelley) access instead of web-only */
117
128
  root?: boolean;
118
129
  }
119
- /** Options for {@link Commands.shareRemove}. */
130
+ /** Options for {@link VM.shareRemove}. */
120
131
  export interface ShareRemoveOptions extends CallOptions {
121
132
  /** grant/revoke shell (SSH, Terminal, Shelley) access instead of web-only */
122
133
  root?: boolean;
123
134
  }
124
- /** Options for {@link Commands.shareAddLink}. */
135
+ /** Options for {@link VM.shareAddLink}. */
125
136
  export interface ShareAddLinkOptions extends CallOptions {
126
137
  /** show QR code for the URL */
127
138
  qr?: boolean;
128
139
  }
129
- /** Options for {@link Commands.shareReceiveEmail}. */
140
+ /** Options for {@link VM.shareReceiveEmail}. */
130
141
  export interface ShareReceiveEmailOptions extends CallOptions {
131
142
  /** restrict who the VM may email: all|known|owner|none */
132
143
  "reply-policy"?: string;
133
144
  }
134
- /** Options for {@link Commands.sshKeyAdd}. */
145
+ /** Options for {@link ExedevClient.sshKeyAdd}. */
135
146
  export interface SshKeyAddOptions extends CallOptions {
136
147
  /** scope key to VMs with this tag */
137
148
  tag?: string;
138
149
  }
139
- /** Options for {@link Commands.sshKeyGenerateApiKey}. */
150
+ /** Options for {@link ExedevClient.sshKeyGenerateApiKey}. */
140
151
  export interface SshKeyGenerateApiKeyOptions extends CallOptions {
141
152
  /** comma-separated list of allowed commands (empty = defaults) */
142
153
  cmds?: string;
@@ -147,12 +158,12 @@ export interface SshKeyGenerateApiKeyOptions extends CallOptions {
147
158
  /** scope key to a VM (authenticates to its HTTPS endpoints instead of exe.dev commands) */
148
159
  vm?: string;
149
160
  }
150
- /** Options for {@link Commands.integrationsList}. */
161
+ /** Options for {@link ExedevClient.integrationsList}. */
151
162
  export interface IntegrationsListOptions extends CallOptions {
152
163
  /** include per-VM usage (lastUsedAt, usedByVMs); JSON only */
153
164
  usage?: boolean;
154
165
  }
155
- /** Options for {@link Commands.integrationsSetupGithub}. */
166
+ /** Options for {@link ExedevClient.integrationsSetupGithub}. */
156
167
  export interface IntegrationsSetupGithubOptions extends CallOptions {
157
168
  /** disconnect GitHub account */
158
169
  d?: boolean;
@@ -163,7 +174,7 @@ export interface IntegrationsSetupGithubOptions extends CallOptions {
163
174
  /** verify GitHub connections are working */
164
175
  verify?: boolean;
165
176
  }
166
- /** Options for {@link Commands.integrationsSetupChatgpt}. */
177
+ /** Options for {@link ExedevClient.integrationsSetupChatgpt}. */
167
178
  export interface IntegrationsSetupChatgptOptions extends CallOptions {
168
179
  /** disconnect ChatGPT account */
169
180
  d?: boolean;
@@ -176,7 +187,7 @@ export interface IntegrationsSetupChatgptOptions extends CallOptions {
176
187
  /** verify ChatGPT connections are working */
177
188
  verify?: boolean;
178
189
  }
179
- /** Options for {@link Commands.integrationsAdd}. */
190
+ /** Options for {@link ExedevClient.integrationsAdd}. */
180
191
  export interface IntegrationsAddOptions extends CallOptions {
181
192
  /** authenticate as your GitHub user instead of the exe.dev app (github only); pushes and API calls are attributed to your GitHub account */
182
193
  "act-as-user"?: boolean;
@@ -213,17 +224,17 @@ export interface IntegrationsAddOptions extends CallOptions {
213
224
  /** create as a team integration */
214
225
  team?: boolean;
215
226
  }
216
- /** Options for {@link Commands.integrationsRemove}. */
227
+ /** Options for {@link ExedevClient.integrationsRemove}. */
217
228
  export interface IntegrationsRemoveOptions extends CallOptions {
218
229
  /** operate on a team integration */
219
230
  team?: boolean;
220
231
  }
221
- /** Options for {@link Commands.integrationsTest}. */
232
+ /** Options for {@link ExedevClient.integrationsTest}. */
222
233
  export interface IntegrationsTestOptions extends CallOptions {
223
234
  /** operate on a team integration */
224
235
  team?: boolean;
225
236
  }
226
- /** Options for {@link Commands.integrationsEdit}. */
237
+ /** Options for {@link ExedevClient.integrationsEdit}. */
227
238
  export interface IntegrationsEditOptions extends CallOptions {
228
239
  /** authenticate as your GitHub user instead of the exe.dev app (github only) */
229
240
  "act-as-user"?: boolean;
@@ -254,7 +265,7 @@ export interface IntegrationsEditOptions extends CallOptions {
254
265
  /** replacement Slack or Discord webhook URL */
255
266
  "webhook-url"?: string;
256
267
  }
257
- /** Options for {@link Commands.integrationsAttach}. */
268
+ /** Options for {@link ExedevClient.integrationsAttach}. */
258
269
  export interface IntegrationsAttachOptions extends CallOptions {
259
270
  /** time-box the attachment to a duration from now (e.g. 2h, 45m); access lapses automatically */
260
271
  for?: string;
@@ -263,32 +274,32 @@ export interface IntegrationsAttachOptions extends CallOptions {
263
274
  /** time-box the attachment until an RFC3339 instant (e.g. 2026-08-03T20:00:00Z) */
264
275
  until?: string;
265
276
  }
266
- /** Options for {@link Commands.integrationsDetach}. */
277
+ /** Options for {@link ExedevClient.integrationsDetach}. */
267
278
  export interface IntegrationsDetachOptions extends CallOptions {
268
279
  /** operate on a team integration */
269
280
  team?: boolean;
270
281
  }
271
- /** Options for {@link Commands.integrationsRename}. */
282
+ /** Options for {@link ExedevClient.integrationsRename}. */
272
283
  export interface IntegrationsRenameOptions extends CallOptions {
273
284
  /** operate on a team integration */
274
285
  team?: boolean;
275
286
  }
276
- /** Options for {@link Commands.teamDisable}. */
287
+ /** Options for {@link ExedevClient.teamDisable}. */
277
288
  export interface TeamDisableOptions extends CallOptions {
278
289
  /** skip the confirmation prompt (required for non-interactive use, e.g. the web UI) */
279
290
  yes?: boolean;
280
291
  }
281
- /** Options for {@link Commands.teamRemove}. */
292
+ /** Options for {@link ExedevClient.teamRemove}. */
282
293
  export interface TeamRemoveOptions extends CallOptions {
283
294
  /** transfer the member's VMs to this team member before removing them */
284
295
  "transfer-vms-to"?: string;
285
296
  }
286
- /** Options for {@link Commands.teamBillingPlan}. */
297
+ /** Options for {@link ExedevClient.teamBillingPlan}. */
287
298
  export interface TeamBillingPlanOptions extends CallOptions {
288
299
  /** list the plans you can switch to */
289
300
  all?: boolean;
290
301
  }
291
- /** Options for {@link Commands.teamBillingUpdate}. */
302
+ /** Options for {@link ExedevClient.teamBillingUpdate}. */
292
303
  export interface TeamBillingUpdateOptions extends CallOptions {
293
304
  /** billing address city */
294
305
  "address-city"?: string;
@@ -315,7 +326,7 @@ export interface TeamBillingUpdateOptions extends CallOptions {
315
326
  /** tax ID value shown on invoices */
316
327
  "tax-id-value"?: string;
317
328
  }
318
- /** Options for {@link Commands.teamAuthSet}. */
329
+ /** Options for {@link ExedevClient.teamAuthSet}. */
319
330
  export interface TeamAuthSetOptions extends CallOptions {
320
331
  /** OIDC client ID */
321
332
  "client-id"?: string;
@@ -326,21 +337,21 @@ export interface TeamAuthSetOptions extends CallOptions {
326
337
  /** OIDC issuer URL (e.g. https://accounts.google.com) */
327
338
  "issuer-url"?: string;
328
339
  }
329
- /** Options for {@link Commands.teamSettingsVmPlacementMemberPool}. */
340
+ /** Options for {@link ExedevClient.teamSettingsVmPlacementMemberPool}. */
330
341
  export interface TeamSettingsVmPlacementMemberPoolOptions extends CallOptions {
331
342
  /** CPUs to reserve for each member pool (required) */
332
343
  cpus?: number;
333
344
  /** maximum VMs in each member pool (Work defaults to 25 per vCPU, up to 1000) (default: 100) */
334
345
  "max-vms"?: number;
335
346
  }
336
- /** Options for {@link Commands.teamVmLs}. */
347
+ /** Options for {@link ExedevClient.teamVmLs}. */
337
348
  export interface TeamVmLsOptions extends CallOptions {
338
349
  /** group VMs by none|tag|region|type|user|access (default: none) */
339
350
  group?: "none" | "tag" | "region" | "user" | "access";
340
351
  /** show detailed information */
341
352
  l?: boolean;
342
353
  }
343
- /** Options for {@link Commands.poolNew}. */
354
+ /** Options for {@link ExedevClient.poolNew}. */
344
355
  export interface PoolNewOptions extends CallOptions {
345
356
  /** 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
357
  cpus?: number;
@@ -349,28 +360,28 @@ export interface PoolNewOptions extends CallOptions {
349
360
  /** region code for the pool (required unless your team has dedicated hosts, which decide the region) */
350
361
  region?: string;
351
362
  }
352
- /** Options for {@link Commands.poolList}. */
363
+ /** Options for {@link ExedevClient.poolList}. */
353
364
  export interface PoolListOptions extends CallOptions {
354
365
  /** statistics range: live, 24h, 7d, or 30d (requires --usage) (default: live) */
355
366
  range?: string;
356
367
  /** show live or historical CPU and starvation statistics */
357
368
  usage?: boolean;
358
369
  }
359
- /** Options for {@link Commands.poolAdopt}. */
370
+ /** Options for {@link ExedevClient.poolAdopt}. */
360
371
  export interface PoolAdoptOptions extends CallOptions {
361
372
  /** pool to adopt into (required) */
362
373
  pool?: string;
363
374
  /** VM to adopt (required) */
364
375
  vm?: string;
365
376
  }
366
- /** Options for {@link Commands.poolDetach}. */
377
+ /** Options for {@link ExedevClient.poolDetach}. */
367
378
  export interface PoolDetachOptions extends CallOptions {
368
379
  /** leave the VM outside any pool instead of making it standalone (only while your team has poolless VMs) */
369
380
  poolless?: boolean;
370
381
  /** VM to detach from its pool (required) */
371
382
  vm?: string;
372
383
  }
373
- /** Options for {@link Commands.poolResize}. */
384
+ /** Options for {@link ExedevClient.poolResize}. */
374
385
  export interface PoolResizeOptions extends CallOptions {
375
386
  /** new pool size in vCPUs (required unless --max-vms is set; even, from 2 up to the placement limit) */
376
387
  cpus?: number;
@@ -379,19 +390,19 @@ export interface PoolResizeOptions extends CallOptions {
379
390
  /** maximum VMs in the pool (Work: at most 25 per vCPU, up to 1000) */
380
391
  "max-vms"?: string;
381
392
  }
382
- /** Options for {@link Commands.billingPlan}. */
393
+ /** Options for {@link ExedevClient.billingPlan}. */
383
394
  export interface BillingPlanOptions extends CallOptions {
384
395
  /** list the plans you can switch to */
385
396
  all?: boolean;
386
397
  }
387
- /** Options for {@link Commands.billingUsage}. */
398
+ /** Options for {@link ExedevClient.billingUsage}. */
388
399
  export interface BillingUsageOptions extends CallOptions {
389
400
  /** group usage by: vm */
390
401
  group?: string;
391
402
  /** time range: cycle (current billing cycle), 24h, 7d, or 30d (default: cycle) */
392
403
  range?: string;
393
404
  }
394
- /** Options for {@link Commands.billingCreditsUsage}. */
405
+ /** Options for {@link ExedevClient.billingCreditsUsage}. */
395
406
  export interface BillingCreditsUsageOptions extends CallOptions {
396
407
  /** break each group down: models under a day or VM, VMs under a model */
397
408
  detail?: boolean;
@@ -400,26 +411,26 @@ export interface BillingCreditsUsageOptions extends CallOptions {
400
411
  /** calendar month to report, as YYYY-MM (default: this month, UTC) */
401
412
  month?: string;
402
413
  }
403
- /** Options for {@link Commands.billingCreditsTransactions}. */
414
+ /** Options for {@link ExedevClient.billingCreditsTransactions}. */
404
415
  export interface BillingCreditsTransactionsOptions extends CallOptions {
405
416
  /** how many transactions to show, 1-100 (default 20) */
406
417
  limit?: string;
407
418
  }
408
- /** Options for {@link Commands.billingCreditsBuy}. */
419
+ /** Options for {@link ExedevClient.billingCreditsBuy}. */
409
420
  export interface BillingCreditsBuyOptions extends CallOptions {
410
421
  /** retry key so a repeated purchase of the same amount charges once */
411
422
  "idempotency-key"?: string;
412
423
  /** skip the confirmation prompt (required when not running interactively) */
413
424
  yes?: boolean;
414
425
  }
415
- /** Options for {@link Commands.billingCapacity}. */
426
+ /** Options for {@link ExedevClient.billingCapacity}. */
416
427
  export interface BillingCapacityOptions extends CallOptions {
417
428
  /** Personal capacity in vCPUs: 2, 4, 8, or 16 */
418
429
  cpu?: number;
419
430
  /** skip interactive confirmation (required for non-interactive changes) */
420
431
  yes?: boolean;
421
432
  }
422
- /** Options for {@link Commands.billingUpdate}. */
433
+ /** Options for {@link ExedevClient.billingUpdate}. */
423
434
  export interface BillingUpdateOptions extends CallOptions {
424
435
  /** billing address city */
425
436
  "address-city"?: string;
@@ -446,31 +457,31 @@ export interface BillingUpdateOptions extends CallOptions {
446
457
  /** tax ID value shown on invoices */
447
458
  "tax-id-value"?: string;
448
459
  }
449
- /** Options for {@link Commands.billingInvoicesList}. */
460
+ /** Options for {@link ExedevClient.billingInvoicesList}. */
450
461
  export interface BillingInvoicesListOptions extends CallOptions {
451
462
  /** account whose invoices to list: personal or team (default: personal) */
452
463
  account?: string;
453
464
  }
454
- /** Options for {@link Commands.billingInvoicesShow}. */
465
+ /** Options for {@link ExedevClient.billingInvoicesShow}. */
455
466
  export interface BillingInvoicesShowOptions extends CallOptions {
456
467
  /** list VMs without a pool individually */
457
468
  vms?: boolean;
458
469
  }
459
- /** Options for {@link Commands.billingReceipts}. */
470
+ /** Options for {@link ExedevClient.billingReceipts}. */
460
471
  export interface BillingReceiptsOptions extends CallOptions {
461
472
  /** start of the period, YYYY-MM-DD */
462
473
  from?: string;
463
474
  /** end of the period, YYYY-MM-DD */
464
475
  to?: string;
465
476
  }
466
- /** Options for {@link Commands.billingStatement}. */
477
+ /** Options for {@link ExedevClient.billingStatement}. */
467
478
  export interface BillingStatementOptions extends CallOptions {
468
479
  /** start of the period, YYYY-MM-DD */
469
480
  from?: string;
470
481
  /** end of the period, YYYY-MM-DD */
471
482
  to?: string;
472
483
  }
473
- /** Options for {@link Commands.billingProviderLink}. */
484
+ /** Options for {@link ExedevClient.billingProviderLink}. */
474
485
  export interface BillingProviderLinkOptions extends CallOptions {
475
486
  /** team size: no marketplace team plans are available */
476
487
  size?: string;
@@ -479,22 +490,21 @@ export interface BillingProviderLinkOptions extends CallOptions {
479
490
  /** marketplace link token from the exe.dev link page */
480
491
  token?: string;
481
492
  }
482
- /** Options for {@link Commands.browser}. */
493
+ /** Options for {@link ExedevClient.browser}. */
483
494
  export interface BrowserOptions extends CallOptions {
484
495
  /** show QR code for the URL */
485
496
  qr?: boolean;
486
497
  }
487
- /** Options for {@link Commands.stat}. */
498
+ /** Options for {@link VM.stat}. */
488
499
  export interface StatOptions extends CallOptions {
489
500
  /** time range: 24h, 7d, or 30d (default: 24h) */
490
501
  range?: string;
491
502
  }
492
- export declare abstract class Commands {
493
- /**
494
- * Runs the command at path. Undefined args are omitted; options are written
495
- * as flags per flags, keyed by flag name.
496
- */
497
- protected abstract run(path: string, args: readonly Arg[], options: CallOptions | undefined, flags: Readonly<Record<string, FlagKind>>): Promise<any>;
503
+ export declare class ExedevClient {
504
+ #private;
505
+ constructor(options: ExedevOptions);
506
+ /** Reference an existing VM without a request. Use refresh() to fetch its metadata. */
507
+ vm(name: string): VM;
498
508
  /**
499
509
  * Browse documentation
500
510
  *
@@ -510,7 +520,7 @@ export declare abstract class Commands {
510
520
  *
511
521
  * Tag-scoped API keys may run this command.
512
522
  */
513
- ls(nameOrPattern?: string, options?: LsOptions): Promise<CommandResult<"ls">>;
523
+ ls(nameOrPattern?: string, options?: LsOptions): Promise<VM[]>;
514
524
  /**
515
525
  * Create a new VM
516
526
  *
@@ -528,225 +538,13 @@ export declare abstract class Commands {
528
538
  *
529
539
  * Tag-scoped API keys may run this command.
530
540
  */
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">>;
541
+ new(options?: NewOptions): Promise<VM>;
642
542
  /**
643
543
  * List custom domains for a VM (or -a for all your VMs)
644
544
  *
645
545
  * Usage: `domain ls <vm> | domain ls -a`
646
546
  */
647
547
  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
548
  /**
751
549
  * Show user information (email, keys, etc)
752
550
  *
@@ -1392,19 +1190,252 @@ export declare abstract class Commands {
1392
1190
  */
1393
1191
  inviteManage(options?: CallOptions): Promise<CommandResult<"invite manage">>;
1394
1192
  /**
1395
- * Install or upgrade Shelley to the current version
1193
+ * Generate a magic link to log in to the website
1396
1194
  *
1397
- * Usage: `shelley install <vm>`
1195
+ * Usage: `browser`
1196
+ */
1197
+ browser(options?: BrowserOptions): Promise<CommandResult<"browser">>;
1198
+ }
1199
+ /** A VM reference. info is a snapshot; refresh() fetches current metadata. */
1200
+ export declare class VM {
1201
+ #private;
1202
+ /** @internal Obtain VMs through exe.new(), exe.ls(), exe.vm(), or vm.cp(). */
1203
+ constructor(transport: Transport, info: VMInfo);
1204
+ get info(): Readonly<VMInfo>;
1205
+ get name(): string;
1206
+ get httpsUrl(): string | undefined;
1207
+ get sshDest(): string | undefined;
1208
+ get tags(): readonly string[];
1209
+ /** Run a shell command once. Nonzero exit codes are results, not exceptions. */
1210
+ ssh(command: string, options?: SSHOptions): Promise<SSHResult>;
1211
+ /** Refresh metadata without changing this reference's identity. Requires ls permission. */
1212
+ refresh(options?: CallOptions): Promise<this>;
1213
+ /**
1214
+ * Probe SSH with `true` until it exits successfully. Never reruns a user command.
1215
+ * The default deadline is 60 seconds, including requests and backoff. This does
1216
+ * not wait for application servers or setup scripts. Requires ssh permission.
1217
+ */
1218
+ waitUntilReady(options?: WaitOptions): Promise<this>;
1219
+ /**
1220
+ * Delete a VM
1221
+ *
1222
+ * Usage: `rm <vmname>...`
1398
1223
  *
1399
1224
  * Tag-scoped API keys may run this command.
1400
1225
  */
1401
- shelleyInstall(vm: string, options?: CallOptions): Promise<CommandResult<"shelley install">>;
1226
+ rm(options?: CallOptions): Promise<CommandResult<"rm">>;
1402
1227
  /**
1403
- * Generate a magic link to log in to the website
1228
+ * Restart a VM
1404
1229
  *
1405
- * Usage: `browser`
1230
+ * Usage: `restart <vmname>`
1231
+ *
1232
+ * Tag-scoped API keys may run this command.
1406
1233
  */
1407
- browser(options?: BrowserOptions): Promise<CommandResult<"browser">>;
1234
+ restart(options?: ReadyOptions): Promise<this>;
1235
+ /**
1236
+ * Pause a VM (snapshot RAM to disk, free its CPU and memory)
1237
+ *
1238
+ * Usage: `pause <vmname>`
1239
+ *
1240
+ * CLI examples:
1241
+ * ```
1242
+ * pause my-vm # snapshot RAM to disk; resume later with 'resume my-vm'
1243
+ * ```
1244
+ *
1245
+ * Tag-scoped API keys may run this command.
1246
+ */
1247
+ pause(options?: CallOptions): Promise<CommandResult<"pause">>;
1248
+ /**
1249
+ * Resume a paused VM (restore RAM from disk)
1250
+ *
1251
+ * Usage: `resume <vmname>`
1252
+ *
1253
+ * Tag-scoped API keys may run this command.
1254
+ */
1255
+ resume(options?: ReadyOptions): Promise<this>;
1256
+ /**
1257
+ * rename a vm
1258
+ *
1259
+ * Usage: `rename <oldname> <newname>`
1260
+ *
1261
+ * Tag-scoped API keys may run this command.
1262
+ */
1263
+ rename(newname: string, options?: CallOptions): Promise<this>;
1264
+ /**
1265
+ * Add or remove tags on a VM
1266
+ *
1267
+ * Usage: `tag [-d] <vm> <tag-name> [tag-name...]`
1268
+ *
1269
+ * CLI examples:
1270
+ * ```
1271
+ * tag my-vm prod web # add tags
1272
+ * tag -d my-vm prod web # remove tags
1273
+ * ```
1274
+ *
1275
+ * Tag-scoped API keys may run this command.
1276
+ */
1277
+ tag(tagNames: string | readonly string[], options?: TagOptions): Promise<CommandResult<"tag">>;
1278
+ /**
1279
+ * Copy an existing VM
1280
+ *
1281
+ * Usage: `cp <source-vm> [new-name] [--pool=<name>] [--memory=<size>] [--cpu=<count>] [--disk=<size>]`
1282
+ *
1283
+ * CLI examples:
1284
+ * ```
1285
+ * cp my-vm # copy with auto-generated name
1286
+ * cp my-vm my-vm-copy # copy with specific name
1287
+ * cp my-vm --cpu=4 --memory=16GB # copy with different resources
1288
+ * cp my-vm my-pool-copy --pool=build # copy into a team pool
1289
+ * cp my-vm --copy-tags=false # copy without tags
1290
+ * ```
1291
+ *
1292
+ * Tag-scoped API keys may run this command.
1293
+ */
1294
+ cp(options?: CpOptions): Promise<VM>;
1295
+ /**
1296
+ * Resize a VM's resources (memory, CPU, disk)
1297
+ *
1298
+ * Usage: `resize <vmname> [--memory=<size>] [--cpu=<count>] [--disk=<size>]`
1299
+ *
1300
+ * Tag-scoped API keys may run this command.
1301
+ */
1302
+ resize(options?: ResizeOptions): Promise<CommandResult<"resize">>;
1303
+ /**
1304
+ * Set or clear a short comment on a VM
1305
+ *
1306
+ * Usage: `comment <hostname> <text>`
1307
+ *
1308
+ * CLI examples:
1309
+ * ```
1310
+ * comment my-vm staging copy
1311
+ * comment my-vm "" # clear the comment
1312
+ * ```
1313
+ *
1314
+ * Tag-scoped API keys may run this command.
1315
+ */
1316
+ comment(text: string, options?: CallOptions): Promise<CommandResult<"comment">>;
1317
+ /**
1318
+ * Link a custom domain to a VM
1319
+ *
1320
+ * Usage: `domain add [--wildcard] <vm> <domain>`
1321
+ */
1322
+ domainAdd(domain: string, options?: DomainAddOptions): Promise<CommandResult<"domain add">>;
1323
+ /**
1324
+ * Remove a custom domain from a VM
1325
+ *
1326
+ * Usage: `domain rm <vm> <domain>`
1327
+ */
1328
+ domainRm(domain: string, options?: CallOptions): Promise<CommandResult<"domain rm">>;
1329
+ /**
1330
+ * Show current shares for a VM
1331
+ *
1332
+ * Usage: `share show <vm>`
1333
+ *
1334
+ * Tag-scoped API keys may run this command.
1335
+ */
1336
+ shareShow(options?: ShareShowOptions): Promise<CommandResult<"share show">>;
1337
+ /**
1338
+ * Set the HTTP proxy port for a VM
1339
+ *
1340
+ * Usage: `share port <vm> [port]`
1341
+ *
1342
+ * CLI examples:
1343
+ * ```
1344
+ * share port mybox 8080
1345
+ * ```
1346
+ *
1347
+ * Tag-scoped API keys may run this command.
1348
+ */
1349
+ sharePort(port?: string, options?: CallOptions): Promise<CommandResult<"share port">>;
1350
+ /**
1351
+ * Make the HTTP proxy publicly accessible
1352
+ *
1353
+ * Usage: `share set-public <vm>`
1354
+ *
1355
+ * Tag-scoped API keys may run this command.
1356
+ */
1357
+ shareSetPublic(options?: CallOptions): Promise<CommandResult<"share set-public">>;
1358
+ /**
1359
+ * Restrict the HTTP proxy to authenticated users
1360
+ *
1361
+ * Usage: `share set-private <vm>`
1362
+ *
1363
+ * Tag-scoped API keys may run this command.
1364
+ */
1365
+ shareSetPrivate(options?: CallOptions): Promise<CommandResult<"share set-private">>;
1366
+ /**
1367
+ * Share VM with a user via email, or grant shell access with --root
1368
+ *
1369
+ * Usage: `share add <vm> <email|team> [--root] [--message='...']`
1370
+ *
1371
+ * CLI examples:
1372
+ * ```
1373
+ * share add mybox user@example.com
1374
+ * share add mybox user@example.com --message='Check this out'
1375
+ * share add mybox team
1376
+ * share add mybox teammate@example.com --root
1377
+ * share add mybox team --root
1378
+ * ```
1379
+ *
1380
+ * Tag-scoped API keys may run this command.
1381
+ */
1382
+ shareAdd(emailOrTeam: string, options?: ShareAddOptions): Promise<CommandResult<"share add">>;
1383
+ /**
1384
+ * Revoke a user's access to a VM, or downgrade shell access to web with --root
1385
+ *
1386
+ * Usage: `share remove <vm> <email|team> [--root]`
1387
+ *
1388
+ * CLI examples:
1389
+ * ```
1390
+ * share remove mybox user@example.com
1391
+ * share remove mybox team
1392
+ * share remove mybox teammate@example.com --root
1393
+ * share remove mybox team --root
1394
+ * ```
1395
+ *
1396
+ * Tag-scoped API keys may run this command.
1397
+ */
1398
+ shareRemove(emailOrTeam: string, options?: ShareRemoveOptions): Promise<CommandResult<"share remove">>;
1399
+ /**
1400
+ * Create a shareable link for a VM
1401
+ *
1402
+ * Usage: `share add-link <vm>`
1403
+ *
1404
+ * Tag-scoped API keys may run this command.
1405
+ */
1406
+ shareAddLink(options?: ShareAddLinkOptions): Promise<CommandResult<"share add-link">>;
1407
+ /**
1408
+ * Revoke a shareable link
1409
+ *
1410
+ * Usage: `share remove-link <vm> <token>`
1411
+ *
1412
+ * Tag-scoped API keys may run this command.
1413
+ */
1414
+ shareRemoveLink(token: string, options?: CallOptions): Promise<CommandResult<"share remove-link">>;
1415
+ /**
1416
+ * Enable or disable inbound email for a VM
1417
+ *
1418
+ * Usage: `share receive-email <vm> [on|off] [--reply-policy=all|known|owner|none]`
1419
+ *
1420
+ * CLI examples:
1421
+ * ```
1422
+ * share receive-email mybox on
1423
+ * share receive-email mybox off
1424
+ * share receive-email mybox --reply-policy=known
1425
+ * share receive-email mybox
1426
+ * ```
1427
+ *
1428
+ * Tag-scoped API keys may run this command.
1429
+ */
1430
+ shareReceiveEmail(onOrOff?: "on" | "off", options?: ShareReceiveEmailOptions): Promise<CommandResult<"share receive-email">>;
1431
+ /**
1432
+ * Install or upgrade Shelley to the current version
1433
+ *
1434
+ * Usage: `shelley install <vm>`
1435
+ *
1436
+ * Tag-scoped API keys may run this command.
1437
+ */
1438
+ shelleyInstall(options?: CallOptions): Promise<CommandResult<"shelley install">>;
1408
1439
  /**
1409
1440
  * Allow exe.dev support to log in to a VM
1410
1441
  *
@@ -1412,7 +1443,7 @@ export declare abstract class Commands {
1412
1443
  *
1413
1444
  * Tag-scoped API keys may run this command.
1414
1445
  */
1415
- grantSupportRoot(vmname: string, onOrOff: "on" | "off", options?: CallOptions): Promise<CommandResult<"grant-support-root">>;
1446
+ grantSupportRoot(onOrOff: "on" | "off", options?: CallOptions): Promise<CommandResult<"grant-support-root">>;
1416
1447
  /**
1417
1448
  * Show vCPU, disk, IO, and network (RX/TX) metrics for a VM
1418
1449
  *
@@ -1427,6 +1458,11 @@ export declare abstract class Commands {
1427
1458
  *
1428
1459
  * Tag-scoped API keys may run this command.
1429
1460
  */
1430
- stat(vmName: string, options?: StatOptions): Promise<CommandResult<"stat">>;
1461
+ stat(options?: StatOptions): Promise<CommandResult<"stat">>;
1462
+ }
1463
+ /** Readiness failed after a VM was obtained/created. The VM is not deleted. */
1464
+ export declare class VMReadyError extends Error {
1465
+ readonly vm: VM;
1466
+ constructor(vm: VM, cause: unknown);
1431
1467
  }
1432
1468
  //# sourceMappingURL=commands.gen.d.ts.map