@capuchoo/cli 0.2.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/README.md +233 -26
  2. package/dist/base-command.d.ts +1 -1
  3. package/dist/base-command.js +1 -1
  4. package/dist/cli/prompts.d.ts +43 -0
  5. package/dist/cli/prompts.d.ts.map +1 -0
  6. package/dist/cli/prompts.js +137 -0
  7. package/dist/cli/prompts.js.map +1 -0
  8. package/dist/commands/app/delete.d.ts +20 -0
  9. package/dist/commands/app/delete.d.ts.map +1 -0
  10. package/dist/commands/app/delete.js +71 -0
  11. package/dist/commands/app/delete.js.map +1 -0
  12. package/dist/commands/app/list.d.ts +9 -0
  13. package/dist/commands/app/list.d.ts.map +1 -0
  14. package/dist/commands/app/list.js +40 -0
  15. package/dist/commands/app/list.js.map +1 -0
  16. package/dist/commands/auth/login.d.ts.map +1 -1
  17. package/dist/commands/auth/login.js +10 -13
  18. package/dist/commands/auth/login.js.map +1 -1
  19. package/dist/commands/auth/logout.js +2 -2
  20. package/dist/commands/auth/logout.js.map +1 -1
  21. package/dist/commands/auth/whoami.d.ts.map +1 -1
  22. package/dist/commands/auth/whoami.js +14 -2
  23. package/dist/commands/auth/whoami.js.map +1 -1
  24. package/dist/commands/channel/create.d.ts +25 -0
  25. package/dist/commands/channel/create.d.ts.map +1 -0
  26. package/dist/commands/channel/create.js +96 -0
  27. package/dist/commands/channel/create.js.map +1 -0
  28. package/dist/commands/channel/delete.d.ts +19 -0
  29. package/dist/commands/channel/delete.d.ts.map +1 -0
  30. package/dist/commands/channel/delete.js +66 -0
  31. package/dist/commands/channel/delete.js.map +1 -0
  32. package/dist/commands/channel/list.js +1 -1
  33. package/dist/commands/channel/list.js.map +1 -1
  34. package/dist/commands/doctor.d.ts +28 -0
  35. package/dist/commands/doctor.d.ts.map +1 -0
  36. package/dist/commands/doctor.js +278 -0
  37. package/dist/commands/doctor.js.map +1 -0
  38. package/dist/commands/init.d.ts +11 -0
  39. package/dist/commands/init.d.ts.map +1 -1
  40. package/dist/commands/init.js +151 -58
  41. package/dist/commands/init.js.map +1 -1
  42. package/dist/commands/org/create.d.ts +19 -0
  43. package/dist/commands/org/create.d.ts.map +1 -0
  44. package/dist/commands/org/create.js +45 -0
  45. package/dist/commands/org/create.js.map +1 -0
  46. package/dist/commands/org/list.d.ts +9 -0
  47. package/dist/commands/org/list.d.ts.map +1 -0
  48. package/dist/commands/org/list.js +41 -0
  49. package/dist/commands/org/list.js.map +1 -0
  50. package/dist/commands/setup.d.ts +16 -0
  51. package/dist/commands/setup.d.ts.map +1 -0
  52. package/dist/commands/setup.js +168 -0
  53. package/dist/commands/setup.js.map +1 -0
  54. package/dist/deploy/execute.d.ts.map +1 -1
  55. package/dist/deploy/execute.js +43 -30
  56. package/dist/deploy/execute.js.map +1 -1
  57. package/dist/pipeline/build.js +1 -1
  58. package/dist/pipeline/build.js.map +1 -1
  59. package/dist/pipeline/capacitor-support.d.ts +53 -0
  60. package/dist/pipeline/capacitor-support.d.ts.map +1 -0
  61. package/dist/pipeline/capacitor-support.js +95 -0
  62. package/dist/pipeline/capacitor-support.js.map +1 -0
  63. package/dist/pipeline/deploy.js +1 -1
  64. package/dist/pipeline/deploy.js.map +1 -1
  65. package/dist/pipeline/flavour.js +1 -1
  66. package/dist/pipeline/flavour.js.map +1 -1
  67. package/dist/services/cloud.d.ts +22 -2
  68. package/dist/services/cloud.d.ts.map +1 -1
  69. package/dist/services/cloud.js +26 -3
  70. package/dist/services/cloud.js.map +1 -1
  71. package/dist/utils/config.d.ts +1 -1
  72. package/dist/utils/config.js +3 -3
  73. package/dist/utils/config.js.map +1 -1
  74. package/dist/utils/http.d.ts +2 -0
  75. package/dist/utils/http.d.ts.map +1 -1
  76. package/dist/utils/http.js +4 -0
  77. package/dist/utils/http.js.map +1 -1
  78. package/oclif.manifest.json +352 -5
  79. package/package.json +13 -6
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  @capuchoo/cli
2
2
  =============
