@capuchoo/cli 0.3.0 → 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.
- package/README.md +233 -26
- package/dist/base-command.d.ts +1 -1
- package/dist/base-command.js +1 -1
- package/dist/commands/app/delete.d.ts +20 -0
- package/dist/commands/app/delete.d.ts.map +1 -0
- package/dist/commands/app/delete.js +71 -0
- package/dist/commands/app/delete.js.map +1 -0
- package/dist/commands/app/list.d.ts +9 -0
- package/dist/commands/app/list.d.ts.map +1 -0
- package/dist/commands/app/list.js +40 -0
- package/dist/commands/app/list.js.map +1 -0
- package/dist/commands/auth/login.d.ts.map +1 -1
- package/dist/commands/auth/login.js +1 -1
- package/dist/commands/auth/login.js.map +1 -1
- package/dist/commands/auth/whoami.d.ts.map +1 -1
- package/dist/commands/auth/whoami.js +13 -1
- package/dist/commands/auth/whoami.js.map +1 -1
- package/dist/commands/channel/create.d.ts +25 -0
- package/dist/commands/channel/create.d.ts.map +1 -0
- package/dist/commands/channel/create.js +96 -0
- package/dist/commands/channel/create.js.map +1 -0
- package/dist/commands/channel/delete.d.ts +19 -0
- package/dist/commands/channel/delete.d.ts.map +1 -0
- package/dist/commands/channel/delete.js +66 -0
- package/dist/commands/channel/delete.js.map +1 -0
- package/dist/commands/channel/list.js +1 -1
- package/dist/commands/channel/list.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +18 -3
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.d.ts +11 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +146 -33
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/org/create.d.ts +19 -0
- package/dist/commands/org/create.d.ts.map +1 -0
- package/dist/commands/org/create.js +45 -0
- package/dist/commands/org/create.js.map +1 -0
- package/dist/commands/org/list.d.ts +9 -0
- package/dist/commands/org/list.d.ts.map +1 -0
- package/dist/commands/org/list.js +41 -0
- package/dist/commands/org/list.js.map +1 -0
- package/dist/commands/setup.d.ts +16 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +168 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/deploy/execute.js +1 -1
- package/dist/deploy/execute.js.map +1 -1
- package/dist/pipeline/build.js +1 -1
- package/dist/pipeline/build.js.map +1 -1
- package/dist/pipeline/capacitor-support.d.ts +53 -0
- package/dist/pipeline/capacitor-support.d.ts.map +1 -0
- package/dist/pipeline/capacitor-support.js +95 -0
- package/dist/pipeline/capacitor-support.js.map +1 -0
- package/dist/pipeline/deploy.js +1 -1
- package/dist/pipeline/deploy.js.map +1 -1
- package/dist/pipeline/flavour.js +1 -1
- package/dist/pipeline/flavour.js.map +1 -1
- package/dist/services/cloud.d.ts +22 -2
- package/dist/services/cloud.d.ts.map +1 -1
- package/dist/services/cloud.js +26 -3
- package/dist/services/cloud.js.map +1 -1
- package/dist/utils/http.d.ts +2 -0
- package/dist/utils/http.d.ts.map +1 -1
- package/dist/utils/http.js +4 -0
- package/dist/utils/http.js.map +1 -1
- package/oclif.manifest.json +330 -5
- package/package.json +11 -4
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@capuchoo/cli
|
|
2
2
|
=============
|
|
3
3
|
|
|
4
|
-
|
|
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.
|
|
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
|
|
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
|
|
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://
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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://
|
|
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.
|
|
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]
|
|
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.
|
|
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]
|
|
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.
|
|
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
|
|
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
|
-
-
|
|
285
|
-
-
|
|
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
|
|
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/
|
|
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.
|
|
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.
|
|
557
|
+
[src/commands/version/sync.ts](https://github.com/aybinv7/capuchoo/blob/v0.4.0/src/commands/version/sync.ts)_
|
|
351
558
|
<!-- commandsstop -->
|
package/dist/base-command.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command } from "@oclif/core";
|
|
2
2
|
/**
|
|
3
|
-
* Base class for every
|
|
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
|
package/dist/base-command.js
CHANGED
|
@@ -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
|
|
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,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"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Args, Flags } from "@oclif/core";
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import { BaseCommand } from "../../base-command.js";
|
|
4
|
+
import { confirm, isInteractive, log } from "../../cli/prompts.js";
|
|
5
|
+
import { CloudClient } from "../../services/cloud.js";
|
|
6
|
+
import { readProjectConfig, resolveCredentials } from "../../utils/config.js";
|
|
7
|
+
/**
|
|
8
|
+
* Deleting an app takes its channels, bundles and update history with it, and
|
|
9
|
+
* every installed copy stops receiving updates. So the identifier is required
|
|
10
|
+
* as an argument rather than read from project.json - deleting whatever
|
|
11
|
+
* directory you happen to be standing in is too easy a mistake - and the
|
|
12
|
+
* confirmation asks for nothing less than the bundle id.
|
|
13
|
+
*/
|
|
14
|
+
export default class AppDelete extends BaseCommand {
|
|
15
|
+
static description = "Delete an app, its channels and its bundles";
|
|
16
|
+
static examples = ["<%= config.bin %> app delete com.company.app"];
|
|
17
|
+
static args = {
|
|
18
|
+
appId: Args.string({ description: "Bundle identifier of the app to delete" }),
|
|
19
|
+
};
|
|
20
|
+
static flags = {
|
|
21
|
+
yes: Flags.boolean({
|
|
22
|
+
char: "y",
|
|
23
|
+
default: false,
|
|
24
|
+
description: "Skip the confirmation (scripts and CI)",
|
|
25
|
+
}),
|
|
26
|
+
};
|
|
27
|
+
async run() {
|
|
28
|
+
const { args, flags } = await this.parse(AppDelete);
|
|
29
|
+
const credentials = resolveCredentials();
|
|
30
|
+
if (!credentials) {
|
|
31
|
+
this.error(`Not authenticated. Run ${chalk.cyan("capuchoo auth login")}.`);
|
|
32
|
+
}
|
|
33
|
+
const wanted = args.appId?.trim();
|
|
34
|
+
if (!wanted) {
|
|
35
|
+
this.error("Which app? Pass its bundle identifier, e.g. capuchoo app delete com.company.app.");
|
|
36
|
+
}
|
|
37
|
+
const cloud = new CloudClient(credentials.endpoint, credentials.apiKey);
|
|
38
|
+
const apps = await cloud.apps();
|
|
39
|
+
const app = apps.find((candidate) => candidate.app_id === wanted || candidate.id === wanted);
|
|
40
|
+
if (!app) {
|
|
41
|
+
this.error(`No app called "${wanted}" on this account. ` +
|
|
42
|
+
`Available: ${apps.map((candidate) => candidate.app_id).join(", ") || "none"}.`);
|
|
43
|
+
}
|
|
44
|
+
const channels = await cloud.channels(app.id).catch(() => []);
|
|
45
|
+
const serving = channels.filter((channel) => channel.current_version_id);
|
|
46
|
+
log.warn(`${app.name} has ${channels.length} channel(s)` +
|
|
47
|
+
(serving.length > 0 ? `, ${serving.length} of them serving a bundle right now` : "") +
|
|
48
|
+
". Deleting it takes them and the update history with it, and installed " +
|
|
49
|
+
"copies stop receiving updates.");
|
|
50
|
+
if (readProjectConfig(process.cwd())?.cloudAppId === app.id) {
|
|
51
|
+
log.warn("This is the app the current directory is linked to.");
|
|
52
|
+
}
|
|
53
|
+
if (!flags.yes && !isInteractive()) {
|
|
54
|
+
this.error(`Refusing to delete ${app.app_id} unattended. Pass --yes.`);
|
|
55
|
+
}
|
|
56
|
+
const proceed = flags.yes ||
|
|
57
|
+
(await confirm(`Delete ${app.name} (${app.app_id}) for good?`, {
|
|
58
|
+
default: false,
|
|
59
|
+
flag: "--yes",
|
|
60
|
+
}));
|
|
61
|
+
if (!proceed) {
|
|
62
|
+
this.log(chalk.dim(" Nothing was deleted."));
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
await cloud.deleteApp(app.id);
|
|
66
|
+
this.log("");
|
|
67
|
+
this.log(` ${chalk.green("Deleted")} ${app.name} ${chalk.dim(app.app_id)}`);
|
|
68
|
+
this.log(chalk.dim(" .capuchoo/project.json still points at it - remove it or re-run init.") + "\n");
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/commands/app/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,uBA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,CAAC,sBAAsB,GAAG,CAAC,MAAM,0BAA0B,CAAC,CAAC;QACzE,CAAC;QAED,MAAM,OAAO,GACX,KAAK,CAAC,GAAG;YACT,CAAC,MAAM,OAAO,CAAC,UAAU,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,MAAM,aAAa,EAAE;gBAC7D,OAAO,EAAE,KAAK;gBACd,IAAI,EAAE,OAAO;aACd,CAAC,CAAC,CAAC;QAEN,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC,CAAC;YAC9C,OAAO;QACT,CAAC;QAED,MAAM,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAE9B,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC7E,IAAI,CAAC,GAAG,CACN,KAAK,CAAC,GAAG,CAAC,yEAAyE,CAAC,GAAG,IAAI,CAC5F,CAAC;IACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseCommand } from "../../base-command.js";
|
|
2
|
+
export default class AppList extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
6
|
+
};
|
|
7
|
+
run(): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/app/list.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIpD,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,WAAW;IAC9C,OAAgB,WAAW,SAA0C;IAErE,OAAgB,KAAK;;MAEnB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAkC3B"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Flags } from "@oclif/core";
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import { BaseCommand } from "../../base-command.js";
|
|
4
|
+
import { CloudClient } from "../../services/cloud.js";
|
|
5
|
+
import { readProjectConfig, resolveCredentials } from "../../utils/config.js";
|
|
6
|
+
export default class AppList extends BaseCommand {
|
|
7
|
+
static description = "List the apps this account can reach";
|
|
8
|
+
static flags = {
|
|
9
|
+
json: Flags.boolean({ default: false, description: "Machine-readable output" }),
|
|
10
|
+
};
|
|
11
|
+
async run() {
|
|
12
|
+
const { flags } = await this.parse(AppList);
|
|
13
|
+
const credentials = resolveCredentials();
|
|
14
|
+
if (!credentials) {
|
|
15
|
+
this.error(`Not authenticated. Run ${chalk.cyan("capuchoo auth login")}.`);
|
|
16
|
+
}
|
|
17
|
+
const cloud = new CloudClient(credentials.endpoint, credentials.apiKey);
|
|
18
|
+
const apps = await cloud.apps();
|
|
19
|
+
if (flags.json) {
|
|
20
|
+
this.log(JSON.stringify(apps, null, 2));
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (apps.length === 0) {
|
|
24
|
+
this.log("");
|
|
25
|
+
this.log(chalk.yellow(" No apps yet."));
|
|
26
|
+
this.log(chalk.dim(" Register one with: capuchoo init --create") + "\n");
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
// Marking the linked one turns this into an answer to "which app am I about
|
|
30
|
+
// to deploy to", which is the reason to run it from a project directory.
|
|
31
|
+
const linked = readProjectConfig(process.cwd())?.cloudAppId;
|
|
32
|
+
this.log("");
|
|
33
|
+
for (const app of apps) {
|
|
34
|
+
const marker = app.id === linked ? chalk.green(" <- this directory") : "";
|
|
35
|
+
this.log(` ${app.name.padEnd(24)} ${chalk.dim(app.app_id)}${marker}`);
|
|
36
|
+
}
|
|
37
|
+
this.log("");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/app/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE9E,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,WAAW;IAC9C,MAAM,CAAU,WAAW,GAAG,sCAAsC,CAAC;IAErE,MAAM,CAAU,KAAK,GAAG;QACtB,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;KAChF,CAAC;IAEF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAE5C,MAAM,WAAW,GAAG,kBAAkB,EAAE,CAAC;QACzC,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,IAAI,CAAC,KAAK,CAAC,0BAA0B,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC;QAC7E,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC,WAAW,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;QACxE,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC;QAEhC,IAAI,KAAK,CAAC,IAAI,EAAE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,OAAgB,WAAW,
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/login.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIpD,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,WAAW;IAChD,OAAgB,WAAW,SAA+C;IAE1E,OAAgB,QAAQ,WAGtB;IAEF,OAAgB,KAAK;;;MAMnB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAK1B;;;;;;OAMG;WACU,YAAY,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAiDrF"}
|
|
@@ -7,7 +7,7 @@ import { readGlobalConfig, updateGlobalConfig } from "../../utils/config.js";
|
|
|
7
7
|
import { BaseCommand } from "../../base-command.js";
|
|
8
8
|
const DEFAULT_ENDPOINT = "https://capuchoo-back.onrender.com";
|
|
9
9
|
export default class AuthLogin extends BaseCommand {
|
|
10
|
-
static description = "Store an API key for the
|
|
10
|
+
static description = "Store an API key for the Capuchoo backend";
|
|
11
11
|
static examples = [
|
|
12
12
|
"<%= config.bin %> auth login",
|
|
13
13
|
"<%= config.bin %> auth login --endpoint https://capucho.internal --api-key cap_...",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../../src/commands/auth/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,E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AChD,MAAM,IAAI,KAAK,CAAC,GAAG,QAAQ,0DAA0D,CAAC,CAAC;QACzF,CAAC;QAED,OAAO,CAAC,OAAO,CAAC,gBAAgB,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QAEtD,uEAAuE;QACvE,4EAA4E;QAC5E,2EAA2E;QAC3E,gEAAgE;QAChE,kBAAkB,CAAC;YACjB,QAAQ;YACR,MAAM;YACN,IAAI,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE;YACxD,eAAe,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SAC1C,CAAC,CAAC;IACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"whoami.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/whoami.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAAW;IACjD,OAAgB,WAAW,SACiD;IAE5E,OAAgB,KAAK;;MAEnB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"whoami.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/whoami.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAAW;IACjD,OAAgB,WAAW,SACiD;IAE5E,OAAgB,KAAK;;MAEnB;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAuG3B"}
|
|
@@ -44,6 +44,7 @@ export default class AuthWhoami extends BaseCommand {
|
|
|
44
44
|
user: profile.user,
|
|
45
45
|
organizations: profile.organizations,
|
|
46
46
|
apps: profile.apps,
|
|
47
|
+
credential: profile.credential ?? null,
|
|
47
48
|
}, null, 2));
|
|
48
49
|
return;
|
|
49
50
|
}
|
|
@@ -63,8 +64,19 @@ export default class AuthWhoami extends BaseCommand {
|
|
|
63
64
|
if (profile.apps.length > 0) {
|
|
64
65
|
this.log("");
|
|
65
66
|
this.log(chalk.bold(" apps"));
|
|
67
|
+
// These are the apps the *account* owns. An app-scoped key can publish to
|
|
68
|
+
// exactly one of them, so listing all of them unqualified is how "capuchoo
|
|
69
|
+
// app list shows one app but whoami shows three" happens.
|
|
70
|
+
const scope = profile.credential?.app_id;
|
|
66
71
|
for (const app of profile.apps) {
|
|
67
|
-
|
|
72
|
+
const note = scope && app.id !== scope ? chalk.dim(" - this key cannot publish to it") : "";
|
|
73
|
+
this.log(` ${app.name} ${chalk.dim(app.app_id)}${note}`);
|
|
74
|
+
}
|
|
75
|
+
if (scope) {
|
|
76
|
+
const scoped = profile.apps.find((app) => app.id === scope);
|
|
77
|
+
this.log("");
|
|
78
|
+
this.log(chalk.dim(` This key is restricted to ${scoped ? scoped.app_id : scope}. ` +
|
|
79
|
+
"Use an unscoped key to work across apps."));
|
|
68
80
|
}
|
|
69
81
|
}
|
|
70
82
|
else {
|