3
3
 
4
- Capuchooo CLI bundles and uploads your application to the cloud. It packages builds as native
4
+ Capuchoo CLI bundles and uploads your application to the cloud. It packages builds as native
5
5
  artifacts or ZIP files, then publishes them using user-defined parameters such as channels and
6
6
  custom release options. Built for simple, repeatable deployments, it integrates cleanly into local
7
7
  workflows and CI pipelines to ship updates quickly and reliably.
@@ -29,7 +29,7 @@ $ npm install -g @capuchoo/cli
29
29
  $ capuchoo COMMAND
30
30
  running command...
31
31
  $ capuchoo (--version)
32
- @capuchoo/cli/0.2.0 win32-x64 node-v26.4.0
32
+ @capuchoo/cli/0.4.0 win32-x64 node-v26.4.0
33
33
  $ capuchoo --help [COMMAND]
34
34
  USAGE
35
35
  $ capuchoo COMMAND
@@ -42,22 +42,72 @@ USAGE
42
42
 
43
43
  <!-- commands -->
44
44
 
45
+ - [`capuchoo app delete [APPID]`](#capuchoo-app-delete-appid)
46
+ - [`capuchoo app list`](#capuchoo-app-list)
45
47
  - [`capuchoo auth login`](#capuchoo-auth-login)
46
48
  - [`capuchoo auth logout`](#capuchoo-auth-logout)
47
49
  - [`capuchoo auth whoami`](#capuchoo-auth-whoami)
50
+ - [`capuchoo channel create [NAME]`](#capuchoo-channel-create-name)
51
+ - [`capuchoo channel delete [NAME]`](#capuchoo-channel-delete-name)
48
52
  - [`capuchoo channel list`](#capuchoo-channel-list)
49
53
  - [`capuchoo config list`](#capuchoo-config-list)
50
54
  - [`capuchoo config set KEY VALUE`](#capuchoo-config-set-key-value)
51
55
  - [`capuchoo deploy native`](#capuchoo-deploy-native)
52
56
  - [`capuchoo deploy ota`](#capuchoo-deploy-ota)
57
+ - [`capuchoo doctor`](#capuchoo-doctor)
53
58
  - [`capuchoo help [COMMAND]`](#capuchoo-help-command)
54
59
  - [`capuchoo init`](#capuchoo-init)
60
+ - [`capuchoo org create [NAME]`](#capuchoo-org-create-name)
61
+ - [`capuchoo org list`](#capuchoo-org-list)
62
+ - [`capuchoo setup`](#capuchoo-setup)
55
63
  - [`capuchoo version bump TYPE`](#capuchoo-version-bump-type)
56
64
  - [`capuchoo version sync`](#capuchoo-version-sync)
57
65
 
66
+ ## `capuchoo app delete [APPID]`
67
+
68
+ Delete an app, its channels and its bundles
69
+
70
+ ```
71
+ USAGE
72
+ $ capuchoo app delete [APPID] [-y]
73
+
74
+ ARGUMENTS
75
+ [APPID] Bundle identifier of the app to delete
76
+
77
+ FLAGS
78
+ -y, --yes Skip the confirmation (scripts and CI)
79
+
80
+ DESCRIPTION
81
+ Delete an app, its channels and its bundles
82
+
83
+ EXAMPLES
84
+ $ capuchoo app delete com.company.app
85
+ ```
86
+
87
+ _See code:
88
+ [src/commands/app/delete.ts](https://github.com/aybinv7/capuchoo/blob/v0.4.0/src/commands/app/delete.ts)_
89
+
90
+ ## `capuchoo app list`
91
+
92
+ List the apps this account can reach
93
+
94
+ ```
95
+ USAGE
96
+ $ capuchoo app list [--json]
97
+
98
+ FLAGS
99
+ --json Machine-readable output
100
+
101
+ DESCRIPTION
102
+ List the apps this account can reach
103
+ ```
104
+
105
+ _See code:
106
+ [src/commands/app/list.ts](https://github.com/aybinv7/capuchoo/blob/v0.4.0/src/commands/app/list.ts)_
107
+
58
108
  ## `capuchoo auth login`
59
109
 
60
- Store an API key for the Capuchooo backend
110
+ Store an API key for the Capuchoo backend
61
111
 
62
112
  ```
63
113
  USAGE
@@ -68,16 +118,16 @@ FLAGS
68
118
  -k, --api-key=<value> API key from Settings > API Keys in the dashboard
69
119
 
70
120
  DESCRIPTION
71
- Store an API key for the Capuchooo backend
121
+ Store an API key for the Capuchoo backend
72
122
 
73
123
  EXAMPLES
74
124
  $ capuchoo auth login
75
125
 
76
- $ capuchoo auth login --endpoint https://capuchoo.internal --api-key cap_...
126
+ $ capuchoo auth login --endpoint https://capucho.internal --api-key cap_...
77
127
  ```
78
128
 
79
129
  _See code:
80
- [src/commands/auth/login.ts](https://github.com/aybinv7/capuchoo/blob/v0.2.0/src/commands/auth/login.ts)_
130
+ [src/commands/auth/login.ts](https://github.com/aybinv7/capuchoo/blob/v0.4.0/src/commands/auth/login.ts)_
81
131
 
82
132
  ## `capuchoo auth logout`
83
133
 
@@ -92,7 +142,7 @@ DESCRIPTION
92
142
  ```
93
143
 
94
144
  _See code:
95
- [src/commands/auth/logout.ts](https://github.com/aybinv7/capuchoo/blob/v0.2.0/src/commands/auth/logout.ts)_
145
+ [src/commands/auth/logout.ts](https://github.com/aybinv7/capuchoo/blob/v0.4.0/src/commands/auth/logout.ts)_
96
146
 
97
147
  ## `capuchoo auth whoami`
98
148
 
@@ -110,7 +160,64 @@ DESCRIPTION
110
160
  ```
111
161
 
112
162
  _See code:
113
- [src/commands/auth/whoami.ts](https://github.com/aybinv7/capuchoo/blob/v0.2.0/src/commands/auth/whoami.ts)_
163
+ [src/commands/auth/whoami.ts](https://github.com/aybinv7/capuchoo/blob/v0.4.0/src/commands/auth/whoami.ts)_
164
+
165
+ ## `capuchoo channel create [NAME]`
166
+
167
+ Create a channel for this app
168
+
169
+ ```
170
+ USAGE
171
+ $ capuchoo channel create [NAME] [-e dev|staging|prod] [-y] [--json]
172
+
173
+ ARGUMENTS
174
+ [NAME] Name of the channel, e.g. staging
175
+
176
+ FLAGS
177
+ -e, --environment=<option> Which build flavour this channel serves
178
+ <options: dev|staging|prod>
179
+ -y, --yes Accept the environment even when it disagrees with the name
180
+ --json Machine-readable output
181
+
182
+ DESCRIPTION
183
+ Create a channel for this app
184
+
185
+ EXAMPLES
186
+ $ capuchoo channel create staging
187
+
188
+ $ capuchoo channel create beta --environment staging
189
+
190
+ $ capuchoo channel create prod --environment prod --yes
191
+ ```
192
+
193
+ _See code:
194
+ [src/commands/channel/create.ts](https://github.com/aybinv7/capuchoo/blob/v0.4.0/src/commands/channel/create.ts)_
195
+
196
+ ## `capuchoo channel delete [NAME]`
197
+
198
+ Delete one of this app's channels
199
+
200
+ ```
201
+ USAGE
202
+ $ capuchoo channel delete [NAME] [-y]
203
+
204
+ ARGUMENTS
205
+ [NAME] Name of the channel to delete
206
+
207
+ FLAGS
208
+ -y, --yes Skip the confirmation
209
+
210
+ DESCRIPTION
211
+ Delete one of this app's channels
212
+
213
+ EXAMPLES
214
+ $ capuchoo channel delete beta
215
+
216
+ $ capuchoo channel delete beta --yes
217
+ ```
218
+
219
+ _See code:
220
+ [src/commands/channel/delete.ts](https://github.com/aybinv7/capuchoo/blob/v0.4.0/src/commands/channel/delete.ts)_
114
221
 
115
222
  ## `capuchoo channel list`
116
223
 
@@ -128,7 +235,7 @@ DESCRIPTION
128
235
  ```
129
236
 
130
237
  _See code:
131
- [src/commands/channel/list.ts](https://github.com/aybinv7/capuchoo/blob/v0.2.0/src/commands/channel/list.ts)_
238
+ [src/commands/channel/list.ts](https://github.com/aybinv7/capuchoo/blob/v0.4.0/src/commands/channel/list.ts)_
132
239
 
133
240
  ## `capuchoo config list`
134
241
 
@@ -146,7 +253,7 @@ DESCRIPTION
146
253
  ```
147
254
 
148
255
  _See code:
149
- [src/commands/config/list.ts](https://github.com/aybinv7/capuchoo/blob/v0.2.0/src/commands/config/list.ts)_
256
+ [src/commands/config/list.ts](https://github.com/aybinv7/capuchoo/blob/v0.4.0/src/commands/config/list.ts)_
150
257
 
151
258
  ## `capuchoo config set KEY VALUE`
152
259
 
@@ -164,13 +271,13 @@ DESCRIPTION
164
271
  Set a user preference in ~/.capuchoo/config.json
165
272
 
166
273
  EXAMPLES
167
- $ capuchoo config set endpoint https://capuchoo.internal
274
+ $ capuchoo config set endpoint https://capucho.internal
168
275
 
169
276
  $ capuchoo config set defaultChannel staging
170
277
  ```
171
278
 
172
279
  _See code:
173
- [src/commands/config/set.ts](https://github.com/aybinv7/capuchoo/blob/v0.2.0/src/commands/config/set.ts)_
280
+ [src/commands/config/set.ts](https://github.com/aybinv7/capuchoo/blob/v0.4.0/src/commands/config/set.ts)_
174
281
 
175
282
  ## `capuchoo deploy native`
176
283
 
@@ -178,8 +285,8 @@ Build and publish a native binary (APK). Users install it through the OS.
178
285
 
179
286
  ```
180
287
  USAGE
181
- $ capuchoo deploy native [-c <value>] [-n <value>] [-v major|minor|patch] [-a] [-r] [--skip-assets] [--skip-build]
182
- [--dry-run] [--json] [--verbose] [-y] [-p android|ios] [-t debug|release] [--allow-unsigned]
288
+ $ capuchoo deploy native [-c <value>] [-n <value>] [-v major|minor|patch] [-a] [-r] [--skip-assets]
289
+ [--skip-build] [--dry-run] [--json] [--verbose] [-y] [-p android|ios] [-t debug|release] [--allow-unsigned]
183
290
 
184
291
  FLAGS
185
292
  -a, --[no-]active Serve this release immediately
@@ -212,7 +319,7 @@ EXAMPLES
212
319
  ```
213
320
 
214
321
  _See code:
215
- [src/commands/deploy/native.ts](https://github.com/aybinv7/capuchoo/blob/v0.2.0/src/commands/deploy/native.ts)_
322
+ [src/commands/deploy/native.ts](https://github.com/aybinv7/capuchoo/blob/v0.4.0/src/commands/deploy/native.ts)_
216
323
 
217
324
  ## `capuchoo deploy ota`
218
325
 
@@ -220,8 +327,8 @@ Publish a web bundle over the air. Does not change the installed binary.
220
327
 
221
328
  ```
222
329
  USAGE
223
- $ capuchoo deploy ota [-c <value>] [-n <value>] [-v major|minor|patch] [-a] [-r] [--skip-assets] [--skip-build]
224
- [--dry-run] [--json] [--verbose] [-y]
330
+ $ capuchoo deploy ota [-c <value>] [-n <value>] [-v major|minor|patch] [-a] [-r] [--skip-assets]
331
+ [--skip-build] [--dry-run] [--json] [--verbose] [-y]
225
332
 
226
333
  FLAGS
227
334
  -a, --[no-]active Serve this release immediately
@@ -249,7 +356,25 @@ EXAMPLES
249
356
  ```
250
357
 
251
358
  _See code:
252
- [src/commands/deploy/ota.ts](https://github.com/aybinv7/capuchoo/blob/v0.2.0/src/commands/deploy/ota.ts)_
359
+ [src/commands/deploy/ota.ts](https://github.com/aybinv7/capuchoo/blob/v0.4.0/src/commands/deploy/ota.ts)_
360
+
361
+ ## `capuchoo doctor`
362
+
363
+ Check that this app, its credentials and its channels are usable
364
+
365
+ ```
366
+ USAGE
367
+ $ capuchoo doctor
368
+
369
+ DESCRIPTION
370
+ Check that this app, its credentials and its channels are usable
371
+
372
+ EXAMPLES
373
+ $ capuchoo doctor
374
+ ```
375
+
376
+ _See code:
377
+ [src/commands/doctor.ts](https://github.com/aybinv7/capuchoo/blob/v0.4.0/src/commands/doctor.ts)_
253
378
 
254
379
  ## `capuchoo help [COMMAND]`
255
380
 
@@ -274,27 +399,109 @@ _See code:
274
399
 
275
400
  ## `capuchoo init`
276
401
 
277
- Link this directory to a Capuchooo app and write .capuchoo/project.json
402
+ Link this directory to a Capuchoo app and write .capuchoo/project.json
278
403
 
279
404
  ```
280
405
  USAGE
281
- $ capuchoo init [-l] [-f]
406
+ $ capuchoo init [-l | -c] [--name <value> ] [--app-id <value>] [--org <value> ] [--channel <value>] [-f]
282
407
 
283
408
  FLAGS
284
- -f, --force Overwrite an existing project.json
285
- -l, --link Link an existing app instead of creating one
409
+ -c, --create Create a new app instead of asking
410
+ -f, --force Overwrite an existing project.json
411
+ -l, --link Link an existing app instead of asking
412
+ --app-id=<value> Bundle identifier of the app, e.g. com.company.app
413
+ --channel=<value> Create this channel after linking, e.g. staging
414
+ --name=<value> Name of the app to create (default: this directory's name)
415
+ --org=<value> Organization to create the app in, by name or id
286
416
 
287
417
  DESCRIPTION
288
- Link this directory to a Capuchooo app and write .capuchoo/project.json
418
+ Link this directory to a Capuchoo app and write .capuchoo/project.json
289
419
 
290
420
  EXAMPLES
291
421
  $ capuchoo init
292
422
 
293
423
  $ capuchoo init --link
424
+
425
+ $ capuchoo init --create
426
+
427
+ $ capuchoo init --create --name "My App" --app-id com.acme.app --channel staging
428
+ ```
429
+
430
+ _See code:
431
+ [src/commands/init.ts](https://github.com/aybinv7/capuchoo/blob/v0.4.0/src/commands/init.ts)_
432
+
433
+ ## `capuchoo org create [NAME]`
434
+
435
+ Create an organization
436
+
437
+ ```
438
+ USAGE
439
+ $ capuchoo org create [NAME] [--json]
440
+
441
+ ARGUMENTS
442
+ [NAME] Display name of the organization
443
+
444
+ FLAGS
445
+ --json Machine-readable output
446
+
447
+ DESCRIPTION
448
+ Create an organization
449
+
450
+ EXAMPLES
451
+ $ capuchoo org create "SIG Service"
452
+
453
+ $ capuchoo org create Acme --json
454
+ ```
455
+
456
+ _See code:
457
+ [src/commands/org/create.ts](https://github.com/aybinv7/capuchoo/blob/v0.4.0/src/commands/org/create.ts)_
458
+
459
+ ## `capuchoo org list`
460
+
461
+ List the organizations this account belongs to
462
+
463
+ ```
464
+ USAGE
465
+ $ capuchoo org list [--json]
466
+
467
+ FLAGS
468
+ --json Machine-readable output
469
+
470
+ DESCRIPTION
471
+ List the organizations this account belongs to
472
+ ```
473
+
474
+ _See code:
475
+ [src/commands/org/list.ts](https://github.com/aybinv7/capuchoo/blob/v0.4.0/src/commands/org/list.ts)_
476
+
477
+ ## `capuchoo setup`
478
+
479
+ Install everything this app needs to receive updates
480
+
481
+ ```
482
+ USAGE
483
+ $ capuchoo setup [--native] [--skip-telemetry] [--skip-sync] [--dry-run] [-y]
484
+
485
+ FLAGS
486
+ -y, --yes Accept every prompt
487
+ --dry-run Report what would be installed, change nothing
488
+ --native Also install what downloading and installing an APK needs
489
+ --skip-sync Do not run cap sync afterwards
490
+ --skip-telemetry Do not install @capacitor/device
491
+
492
+ DESCRIPTION
493
+ Install everything this app needs to receive updates
494
+
495
+ EXAMPLES
496
+ $ capuchoo setup
497
+
498
+ $ capuchoo setup --native
499
+
500
+ $ capuchoo setup --dry-run
294
501
  ```
295
502
 
296
503
  _See code:
297
- [src/commands/init.ts](https://github.com/aybinv7/capuchoo/blob/v0.2.0/src/commands/init.ts)_
504
+ [src/commands/setup.ts](https://github.com/aybinv7/capuchoo/blob/v0.4.0/src/commands/setup.ts)_
298
505
 
299
506
  ## `capuchoo version bump TYPE`
300
507
 
@@ -321,7 +528,7 @@ EXAMPLES
321
528
  ```
322
529
 
323
530
  _See code:
324
- [src/commands/version/bump.ts](https://github.com/aybinv7/capuchoo/blob/v0.2.0/src/commands/version/bump.ts)_
531
+ [src/commands/version/bump.ts](https://github.com/aybinv7/capuchoo/blob/v0.4.0/src/commands/version/bump.ts)_
325
532
 
326
533
  ## `capuchoo version sync`
327
534
 
@@ -347,5 +554,5 @@ EXAMPLES
347
554
  ```
348
555
 
349
556
  _See code:
350
- [src/commands/version/sync.ts](https://github.com/aybinv7/capuchoo/blob/v0.2.0/src/commands/version/sync.ts)_
557
+ [src/commands/version/sync.ts](https://github.com/aybinv7/capuchoo/blob/v0.4.0/src/commands/version/sync.ts)_
351
558
  <!-- commandsstop -->
@@ -1,6 +1,6 @@
1
1
  import { Command } from "@oclif/core";
2
2
  /**
3
- * Base class for every Capucho command.
3
+ * Base class for every Capuchoo command.
4
4
  *
5
5
  * Two jobs, both about failure. oclif's default renderer prints the error class
6
6
  * name and a stack-shaped indent, which for a deploy tool buries the one line
@@ -2,7 +2,7 @@ import { Command } from "@oclif/core";
2
2
  import chalk from "chalk";
3
3
  import { HttpError } from "./utils/http.js";
4
4
  /**
5
- * Base class for every Capucho command.
5
+ * Base class for every Capuchoo command.
6
6
  *
7
7
  * Two jobs, both about failure. oclif's default renderer prints the error class
8
8
  * name and a stack-shaped indent, which for a deploy tool buries the one line
@@ -0,0 +1,43 @@
1
+ export declare class PromptCancelled extends Error {
2
+ constructor();
3
+ }
4
+ /** Raised when a prompt is unanswerable, naming the flag that replaces it. */
5
+ export declare class NonInteractive extends Error {
6
+ constructor(question: string, flag: string);
7
+ }
8
+ export interface Choice<T> {
9
+ value: T;
10
+ label: string;
11
+ hint?: string | undefined;
12
+ }
13
+ export declare function isInteractive(): boolean;
14
+ export declare function intro(title: string): void;
15
+ export declare function outro(message: string): void;
16
+ export declare const log: {
17
+ info: (message: string) => void;
18
+ step: (message: string) => void;
19
+ warn: (message: string) => void;
20
+ error: (message: string) => void;
21
+ success: (message: string) => void;
22
+ message: (message: string) => void;
23
+ };
24
+ /** A boxed aside - for the "here is what happens next" moments. */
25
+ export declare function note(body: string, title?: string): void;
26
+ export declare function spinner(): {
27
+ start: (m: string) => void;
28
+ stop: (m?: string) => void;
29
+ };
30
+ export declare function selectOne<T>(question: string, choices: Choice<T>[], flag: string): Promise<T>;
31
+ export declare function confirm(question: string, options?: {
32
+ default?: boolean;
33
+ flag?: string;
34
+ }): Promise<boolean>;
35
+ export declare function askText(question: string, options: {
36
+ placeholder?: string;
37
+ initial?: string;
38
+ flag: string;
39
+ validate?: (v: string) => string | undefined;
40
+ optional?: boolean;
41
+ }): Promise<string>;
42
+ export declare function askSecret(question: string): Promise<string>;
43
+ //# sourceMappingURL=prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/cli/prompts.ts"],"names":[],"mappings":"AAoBA,qBAAa,eAAgB,SAAQ,KAAK;;CAKzC;AAED,8EAA8E;AAC9E,qBAAa,cAAe,SAAQ,KAAK;gBAC3B,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAI3C;AAED,MAAM,WAAW,MAAM,CAAC,CAAC;IACvB,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B;AAED,wBAAgB,aAAa,IAAI,OAAO,CAEvC;AAOD,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAEzC;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE3C;AAED,eAAO,MAAM,GAAG;oBACE,MAAM;oBACN,MAAM;oBACN,MAAM;qBACL,MAAM;uBACJ,MAAM;uBACN,MAAM;CAC1B,CAAC;AAEF,mEAAmE;AACnE,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAEvD;AAED,wBAAgB,OAAO,IAAI;IAAE,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,CAMpF;AAED,wBAAsB,SAAS,CAAC,CAAC,EAC/B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,EACpB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,CAAC,CAAC,CAmCZ;AAED,wBAAsB,OAAO,CAC3B,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GACjD,OAAO,CAAC,OAAO,CAAC,CASlB;AAED,wBAAsB,OAAO,CAC3B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE;IACP,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GACA,OAAO,CAAC,MAAM,CAAC,CAoBjB;AAED,wBAAsB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAcjE"}
@@ -0,0 +1,137 @@
1
+ import * as clack from "@clack/prompts";
2
+ import { stdin, stdout } from "node:process";
3
+ /**
4
+ * Interactive prompts, with three rules that decide how this CLI feels.
5
+ *
6
+ * 1. **One choice is not a question.** If there is exactly one thing the user
7
+ * could pick, pick it and say so. Asking is theatre.
8
+ * 2. **A non-interactive shell is told which flag to use**, not left to guess
9
+ * or - worse - hung on a prompt nobody can answer. Every prompt names its
10
+ * escape hatch, because the same commands run in CI.
11
+ * 3. **Cancelling changes nothing**, and says so. Ctrl-C mid-wizard should not
12
+ * leave half a config behind.
13
+ *
14
+ * Long lists switch from a menu to a filter: past about eight entries, scrolling
15
+ * is worse than typing.
16
+ */
17
+ const AUTOCOMPLETE_THRESHOLD = 8;
18
+ export class PromptCancelled extends Error {
19
+ constructor() {
20
+ super("Cancelled. Nothing changed.");
21
+ this.name = "PromptCancelled";
22
+ }
23
+ }
24
+ /** Raised when a prompt is unanswerable, naming the flag that replaces it. */
25
+ export class NonInteractive extends Error {
26
+ constructor(question, flag) {
27
+ super(`${question} cannot be asked in a non-interactive shell. Pass ${flag}.`);
28
+ this.name = "NonInteractive";
29
+ }
30
+ }
31
+ export function isInteractive() {
32
+ return Boolean(stdin.isTTY && stdout.isTTY);
33
+ }
34
+ function settle(answer) {
35
+ if (clack.isCancel(answer))
36
+ throw new PromptCancelled();
37
+ return answer;
38
+ }
39
+ export function intro(title) {
40
+ clack.intro(title);
41
+ }
42
+ export function outro(message) {
43
+ clack.outro(message);
44
+ }
45
+ export const log = {
46
+ info: (message) => clack.log.info(message),
47
+ step: (message) => clack.log.step(message),
48
+ warn: (message) => clack.log.warn(message),
49
+ error: (message) => clack.log.error(message),
50
+ success: (message) => clack.log.success(message),
51
+ message: (message) => clack.log.message(message),
52
+ };
53
+ /** A boxed aside - for the "here is what happens next" moments. */
54
+ export function note(body, title) {
55
+ clack.note(body, title);
56
+ }
57
+ export function spinner() {
58
+ const instance = clack.spinner();
59
+ return {
60
+ start: (message) => instance.start(message),
61
+ stop: (message) => instance.stop(message),
62
+ };
63
+ }
64
+ export async function selectOne(question, choices, flag) {
65
+ if (choices.length === 0)
66
+ throw new Error(`Nothing to choose from for: ${question}`);
67
+ if (choices.length === 1) {
68
+ const only = choices[0];
69
+ log.info(`${question}: ${only.label}`);
70
+ return only.value;
71
+ }
72
+ if (!isInteractive())
73
+ throw new NonInteractive(question, flag);
74
+ // clack's `Option` is an internal conditional type, not exported, and this
75
+ // workspace runs with exactOptionalPropertyTypes - so an inferred `hint?:
76
+ // string | undefined` is not assignable to its `hint?: string`. The cast goes
77
+ // through clack's own parameter type rather than a hand-written shape, so it
78
+ // still breaks if their option shape changes.
79
+ const options = choices.map((choice) => {
80
+ const option = {
81
+ value: choice.value,
82
+ label: choice.label,
83
+ };
84
+ if (choice.hint)
85
+ option.hint = choice.hint;
86
+ return option;
87
+ });
88
+ if (choices.length > AUTOCOMPLETE_THRESHOLD) {
89
+ return settle(await clack.autocomplete({
90
+ message: question,
91
+ options: options,
92
+ maxItems: AUTOCOMPLETE_THRESHOLD,
93
+ placeholder: "Type to filter...",
94
+ }));
95
+ }
96
+ return settle(await clack.select({ message: question, options }));
97
+ }
98
+ export async function confirm(question, options = {}) {
99
+ if (!isInteractive()) {
100
+ if (options.default === undefined) {
101
+ throw new NonInteractive(question, options.flag ?? "--yes");
102
+ }
103
+ return options.default;
104
+ }
105
+ return settle(await clack.confirm({ message: question, initialValue: options.default ?? false }));
106
+ }
107
+ export async function askText(question, options) {
108
+ if (!isInteractive()) {
109
+ if (options.initial !== undefined)
110
+ return options.initial;
111
+ if (options.optional)
112
+ return "";
113
+ throw new NonInteractive(question, options.flag);
114
+ }
115
+ const answer = settle(await clack.text({
116
+ message: question,
117
+ ...(options.placeholder ? { placeholder: options.placeholder } : {}),
118
+ ...(options.initial ? { initialValue: options.initial } : {}),
119
+ validate: (value) => {
120
+ if (!options.optional && !value?.trim())
121
+ return "Required.";
122
+ return options.validate?.(value ?? "");
123
+ },
124
+ }));
125
+ return answer.trim();
126
+ }
127
+ export async function askSecret(question) {
128
+ if (!isInteractive()) {
129
+ throw new Error(`${question} cannot be asked in a non-interactive shell. ` +
130
+ "Set CAPUCHOO_API_KEY, or pass --api-key.");
131
+ }
132
+ return settle(await clack.password({
133
+ message: question,
134
+ validate: (value) => (value?.trim() ? undefined : "Required."),
135
+ }));
136
+ }
137
+ //# sourceMappingURL=prompts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/cli/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,EAA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,QAAQ;QACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC;KAC/D,CAAC,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { BaseCommand } from "../../base-command.js";
2
+ /**
3
+ * Deleting an app takes its channels, bundles and update history with it, and
4
+ * every installed copy stops receiving updates. So the identifier is required
5
+ * as an argument rather than read from project.json - deleting whatever
6
+ * directory you happen to be standing in is too easy a mistake - and the
7
+ * confirmation asks for nothing less than the bundle id.
8
+ */
9
+ export default class AppDelete extends BaseCommand {
10
+ static description: string;
11
+ static examples: string[];
12
+ static args: {
13
+ appId: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
14
+ };
15
+ static flags: {
16
+ yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
17
+ };
18
+ run(): Promise<void>;
19
+ }
20
+ //# sourceMappingURL=delete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/commands/app/delete.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAKpD;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,WAAW;IAChD,OAAgB,WAAW,SAAiD;IAE5E,OAAgB,QAAQ,WAAoD;IAE5E,OAAgB,IAAI;;MAElB;IAEF,OAAgB,KAAK;;MAMnB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAgE3B"}