@capgo/cli 7.4.6 β 7.4.7
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 +34 -612
- package/dist/index.js +148 -143
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -55,7 +55,7 @@ Follow the documentation here : "https://capacitorjs.com/docs/getting-started/
|
|
|
55
55
|
- [Account](#account)
|
|
56
56
|
- [Id](#account-id)
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
## <a id="init"></a> π **Init**
|
|
59
59
|
|
|
60
60
|
**Alias:** `i`
|
|
61
61
|
|
|
@@ -64,17 +64,15 @@ npx @capgo/cli@latest init
|
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
π Initialize a new app in Capgo Cloud with step-by-step guidance.
|
|
67
|
-
|
|
68
67
|
This includes adding code for updates, building, uploading your app, and verifying update functionality.
|
|
69
68
|
|
|
70
|
-
|
|
71
69
|
**Example:**
|
|
72
70
|
|
|
73
71
|
```bash
|
|
74
72
|
npx @capgo/cli@latest init YOUR_API_KEY com.example.app
|
|
75
73
|
```
|
|
76
74
|
|
|
77
|
-
|
|
75
|
+
## <a id="options"></a> Options
|
|
78
76
|
|
|
79
77
|
| Param | Type | Description |
|
|
80
78
|
| -------------- | ------------- | -------------------- |
|
|
@@ -84,31 +82,29 @@ npx @capgo/cli@latest init YOUR_API_KEY com.example.app
|
|
|
84
82
|
| **--supa-anon** | <code>string</code> | Supabase anon token for custom setups |
|
|
85
83
|
|
|
86
84
|
|
|
87
|
-
|
|
85
|
+
## <a id="doctor"></a> π¨ββοΈ **Doctor**
|
|
88
86
|
|
|
89
87
|
```bash
|
|
90
88
|
npx @capgo/cli@latest doctor
|
|
91
89
|
```
|
|
92
90
|
|
|
93
91
|
π¨ββοΈ Check if your Capgo app installation is up-to-date and gather information useful for bug reports.
|
|
94
|
-
|
|
95
92
|
This command helps diagnose issues with your setup.
|
|
96
93
|
|
|
97
|
-
|
|
98
94
|
**Example:**
|
|
99
95
|
|
|
100
96
|
```bash
|
|
101
97
|
npx @capgo/cli@latest doctor
|
|
102
98
|
```
|
|
103
99
|
|
|
104
|
-
|
|
100
|
+
## <a id="options"></a> Options
|
|
105
101
|
|
|
106
102
|
| Param | Type | Description |
|
|
107
103
|
| -------------- | ------------- | -------------------- |
|
|
108
104
|
| **--package-json** | <code>string</code> | A list of paths to package.json. Useful for monorepos (comma separated ex: ../../package.json,./package.json) |
|
|
109
105
|
|
|
110
106
|
|
|
111
|
-
|
|
107
|
+
## <a id="login"></a> π **Login**
|
|
112
108
|
|
|
113
109
|
**Alias:** `l`
|
|
114
110
|
|
|
@@ -117,24 +113,22 @@ npx @capgo/cli@latest login
|
|
|
117
113
|
```
|
|
118
114
|
|
|
119
115
|
π Save your Capgo API key to your machine or local folder for easier access to Capgo Cloud services.
|
|
120
|
-
|
|
121
116
|
Use --apikey=******** in any command to override it.
|
|
122
117
|
|
|
123
|
-
|
|
124
118
|
**Example:**
|
|
125
119
|
|
|
126
120
|
```bash
|
|
127
121
|
npx @capgo/cli@latest login YOUR_API_KEY
|
|
128
122
|
```
|
|
129
123
|
|
|
130
|
-
|
|
124
|
+
## <a id="options"></a> Options
|
|
131
125
|
|
|
132
126
|
| Param | Type | Description |
|
|
133
127
|
| -------------- | ------------- | -------------------- |
|
|
134
128
|
| **--local** | <code>boolean</code> | Only save in local folder, git ignored for security. |
|
|
135
129
|
|
|
136
130
|
|
|
137
|
-
|
|
131
|
+
## <a id="bundle"></a> π¦ **Bundle**
|
|
138
132
|
|
|
139
133
|
```bash
|
|
140
134
|
npx @capgo/cli@latest bundle
|
|
@@ -144,7 +138,7 @@ npx @capgo/cli@latest bundle
|
|
|
144
138
|
|
|
145
139
|
#### BUNDLE Subcommands:
|
|
146
140
|
|
|
147
|
-
|
|
141
|
+
### <a id="bundle-upload"></a> β¬οΈ **Upload**
|
|
148
142
|
|
|
149
143
|
**Alias:** `u`
|
|
150
144
|
|
|
@@ -153,26 +147,18 @@ npx @capgo/cli@latest bundle upload
|
|
|
153
147
|
```
|
|
154
148
|
|
|
155
149
|
β¬οΈ Upload a new app bundle to Capgo Cloud for distribution, optionally linking to a channel or external URL.
|
|
156
|
-
|
|
157
150
|
External option supports privacy concerns or large apps (>200MB) by storing only the link.
|
|
158
|
-
|
|
159
151
|
Capgo never inspects external content. Encryption adds a trustless security layer.
|
|
160
|
-
|
|
161
152
|
Version must be > 0.0.0 and unique.
|
|
162
|
-
|
|
163
153
|
> βΉοΈ External option helps with corporate privacy concerns and apps larger than 200MB by storing only the link.
|
|
164
154
|
|
|
165
|
-
|
|
166
155
|
> βΉοΈ Capgo Cloud never looks at the content in the link for external options or in the code when stored.
|
|
167
156
|
|
|
168
|
-
|
|
169
157
|
> βΉοΈ You can add a second layer of security with encryption, making Capgo trustless.
|
|
170
158
|
|
|
171
|
-
|
|
172
159
|
> βΉοΈ Version should be greater than "0.0.0" and cannot be overridden or reused after deletion for security reasons.
|
|
173
160
|
|
|
174
161
|
|
|
175
|
-
|
|
176
162
|
**Example:**
|
|
177
163
|
|
|
178
164
|
```bash
|
|
@@ -227,7 +213,7 @@ npx @capgo/cli@latest bundle upload com.example.app --path ./dist --channel prod
|
|
|
227
213
|
| **--supa-host** | <code>string</code> | Supabase host URL, for self-hosted Capgo or testing |
|
|
228
214
|
| **--supa-anon** | <code>string</code> | Supabase anon token, for self-hosted Capgo or testing |
|
|
229
215
|
|
|
230
|
-
|
|
216
|
+
### <a id="bundle-compatibility"></a> π§ͺ **Compatibility**
|
|
231
217
|
|
|
232
218
|
```bash
|
|
233
219
|
npx @capgo/cli@latest bundle compatibility
|
|
@@ -235,7 +221,6 @@ npx @capgo/cli@latest bundle compatibility
|
|
|
235
221
|
|
|
236
222
|
π§ͺ Check compatibility of a bundle with a specific channel in Capgo Cloud to ensure updates are safe.
|
|
237
223
|
|
|
238
|
-
|
|
239
224
|
**Example:**
|
|
240
225
|
|
|
241
226
|
```bash
|
|
@@ -252,7 +237,7 @@ npx @capgo/cli@latest bundle compatibility com.example.app --channel production
|
|
|
252
237
|
| **--package-json** | <code>string</code> | A list of paths to package.json. Useful for monorepos (comma separated ex: ../../package.json,./package.json) |
|
|
253
238
|
| **--node-modules** | <code>string</code> | A list of paths to node_modules. Useful for monorepos (comma separated ex: ../../node_modules,./node_modules) |
|
|
254
239
|
|
|
255
|
-
|
|
240
|
+
### <a id="bundle-delete"></a> ποΈ **Delete**
|
|
256
241
|
|
|
257
242
|
**Alias:** `d`
|
|
258
243
|
|
|
@@ -262,7 +247,6 @@ npx @capgo/cli@latest bundle delete
|
|
|
262
247
|
|
|
263
248
|
ποΈ Delete a specific bundle from Capgo Cloud, optionally targeting a single version.
|
|
264
249
|
|
|
265
|
-
|
|
266
250
|
**Example:**
|
|
267
251
|
|
|
268
252
|
```bash
|
|
@@ -275,7 +259,7 @@ npx @capgo/cli@latest bundle delete BUNDLE_ID com.example.app
|
|
|
275
259
|
| -------------- | ------------- | -------------------- |
|
|
276
260
|
| **-a,** | <code>string</code> | API key to link to your account |
|
|
277
261
|
|
|
278
|
-
|
|
262
|
+
### <a id="bundle-list"></a> π **List**
|
|
279
263
|
|
|
280
264
|
**Alias:** `l`
|
|
281
265
|
|
|
@@ -285,7 +269,6 @@ npx @capgo/cli@latest bundle list
|
|
|
285
269
|
|
|
286
270
|
π List all bundles uploaded for an app in Capgo Cloud.
|
|
287
271
|
|
|
288
|
-
|
|
289
272
|
**Example:**
|
|
290
273
|
|
|
291
274
|
```bash
|
|
@@ -298,7 +281,7 @@ npx @capgo/cli@latest bundle list com.example.app
|
|
|
298
281
|
| -------------- | ------------- | -------------------- |
|
|
299
282
|
| **-a,** | <code>string</code> | API key to link to your account |
|
|
300
283
|
|
|
301
|
-
|
|
284
|
+
### <a id="bundle-cleanup"></a> π§Ή **Cleanup**
|
|
302
285
|
|
|
303
286
|
**Alias:** `c`
|
|
304
287
|
|
|
@@ -307,10 +290,8 @@ npx @capgo/cli@latest bundle cleanup
|
|
|
307
290
|
```
|
|
308
291
|
|
|
309
292
|
π§Ή Cleanup old bundles in Capgo Cloud, keeping a specified number of recent versions or those linked to channels.
|
|
310
|
-
|
|
311
293
|
Ignores bundles in use.
|
|
312
294
|
|
|
313
|
-
|
|
314
295
|
**Example:**
|
|
315
296
|
|
|
316
297
|
```bash
|
|
@@ -327,17 +308,15 @@ npx @capgo/cli@latest bundle cleanup com.example.app --bundle=1.0 --keep=3
|
|
|
327
308
|
| **-f,** | <code>string</code> | Force removal |
|
|
328
309
|
| **--ignore-channel** | <code>boolean</code> | Delete all versions even if linked to a channel, this will delete channel as well |
|
|
329
310
|
|
|
330
|
-
|
|
311
|
+
### <a id="bundle-encrypt"></a> π **Encrypt**
|
|
331
312
|
|
|
332
313
|
```bash
|
|
333
314
|
npx @capgo/cli@latest bundle encrypt
|
|
334
315
|
```
|
|
335
316
|
|
|
336
317
|
π Encrypt a zip bundle using the new encryption method for secure external storage or testing.
|
|
337
|
-
|
|
338
318
|
Used with external sources or for testing, prints ivSessionKey for upload or decryption.
|
|
339
319
|
|
|
340
|
-
|
|
341
320
|
**Example:**
|
|
342
321
|
|
|
343
322
|
```bash
|
|
@@ -352,17 +331,15 @@ npx @capgo/cli@latest bundle encrypt ./myapp.zip CHECKSUM
|
|
|
352
331
|
| **--key-data** | <code>string</code> | Private signing key |
|
|
353
332
|
| **-j,** | <code>string</code> | Output in JSON |
|
|
354
333
|
|
|
355
|
-
|
|
334
|
+
### <a id="bundle-decrypt"></a> π **Decrypt**
|
|
356
335
|
|
|
357
336
|
```bash
|
|
358
337
|
npx @capgo/cli@latest bundle decrypt
|
|
359
338
|
```
|
|
360
339
|
|
|
361
340
|
π Decrypt a zip bundle using the new encryption method, mainly for testing purposes.
|
|
362
|
-
|
|
363
341
|
Prints the base64 decrypted session key for verification.
|
|
364
342
|
|
|
365
|
-
|
|
366
343
|
**Example:**
|
|
367
344
|
|
|
368
345
|
```bash
|
|
@@ -377,17 +354,15 @@ npx @capgo/cli@latest bundle decrypt ./myapp_encrypted.zip CHECKSUM
|
|
|
377
354
|
| **--key-data** | <code>string</code> | Private signing key |
|
|
378
355
|
| **--checksum** | <code>string</code> | Checksum of the bundle, to verify the integrity of the bundle |
|
|
379
356
|
|
|
380
|
-
|
|
357
|
+
### <a id="bundle-zip"></a> πΉ **Zip**
|
|
381
358
|
|
|
382
359
|
```bash
|
|
383
360
|
npx @capgo/cli@latest bundle zip
|
|
384
361
|
```
|
|
385
362
|
|
|
386
363
|
ποΈ Create a zip file of your app bundle for upload or local storage.
|
|
387
|
-
|
|
388
364
|
Useful for preparing bundles before encryption or upload.
|
|
389
365
|
|
|
390
|
-
|
|
391
366
|
**Example:**
|
|
392
367
|
|
|
393
368
|
```bash
|
|
@@ -407,7 +382,7 @@ npx @capgo/cli@latest bundle zip com.example.app --path ./dist
|
|
|
407
382
|
| **--package-json** | <code>string</code> | A list of paths to package.json. Useful for monorepos (comma separated ex: ../../package.json,./package.json) |
|
|
408
383
|
|
|
409
384
|
|
|
410
|
-
|
|
385
|
+
## <a id="app"></a> π± **App**
|
|
411
386
|
|
|
412
387
|
```bash
|
|
413
388
|
npx @capgo/cli@latest app
|
|
@@ -417,7 +392,7 @@ npx @capgo/cli@latest app
|
|
|
417
392
|
|
|
418
393
|
#### APP Subcommands:
|
|
419
394
|
|
|
420
|
-
|
|
395
|
+
### <a id="app-add"></a> β **Add**
|
|
421
396
|
|
|
422
397
|
**Alias:** `a`
|
|
423
398
|
|
|
@@ -426,10 +401,8 @@ npx @capgo/cli@latest app add
|
|
|
426
401
|
```
|
|
427
402
|
|
|
428
403
|
β Add a new app to Capgo Cloud with a unique app ID in the format com.test.app.
|
|
429
|
-
|
|
430
404
|
All options can be guessed from config if not provided.
|
|
431
405
|
|
|
432
|
-
|
|
433
406
|
**Example:**
|
|
434
407
|
|
|
435
408
|
```bash
|
|
@@ -444,7 +417,7 @@ npx @capgo/cli@latest app add com.example.app --name "My App" --icon ./icon.png
|
|
|
444
417
|
| **-i,** | <code>string</code> | App icon path for display in Capgo Cloud |
|
|
445
418
|
| **-a,** | <code>string</code> | API key to link to your account |
|
|
446
419
|
|
|
447
|
-
|
|
420
|
+
### <a id="app-delete"></a> ποΈ **Delete**
|
|
448
421
|
|
|
449
422
|
```bash
|
|
450
423
|
npx @capgo/cli@latest app delete
|
|
@@ -452,7 +425,6 @@ npx @capgo/cli@latest app delete
|
|
|
452
425
|
|
|
453
426
|
ποΈ Delete an app from Capgo Cloud, optionally specifying a version to delete only that bundle.
|
|
454
427
|
|
|
455
|
-
|
|
456
428
|
**Example:**
|
|
457
429
|
|
|
458
430
|
```bash
|
|
@@ -465,7 +437,7 @@ npx @capgo/cli@latest app delete com.example.app
|
|
|
465
437
|
| -------------- | ------------- | -------------------- |
|
|
466
438
|
| **-a,** | <code>string</code> | API key to link to your account |
|
|
467
439
|
|
|
468
|
-
|
|
440
|
+
### <a id="app-list"></a> π **List**
|
|
469
441
|
|
|
470
442
|
**Alias:** `l`
|
|
471
443
|
|
|
@@ -475,7 +447,6 @@ npx @capgo/cli@latest app list
|
|
|
475
447
|
|
|
476
448
|
π List all apps registered under your account in Capgo Cloud.
|
|
477
449
|
|
|
478
|
-
|
|
479
450
|
**Example:**
|
|
480
451
|
|
|
481
452
|
```bash
|
|
@@ -488,17 +459,15 @@ npx @capgo/cli@latest app list
|
|
|
488
459
|
| -------------- | ------------- | -------------------- |
|
|
489
460
|
| **-a,** | <code>string</code> | API key to link to your account |
|
|
490
461
|
|
|
491
|
-
|
|
462
|
+
### <a id="app-debug"></a> π **Debug**
|
|
492
463
|
|
|
493
464
|
```bash
|
|
494
465
|
npx @capgo/cli@latest app debug
|
|
495
466
|
```
|
|
496
467
|
|
|
497
468
|
π Listen for live update events in Capgo Cloud to debug your app.
|
|
498
|
-
|
|
499
469
|
Optionally target a specific device for detailed diagnostics.
|
|
500
470
|
|
|
501
|
-
|
|
502
471
|
**Example:**
|
|
503
472
|
|
|
504
473
|
```bash
|
|
@@ -512,17 +481,15 @@ npx @capgo/cli@latest app debug com.example.app --device DEVICE_ID
|
|
|
512
481
|
| **-a,** | <code>string</code> | API key to link to your account |
|
|
513
482
|
| **-d,** | <code>string</code> | The specific device ID to debug |
|
|
514
483
|
|
|
515
|
-
|
|
484
|
+
### <a id="app-setting"></a> βοΈ **Setting**
|
|
516
485
|
|
|
517
486
|
```bash
|
|
518
487
|
npx @capgo/cli@latest app setting
|
|
519
488
|
```
|
|
520
489
|
|
|
521
490
|
βοΈ Modify Capacitor configuration programmatically by specifying the path to the setting.
|
|
522
|
-
|
|
523
491
|
(e.g., plugins.CapacitorUpdater.defaultChannel). You MUST provide either --string or --bool.
|
|
524
492
|
|
|
525
|
-
|
|
526
493
|
**Example:**
|
|
527
494
|
|
|
528
495
|
```bash
|
|
@@ -536,7 +503,7 @@ npx @capgo/cli@latest app setting plugins.CapacitorUpdater.defaultChannel --stri
|
|
|
536
503
|
| **--bool** | <code>string</code> | A value for the setting to modify as a boolean, ex: --bool true |
|
|
537
504
|
| **--string** | <code>string</code> | A value for the setting to modify as a string, ex: --string "Production" |
|
|
538
505
|
|
|
539
|
-
|
|
506
|
+
### <a id="app-set"></a> βοΈ **Set**
|
|
540
507
|
|
|
541
508
|
**Alias:** `s`
|
|
542
509
|
|
|
@@ -545,10 +512,8 @@ npx @capgo/cli@latest app set
|
|
|
545
512
|
```
|
|
546
513
|
|
|
547
514
|
βοΈ Update settings for an existing app in Capgo Cloud, such as name, icon, or retention period for bundles.
|
|
548
|
-
|
|
549
515
|
Retention of 0 means infinite storage.
|
|
550
516
|
|
|
551
|
-
|
|
552
517
|
**Example:**
|
|
553
518
|
|
|
554
519
|
```bash
|
|
@@ -565,7 +530,7 @@ npx @capgo/cli@latest app set com.example.app --name "Updated App" --retention 3
|
|
|
565
530
|
| **-r,** | <code>string</code> | Retention period of app bundle in days, 0 by default = infinite |
|
|
566
531
|
|
|
567
532
|
|
|
568
|
-
|
|
533
|
+
## <a id="channel"></a> π’ **Channel**
|
|
569
534
|
|
|
570
535
|
```bash
|
|
571
536
|
npx @capgo/cli@latest channel
|
|
@@ -575,7 +540,7 @@ npx @capgo/cli@latest channel
|
|
|
575
540
|
|
|
576
541
|
#### CHANNEL Subcommands:
|
|
577
542
|
|
|
578
|
-
|
|
543
|
+
### <a id="channel-add"></a> β **Add**
|
|
579
544
|
|
|
580
545
|
**Alias:** `a`
|
|
581
546
|
|
|
@@ -585,7 +550,6 @@ npx @capgo/cli@latest channel add
|
|
|
585
550
|
|
|
586
551
|
β Create a new channel for app distribution in Capgo Cloud to manage update delivery.
|
|
587
552
|
|
|
588
|
-
|
|
589
553
|
**Example:**
|
|
590
554
|
|
|
591
555
|
```bash
|
|
@@ -599,7 +563,7 @@ npx @capgo/cli@latest channel add production com.example.app --default
|
|
|
599
563
|
| **-d,** | <code>string</code> | Set the channel as default |
|
|
600
564
|
| **-a,** | <code>string</code> | API key to link to your account |
|
|
601
565
|
|
|
602
|
-
|
|
566
|
+
### <a id="channel-delete"></a> ποΈ **Delete**
|
|
603
567
|
|
|
604
568
|
**Alias:** `d`
|
|
605
569
|
|
|
@@ -609,7 +573,6 @@ npx @capgo/cli@latest channel delete
|
|
|
609
573
|
|
|
610
574
|
ποΈ Delete a channel from Capgo Cloud, optionally removing associated bundles to free up resources.
|
|
611
575
|
|
|
612
|
-
|
|
613
576
|
**Example:**
|
|
614
577
|
|
|
615
578
|
```bash
|
|
@@ -623,7 +586,7 @@ npx @capgo/cli@latest channel delete production com.example.app
|
|
|
623
586
|
| **-a,** | <code>string</code> | API key to link to your account |
|
|
624
587
|
| **--delete-bundle** | <code>boolean</code> | Delete the bundle associated with the channel |
|
|
625
588
|
|
|
626
|
-
|
|
589
|
+
### <a id="channel-list"></a> π **List**
|
|
627
590
|
|
|
628
591
|
**Alias:** `l`
|
|
629
592
|
|
|
@@ -633,7 +596,6 @@ npx @capgo/cli@latest channel list
|
|
|
633
596
|
|
|
634
597
|
π List all channels configured for an app in Capgo Cloud to review distribution settings.
|
|
635
598
|
|
|
636
|
-
|
|
637
599
|
**Example:**
|
|
638
600
|
|
|
639
601
|
```bash
|
|
@@ -646,7 +608,7 @@ npx @capgo/cli@latest channel list com.example.app
|
|
|
646
608
|
| -------------- | ------------- | -------------------- |
|
|
647
609
|
| **-a,** | <code>string</code> | API key to link to your account |
|
|
648
610
|
|
|
649
|
-
|
|
611
|
+
### <a id="channel-currentBundle"></a> π¦ **CurrentBundle**
|
|
650
612
|
|
|
651
613
|
```bash
|
|
652
614
|
npx @capgo/cli@latest channel currentBundle
|
|
@@ -654,7 +616,6 @@ npx @capgo/cli@latest channel currentBundle
|
|
|
654
616
|
|
|
655
617
|
π¦ Get the current bundle linked to a specific channel in Capgo Cloud for update tracking.
|
|
656
618
|
|
|
657
|
-
|
|
658
619
|
**Example:**
|
|
659
620
|
|
|
660
621
|
```bash
|
|
@@ -669,7 +630,7 @@ npx @capgo/cli@latest channel currentBundle production com.example.app
|
|
|
669
630
|
| **-a,** | <code>string</code> | API key to link to your account |
|
|
670
631
|
| **--quiet** | <code>boolean</code> | Only print the bundle version |
|
|
671
632
|
|
|
672
|
-
|
|
633
|
+
### <a id="channel-set"></a> βοΈ **Set**
|
|
673
634
|
|
|
674
635
|
**Alias:** `s`
|
|
675
636
|
|
|
@@ -678,10 +639,8 @@ npx @capgo/cli@latest channel set
|
|
|
678
639
|
```
|
|
679
640
|
|
|
680
641
|
βοΈ Configure settings for a channel, such as linking a bundle, setting update strategies (major, minor, metadata, patch, none), or device targeting (iOS, Android, dev, emulator).
|
|
681
|
-
|
|
682
642
|
One channel must be default.
|
|
683
643
|
|
|
684
|
-
|
|
685
644
|
**Example:**
|
|
686
645
|
|
|
687
646
|
```bash
|
|
@@ -714,7 +673,7 @@ npx @capgo/cli@latest channel set production com.example.app --bundle 1.0.0 --st
|
|
|
714
673
|
| **--package-json** | <code>string</code> | A list of paths to package.json. Useful for monorepos (comma separated ex: ../../package.json,./package.json) |
|
|
715
674
|
|
|
716
675
|
|
|
717
|
-
|
|
676
|
+
## <a id="key"></a> π **Key**
|
|
718
677
|
|
|
719
678
|
```bash
|
|
720
679
|
npx @capgo/cli@latest key
|
|
@@ -724,17 +683,15 @@ npx @capgo/cli@latest key
|
|
|
724
683
|
|
|
725
684
|
#### KEY Subcommands:
|
|
726
685
|
|
|
727
|
-
|
|
686
|
+
### <a id="key-save"></a> πΉ **Save**
|
|
728
687
|
|
|
729
688
|
```bash
|
|
730
689
|
npx @capgo/cli@latest key save
|
|
731
690
|
```
|
|
732
691
|
|
|
733
692
|
πΎ Save a base64 encryption key in the Capacitor config, useful for CI environments.
|
|
734
|
-
|
|
735
693
|
Recommended not to commit the key for security.
|
|
736
694
|
|
|
737
|
-
|
|
738
695
|
**Example:**
|
|
739
696
|
|
|
740
697
|
```bash
|
|
@@ -749,17 +706,15 @@ npx @capgo/cli@latest key save --key ./path/to/key
|
|
|
749
706
|
| **--key** | <code>string</code> | Key path to save in Capacitor config |
|
|
750
707
|
| **--key-data** | <code>string</code> | Key data to save in Capacitor config |
|
|
751
708
|
|
|
752
|
-
|
|
709
|
+
### <a id="key-create"></a> π¨ **Create**
|
|
753
710
|
|
|
754
711
|
```bash
|
|
755
712
|
npx @capgo/cli@latest key create
|
|
756
713
|
```
|
|
757
714
|
|
|
758
715
|
π¨ Create a new encryption key pair for end-to-end encryption in Capgo Cloud.
|
|
759
|
-
|
|
760
716
|
Do not commit or share the private key; save it securely.
|
|
761
717
|
|
|
762
|
-
|
|
763
718
|
**Example:**
|
|
764
719
|
|
|
765
720
|
```bash
|
|
@@ -772,7 +727,7 @@ npx @capgo/cli@latest key create
|
|
|
772
727
|
| -------------- | ------------- | -------------------- |
|
|
773
728
|
| **-f,** | <code>string</code> | Force generate a new one |
|
|
774
729
|
|
|
775
|
-
|
|
730
|
+
### <a id="key-delete_old"></a> ποΈ **Delete_old**
|
|
776
731
|
|
|
777
732
|
```bash
|
|
778
733
|
npx @capgo/cli@latest key delete_old
|
|
@@ -780,7 +735,6 @@ npx @capgo/cli@latest key delete_old
|
|
|
780
735
|
|
|
781
736
|
π§Ή Delete the old encryption key from the Capacitor config to ensure only the current key is used.
|
|
782
737
|
|
|
783
|
-
|
|
784
738
|
**Example:**
|
|
785
739
|
|
|
786
740
|
```bash
|
|
@@ -788,7 +742,7 @@ npx @capgo/cli@latest key delete_old
|
|
|
788
742
|
```
|
|
789
743
|
|
|
790
744
|
|
|
791
|
-
|
|
745
|
+
## <a id="account"></a> π€ **Account**
|
|
792
746
|
|
|
793
747
|
```bash
|
|
794
748
|
npx @capgo/cli@latest account
|
|
@@ -798,7 +752,7 @@ npx @capgo/cli@latest account
|
|
|
798
752
|
|
|
799
753
|
#### ACCOUNT Subcommands:
|
|
800
754
|
|
|
801
|
-
|
|
755
|
+
### <a id="account-id"></a> πΉ **Id**
|
|
802
756
|
|
|
803
757
|
```bash
|
|
804
758
|
npx @capgo/cli@latest account id
|
|
@@ -806,7 +760,6 @@ npx @capgo/cli@latest account id
|
|
|
806
760
|
|
|
807
761
|
πͺͺ Retrieve your account ID, safe to share for collaboration or support purposes in Discord or other platforms.
|
|
808
762
|
|
|
809
|
-
|
|
810
763
|
**Example:**
|
|
811
764
|
|
|
812
765
|
```bash
|
|
@@ -822,534 +775,3 @@ npx @capgo/cli@latest account id
|
|
|
822
775
|
|
|
823
776
|
|
|
824
777
|
<!-- AUTO-GENERATED-DOCS-END -->
|
|
825
|
-
|
|
826
|
-
### **Init**
|
|
827
|
-
|
|
828
|
-
`npx @capgo/cli@latest init [apikey]`
|
|
829
|
-
|
|
830
|
-
This method is here to onboard you step by step.
|
|
831
|
-
|
|
832
|
-
It will add your app to Capgo. It will add the code to your app to validate the update. Likewise, it will build your app. Furthermore, it will upload your app to Capgo. And it will help you to check if the update works.
|
|
833
|
-
|
|
834
|
-
### **Login**
|
|
835
|
-
|
|
836
|
-
`npx @capgo/cli login [apikey]`
|
|
837
|
-
|
|
838
|
-
This method is here to remember the `apikey` for you.
|
|
839
|
-
|
|
840
|
-
:::note
|
|
841
|
-
use `--apikey=********` in any command to override it
|
|
842
|
-
:::
|
|
843
|
-
|
|
844
|
-
**Optionaly you can give:**
|
|
845
|
-
|
|
846
|
-
`--local` This will store your **apikey** in the local repo and git ignore it.
|
|
847
|
-
|
|
848
|
-
## **Doctor**
|
|
849
|
-
|
|
850
|
-
`npx @capgo/cli doctor`
|
|
851
|
-
|
|
852
|
-
Command to check if you are up-to-date with Capgo packages.
|
|
853
|
-
|
|
854
|
-
This command will also be useful for bug report.
|
|
855
|
-
|
|
856
|
-
## App
|
|
857
|
-
|
|
858
|
-
### **Add**
|
|
859
|
-
|
|
860
|
-
`npx @capgo/cli app add [appId]`
|
|
861
|
-
|
|
862
|
-
`[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
863
|
-
|
|
864
|
-
> π‘ All option will be guessed in your config if not provided.
|
|
865
|
-
|
|
866
|
-
Optionally, you can give:
|
|
867
|
-
|
|
868
|
-
* `--icon [/path/to/my/icon]` to have a custom icon display in Capgo web app.
|
|
869
|
-
* `--name [test]` to have a custom name in the list.
|
|
870
|
-
* `--apikey [key]` API key to link to your account.
|
|
871
|
-
* `--retention [retention]` retention period of app bundle in days, 0 by default = infinite.
|
|
872
|
-
|
|
873
|
-
Example of `capacitor.config.json` for appId and AppName, the icon is guess in the resources folder
|
|
874
|
-
|
|
875
|
-
```json
|
|
876
|
-
{
|
|
877
|
-
"appId": "ee.forgr.capacitor_go",
|
|
878
|
-
"appName": "Capgo",
|
|
879
|
-
"webDir": "dist"
|
|
880
|
-
}
|
|
881
|
-
```
|
|
882
|
-
|
|
883
|
-
### **Set**
|
|
884
|
-
|
|
885
|
-
`npx @capgo/cli app set [appId]`
|
|
886
|
-
|
|
887
|
-
`[appId]` is your app ID, the format is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
888
|
-
|
|
889
|
-
Optionally, you can give:
|
|
890
|
-
|
|
891
|
-
* `--icon [/path/to/my/icon]` to have a custom icon display in Capgo web app.
|
|
892
|
-
* `--name [test]` to have a custom name in the list.
|
|
893
|
-
* `--retention [retention]` retention period of app bundle in days, 0 by default = infinite.
|
|
894
|
-
* `--apikey [key]` API key to link to your account.
|
|
895
|
-
|
|
896
|
-
### **List**
|
|
897
|
-
|
|
898
|
-
`npx @capgo/cli app list [appId]`
|
|
899
|
-
|
|
900
|
-
`[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
901
|
-
|
|
902
|
-
Optionally, you can give:
|
|
903
|
-
|
|
904
|
-
* `--apikey [key]` API key to link to your account.
|
|
905
|
-
|
|
906
|
-
### **Delete**
|
|
907
|
-
|
|
908
|
-
`npx @capgo/cli app delete [appId]`
|
|
909
|
-
|
|
910
|
-
`[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
911
|
-
|
|
912
|
-
Optionally, you can give:
|
|
913
|
-
|
|
914
|
-
* `--apikey [key]` API key to link to your account.
|
|
915
|
-
* `--bundle` with the version number will only delete this version.
|
|
916
|
-
|
|
917
|
-
### Debug
|
|
918
|
-
|
|
919
|
-
`npx @capgo/cli app debug [appId]`
|
|
920
|
-
|
|
921
|
-
`[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
922
|
-
|
|
923
|
-
Optionally, you can give:
|
|
924
|
-
|
|
925
|
-
* `--apikey [key]` API key to link to your account.
|
|
926
|
-
* `--device` with the specific device you want to debug
|
|
927
|
-
|
|
928
|
-
### Setting
|
|
929
|
-
|
|
930
|
-
`npx @capgo/cli app setting [path]`
|
|
931
|
-
|
|
932
|
-
Edit the Capacitor config.
|
|
933
|
-
|
|
934
|
-
`[path]` - path of the setting that you would like to change. For example, to change the `appId`, provide `appId`.
|
|
935
|
-
If you wish to disable auto update in the `capacitor-updater` provide `plugins.CapacitorUpdater.autoUpdate`
|
|
936
|
-
|
|
937
|
-
You MUST provide either `--string` or `--bool`!
|
|
938
|
-
|
|
939
|
-
Options:
|
|
940
|
-
- `--string <string>` - sets the setting to a string
|
|
941
|
-
- `--bool <true | false>` - sets the setting to a boolean
|
|
942
|
-
|
|
943
|
-
## Bundle
|
|
944
|
-
|
|
945
|
-
### Upload
|
|
946
|
-
|
|
947
|
-
`npx @capgo/cli bundle upload [appId]`
|
|
948
|
-
|
|
949
|
-
`[appId]` is your app ID, the format is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
950
|
-
|
|
951
|
-
Options:
|
|
952
|
-
|
|
953
|
-
* `--apikey <apikey>` API key to link to your account.
|
|
954
|
-
* `--path <path>` Path of the folder to upload.
|
|
955
|
-
* `--channel <channel>` Channel to link to.
|
|
956
|
-
* `--external <url>` Link to external URL instead of uploading to Capgo Cloud.
|
|
957
|
-
* `--iv-session-key <key>` Set the IV and session key for bundle URL external.
|
|
958
|
-
* `--s3-endpoint <s3Endpoint>` URL of S3 endpoint. Do not work with Partial upload, or external option.
|
|
959
|
-
* `--s3-region <region>` Region for your S3 bucket.
|
|
960
|
-
* `--s3-apikey <apikey>` API key for your S3 endpoint.
|
|
961
|
-
* `--s3-apisecret <apisecret>` API secret for your S3 endpoint.
|
|
962
|
-
* `--s3-bucket-name <bucketName>` Name for your AWS S3 bucket.
|
|
963
|
-
* `--s3-port <port>` Port for your S3 endpoint.
|
|
964
|
-
* `--no-s3-ssl` Disable SSL for S3 upload.
|
|
965
|
-
* `--key <key>` Custom path for public signing key (v1 system).
|
|
966
|
-
* `--key-data <keyData>` Public signing key (v1 system).
|
|
967
|
-
* `--key-v2 <key>` Custom path for private signing key (v2 system).
|
|
968
|
-
* `--key-data-v2 <keyData>` Private signing key (v2 system).
|
|
969
|
-
* `--bundle-url` Prints bundle URL into stdout.
|
|
970
|
-
* `--no-key` Ignore signing key and send clear update.
|
|
971
|
-
* `--no-code-check` Ignore checking if notifyAppReady() is called in source code and index present in root folder.
|
|
972
|
-
* `--display-iv-session` Show in the console the IV and session key used to encrypt the update.
|
|
973
|
-
* `--bundle <bundle>` Bundle version number of the bundle to upload.
|
|
974
|
-
* `--min-update-version <minUpdateVersion>` Minimal version required to update to this version. Used only if the disable auto update is set to metadata in channel.
|
|
975
|
-
* `--auto-min-update-version` Set the min update version based on native packages.
|
|
976
|
-
* `--ignore-metadata-check` Ignores the metadata (node_modules) check when uploading.
|
|
977
|
-
* `--ignore-checksum-check` Ignores the checksum check when uploading.
|
|
978
|
-
* `--timeout <timeout>` Timeout for the upload process in seconds.
|
|
979
|
-
* `--partial` Does not upload partial files to Capgo cloud.
|
|
980
|
-
* `--tus` Upload the bundle using tus protocol.
|
|
981
|
-
* `--multipart` Uses multipart protocol to upload data to S3, Deprecated, use TUS instead.
|
|
982
|
-
* `--encrypted-checksum <encryptedChecksum>` An encrypted checksum (signature). Used only when uploading an external bundle.
|
|
983
|
-
* `--package-json <packageJson>` A path to package.json. Usefull for monorepos.
|
|
984
|
-
* `--auto-set-bundle` Set the bundle in capacitor.config.json.
|
|
985
|
-
* `--node-modules <nodeModules>` A list of path to node_modules. Usefull for monorepos (comma separated ex: ../../node_modules,./node_modules).
|
|
986
|
-
|
|
987
|
-
> βοΈ External option helps to unlock 2 cases: corporate with privacy concern, don't send the code to a third part and app bigger than 200 MB. With this setting, Capgo store only the link to the zip and sends the link to all apps.
|
|
988
|
-
|
|
989
|
-
> π Capgo cloud never looks at what is in the link (for external option), or in the code when stored.
|
|
990
|
-
|
|
991
|
-
> π You can add a second layer of security by using encryption, then Capgo will not be able to look or modify anything, it becomes βtrustlessβ.
|
|
992
|
-
|
|
993
|
-
Example of `package.json` for version
|
|
994
|
-
|
|
995
|
-
```json
|
|
996
|
-
{
|
|
997
|
-
"version": "1.0.2"
|
|
998
|
-
}
|
|
999
|
-
```
|
|
1000
|
-
|
|
1001
|
-
> β Version should be greater than β0.0.0β.
|
|
1002
|
-
|
|
1003
|
-
> π‘ Don't forget to update the version number each time you send one, version number cannot be overrode, or reused after deletion for security reason.
|
|
1004
|
-
|
|
1005
|
-
### **List**
|
|
1006
|
-
|
|
1007
|
-
`npx @capgo/cli bundle list [appId]`
|
|
1008
|
-
|
|
1009
|
-
`[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
1010
|
-
|
|
1011
|
-
Optionally, you can give:
|
|
1012
|
-
|
|
1013
|
-
* `--apikey [key]` API key to link to your account.
|
|
1014
|
-
|
|
1015
|
-
### **Delete**
|
|
1016
|
-
|
|
1017
|
-
`npx @capgo/cli bundle delete [bundleId] [appId]`
|
|
1018
|
-
|
|
1019
|
-
`[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
1020
|
-
|
|
1021
|
-
Optionally, you can give:
|
|
1022
|
-
|
|
1023
|
-
* `--apikey [key]` API key to link to your account.
|
|
1024
|
-
* `--bundle` with the version number will only delete this version.
|
|
1025
|
-
|
|
1026
|
-
### Cleanup
|
|
1027
|
-
|
|
1028
|
-
in a SemVer range for a major version to Cloud
|
|
1029
|
-
|
|
1030
|
-
`npx @capgo/cli bundle cleanup [appId] --bundle=[majorVersion] --keep=[numberToKeep]`
|
|
1031
|
-
|
|
1032
|
-
`[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
1033
|
-
|
|
1034
|
-
Optionally, you can give:
|
|
1035
|
-
|
|
1036
|
-
* `--apikey [key]` API key to link to your account.
|
|
1037
|
-
* `--bundle [majorVersion]` a version you wish to remove previous packages for, it will keep the last one + `numberToKeep`.
|
|
1038
|
-
* `--keep [numberToKeep]` the number of packages you wish to keep (default 4).
|
|
1039
|
-
|
|
1040
|
-
For example: If you have 10 versions from 10.0.1 to 10.0.11, and you use `npx @capgo/cli cleanup [appId] --bundle=10.0.0` it will remove 10.0.1 to 10.0.6. 10.0.7 until 10.0.11 will be kept.
|
|
1041
|
-
|
|
1042
|
-
If you have 20 versions in total, and you don't provide a bundle number like this: `npx @capgo/cli cleanup [appId] --keep=2` It will remove 18 versions, and keep the last 2.
|
|
1043
|
-
|
|
1044
|
-
> This command will ask for confirmation, it shows a table of what it will be keeping and removing.
|
|
1045
|
-
|
|
1046
|
-
:::note
|
|
1047
|
-
This command will ignore bundles which are currently in use in any channel.
|
|
1048
|
-
:::
|
|
1049
|
-
|
|
1050
|
-
### **Encrypt**
|
|
1051
|
-
|
|
1052
|
-
> **Warning**: This command is deprecated and will be removed in the next major release. Please use the new encryption system.
|
|
1053
|
-
`npx @capgo/cli bundle encrypt [path/to/zip]`
|
|
1054
|
-
|
|
1055
|
-
This command is used when you use external source to store your code or for test purpose.
|
|
1056
|
-
|
|
1057
|
-
Optionally, you can give:
|
|
1058
|
-
|
|
1059
|
-
`--key [/path/to/my/private_key]` the path of your private key.
|
|
1060
|
-
`--key-data [privateKey]` the private key data, if you want to use inline.
|
|
1061
|
-
The command will print your `ivSessionKey`y and generate an encrypted zip, to use it with the upload command or decryt command.
|
|
1062
|
-
|
|
1063
|
-
### **Encrypt V2**
|
|
1064
|
-
|
|
1065
|
-
`npx @capgo/cli bundle encryptV2 [path/to/zip] [checksum]`
|
|
1066
|
-
|
|
1067
|
-
This command is used when you use external source to store your code or for test purpose.
|
|
1068
|
-
The checksum is the sha256 of the bundle (generated by --key-v2), it is used to verify the integrity of the file after decryption.
|
|
1069
|
-
It will be enncrypted with the private key and sent along with the bundle.
|
|
1070
|
-
In encryption v2 the checksum is upgraded to become a "signature" of the bundle.
|
|
1071
|
-
|
|
1072
|
-
Optionally, you can give:
|
|
1073
|
-
|
|
1074
|
-
`--key [/path/to/my/private_key]` the path of your private key.
|
|
1075
|
-
`--key-data [privateKey]` the private key data, if you want to use inline.
|
|
1076
|
-
`--json` to output info as json.
|
|
1077
|
-
The command will print your `ivSessionKey`y and generate an encrypted zip, to use it with the upload command or decryt command.
|
|
1078
|
-
|
|
1079
|
-
### **Decrypt**
|
|
1080
|
-
|
|
1081
|
-
`npx @capgo/cli bundle decrypt [path/to/zip] [ivSessionKey]`
|
|
1082
|
-
|
|
1083
|
-
Optionally, you can give:
|
|
1084
|
-
|
|
1085
|
-
`--key [/path/to/my/private_key]` the path of your private key.
|
|
1086
|
-
|
|
1087
|
-
`--key-data [privateKey]` the private key data, if you want to use inline. This command is mainly used for test purpose, it will decrypt the zip and print the base64 decrypted session key in the console.
|
|
1088
|
-
|
|
1089
|
-
### **Decrypt V2**
|
|
1090
|
-
|
|
1091
|
-
`npx @capgo/cli bundle decryptV2 [path/to/zip] [ivSessionKey]`
|
|
1092
|
-
|
|
1093
|
-
Optionally, you can give:
|
|
1094
|
-
|
|
1095
|
-
`--key [/path/to/my/private_key]` the path of your private key.
|
|
1096
|
-
`--key-data [privateKey]` the private key data, if you want to use inline. This command is mainly used for test purpose, it will decrypt the zip and print the base64 decrypted session key in the console.
|
|
1097
|
-
`--checksum [checksum]` the checksum of the file, it will verify the checksum after decryption.
|
|
1098
|
-
|
|
1099
|
-
### **Zip**
|
|
1100
|
-
|
|
1101
|
-
`npx @capgo/cli bundle zip [appId]`
|
|
1102
|
-
|
|
1103
|
-
`[appId]` is your app ID, the format is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
1104
|
-
|
|
1105
|
-
Optionally, you can give:
|
|
1106
|
-
|
|
1107
|
-
* `--path [/path/to/my/bundle]` to upload a specific folder.
|
|
1108
|
-
* `--bundle [1.0.0]` to set the bundle version number of the filename.
|
|
1109
|
-
* `--name [myapp]` to override the filename.
|
|
1110
|
-
* `--json` to output info as json.
|
|
1111
|
-
* `--no-code-check` to ignore the code check and send the bundle anyway.
|
|
1112
|
-
* `--key-v2` to use the new encryption system. This is required as new encryption system use better checksums to verify the integrity of the file.
|
|
1113
|
-
|
|
1114
|
-
### **Compatibility**
|
|
1115
|
-
|
|
1116
|
-
`npx @capgo/cli bundle compatibility [appId] -c [channelId]`
|
|
1117
|
-
|
|
1118
|
-
`[appId]` is your app ID, the format is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
1119
|
-
`[channelId]` the name of your new channel.
|
|
1120
|
-
|
|
1121
|
-
Optionally, you can give:
|
|
1122
|
-
|
|
1123
|
-
* `--apikey [key]` API key to link to your account.
|
|
1124
|
-
* `--text` use text instead of emojis in the table
|
|
1125
|
-
* `--channel [channel]` the channel to check the compatibility with.
|
|
1126
|
-
* `--package-json <packageJson>` A path to package.json. Usefull for monorepos
|
|
1127
|
-
* `--node-modules <nodeModules>` A list of path to node_modules. Usefull for monorepos (comma separated ex: ../../node_modules,./node_modules)
|
|
1128
|
-
|
|
1129
|
-
## Channel
|
|
1130
|
-
|
|
1131
|
-
### **Add**
|
|
1132
|
-
|
|
1133
|
-
`npx @capgo/cli channel add [channelId] [appId]`
|
|
1134
|
-
|
|
1135
|
-
`[channelId]` the name of your new channel. `[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
1136
|
-
|
|
1137
|
-
### **Delete**
|
|
1138
|
-
|
|
1139
|
-
`npx @capgo/cli channel delete [channelId] [appId]`
|
|
1140
|
-
|
|
1141
|
-
`[channelId]` the name of your channel you want to delete. `[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
1142
|
-
|
|
1143
|
-
Optionally, you can give:
|
|
1144
|
-
|
|
1145
|
-
* `--delete-bundle` Deletes the bundle associated with the channel.
|
|
1146
|
-
|
|
1147
|
-
### **List**
|
|
1148
|
-
|
|
1149
|
-
`npx @capgo/cli channel list [appId]`
|
|
1150
|
-
|
|
1151
|
-
`[appId]` your app ID the format `com.test.app` is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
1152
|
-
|
|
1153
|
-
Optionally, you can give:
|
|
1154
|
-
|
|
1155
|
-
* `--apikey [key]` API key to link to your account.
|
|
1156
|
-
|
|
1157
|
-
### **Set**
|
|
1158
|
-
|
|
1159
|
-
`npx @capgo/cli channel set [channelId] [appId]`
|
|
1160
|
-
|
|
1161
|
-
`[appId]` is your app ID, the format is explained [here](https://capacitorjs.com/docs/cli/commands/init/).
|
|
1162
|
-
|
|
1163
|
-
Optionally, you can give:
|
|
1164
|
-
|
|
1165
|
-
* `--bundle [1.2.3]` your app bundle already sent to the cloud, to link it to a channel.
|
|
1166
|
-
* `--latest` get the bundle version from `package.json:version`, cannot be used with `--bundle`.
|
|
1167
|
-
* `--state [ normal | default ]` set the channel state, can be `normal` or `default`. One channel needs to be `default`.
|
|
1168
|
-
* `--downgrade` allows the channel to send downgrade version to devices.
|
|
1169
|
-
* `--no-downgrade` disallows the channel to send downgrade version to devices.
|
|
1170
|
-
* `--upgrade` allows the channel to send upgrade (major) version to devices.
|
|
1171
|
-
* `--no-upgrade` disallow the channel to send upgrade (major) version to devices.
|
|
1172
|
-
* `--ios` allows the channel to send version to iOS devices.
|
|
1173
|
-
* `--no-ios` disallows the channel to send version to iOS devices.
|
|
1174
|
-
* `--android` allows the channel to send version to android devices.
|
|
1175
|
-
* `--no-android` disallows the channel to send version to android devices.
|
|
1176
|
-
* `--self-assign` allows devices to self assign to this channel.
|
|
1177
|
-
* `--no-self-assign` disallows devices to self assign to this channel.
|
|
1178
|
-
* `--disable-auto-update STRATEGY` Disable auto update strategy for this channel. The possible options are: major, minor, metadata, none.
|
|
1179
|
-
* `--apikey [key]` API key to link to your account.
|
|
1180
|
-
|
|
1181
|
-
## Disable updates strategy
|
|
1182
|
-
|
|
1183
|
-
There are a few ways to handle disabling updates for too old versions.\
|
|
1184
|
-
Capgo cannot update native code thus an update from a version with the old native code to a version with the updated native code should not be possible.
|
|
1185
|
-
There are a couple of ways to achieve that.
|
|
1186
|
-
|
|
1187
|
-
First, the `major` strategy. It prevents an update from `0.0.0` -> `1.0.0`. The major is the highlighted number (**1**.0.0 and **0**.0.0).\
|
|
1188
|
-
Second is the `minor` strategy. It prevents an update from `0.0.0` -> `1.1.0` or an update from `1.1.0` to `1.2.0`.
|
|
1189
|
-
**BE AWARE** this strategy does not prevent an update from `0.1.0` -> `1.1.0`
|
|
1190
|
-
|
|
1191
|
-
Third, the `patch` strategy. It was added into capgo as a very strict mode. It's not recomended to be used unless you fully understand how it works.
|
|
1192
|
-
In order for it to accept a update the following conditions must be meet:
|
|
1193
|
-
- The major is the same between the new and the old version
|
|
1194
|
-
- The minor is the same between the new and the old version
|
|
1195
|
-
- The patch of the new version if greater then the patch of the old version
|
|
1196
|
-
|
|
1197
|
-
Here is an example of which scenarios the update is allowed or denied
|
|
1198
|
-
|
|
1199
|
-
- 0.0.311 -> 0.0.314 β
|
|
1200
|
-
- 0.0.0 -> 0.0.314 β
|
|
1201
|
-
- 0.0.316 -> 0.0.314 β
|
|
1202
|
-
- 0.1.312 -> 0.0.314 β
|
|
1203
|
-
- 1.0.312 -> 0.0.314 β
|
|
1204
|
-
|
|
1205
|
-
Lastly the most complicated strategy. The `metadata` strategy.\
|
|
1206
|
-
First you need to know that initially after you enable it the updates **WILL** fail as the channel is lacking the required metadata.\
|
|
1207
|
-
If the channel is lacking metadata you will see a message like this:
|
|
1208
|
-
<img src="/fail-metadata.webp" alt="Cannot find metadata"/>
|
|
1209
|
-
|
|
1210
|
-
If you see something like this you know that you have to go to the current bundle for the failing channel and set the metadata.\
|
|
1211
|
-
First, figure out what channel is failing. You can do that by looking at the `misconfigured` column
|
|
1212
|
-
<img src="/misconfigured-table.webp" alt="Misconfigured table"/>
|
|
1213
|
-
|
|
1214
|
-
Then go to the failing channel and click on `Bundle number`. This should take you to the bundle page.
|
|
1215
|
-
<img src="/fail-channel-show.webp" alt="Locate failing channel"/>
|
|
1216
|
-
|
|
1217
|
-
Once there fill the `Minimal update version` field. This should be a [semver](https://devhints.io/semver/).\
|
|
1218
|
-
If the value you pass is not a semver you will get an error, but if everything goes correctly you should see something like this:
|
|
1219
|
-
<img src="/set-min-update-version.webp" alt="Set min version"/>
|
|
1220
|
-
|
|
1221
|
-
Now, you likely do not want to set this data manually every time you update. Fortunately, the CLI will prevent you from sending an update without this metadata
|
|
1222
|
-
<img src="/cli-fail-no-metadata.webp" alt="CLI fail no metadata"/>
|
|
1223
|
-
|
|
1224
|
-
To properly upload a bundle when using the `metadata` option you need to pass the `--min-update-version` with the valid semver. Something like this:
|
|
1225
|
-
<img src="/cli-upload-with-metadata.webp" alt="CLI upload with metadata"/>
|
|
1226
|
-
|
|
1227
|
-
The `--min-update-version` is not the ONLY way to do compatibility.
|
|
1228
|
-
There also exists the `--auto-min-update-version`. Here is how it works.
|
|
1229
|
-
|
|
1230
|
-
First, it takes a look at the version curently uploaded to the channel. It checks compatibility same as `bundle compatibility` command would.
|
|
1231
|
-
Second, if the new version is 100% compatible it reuses the `min_update_version` from the latest version in the channel.
|
|
1232
|
-
If not, then it sets the `min_update_version` to the bundle number of the newly uploaded version.
|
|
1233
|
-
|
|
1234
|
-
You will always get an information what is the `min_update_version` when using this option. It will look something like this:
|
|
1235
|
-
<img src="/min_update_version_info.webp" alt="Min update version"/>
|
|
1236
|
-
|
|
1237
|
-
If the new version is not compatible it should look something like this
|
|
1238
|
-
<img src="/min_update_version_not_compatible.webp" alt="Min update version not compatible"/>
|
|
1239
|
-
|
|
1240
|
-
## End-to-End encryption (Trustless)
|
|
1241
|
-
|
|
1242
|
-
Capgo supports end-to-end encryption, this means that your bundle(code) is encrypted before sent to the cloud and decrypted on the device. For that, you need to generate an RSA key pair, you can use the following command to generate it.
|
|
1243
|
-
|
|
1244
|
-
The encryption system is a combination of RSA and AES, the RSA key is used to encrypt the AES key, and the AES key is used to encrypt the file.
|
|
1245
|
-
|
|
1246
|
-
See below for more information about the encryption system.
|
|
1247
|
-
|
|
1248
|
-
<figure><img src="/crypto_explained.png" alt=""><figcaption><p>Ecryption schema</p></figcaption></figure>
|
|
1249
|
-
|
|
1250
|
-
Ecryption schema
|
|
1251
|
-
|
|
1252
|
-
### Create key for your app
|
|
1253
|
-
|
|
1254
|
-
`npx @capgo/cli key create`
|
|
1255
|
-
|
|
1256
|
-
Optionally, you can give: `--force` to overwrite the existing key. This command will create for you a key pair in your app, and will ask you to save the private key in a safe place. It's recommended to not git commit the private key, and to not share it with anyone.
|
|
1257
|
-
|
|
1258
|
-
> After your local test, remove the key from the config file and add it on the CI step with `key save`
|
|
1259
|
-
|
|
1260
|
-
### Save key in your app config
|
|
1261
|
-
|
|
1262
|
-
`npx @capgo/cli key save`
|
|
1263
|
-
|
|
1264
|
-
Optionally, you can give:
|
|
1265
|
-
|
|
1266
|
-
`--key [/path/to/my/private_key]` the path of your private key.
|
|
1267
|
-
|
|
1268
|
-
`--key-data [privateKey]` the private key data, if you want to use inline. This command is useful if you followed the recommendation and didn't commit the key in your app, and in the config.
|
|
1269
|
-
|
|
1270
|
-
## Ci integration
|
|
1271
|
-
|
|
1272
|
-
To automate your work, I recommend you make GitHub action do the job of pushing to our server
|
|
1273
|
-
|
|
1274
|
-
[GitHub action tutorial](https://capgo.app/blog/automatic-build-and-release-with-github-actions/)
|
|
1275
|
-
|
|
1276
|
-
## Our demo app
|
|
1277
|
-
|
|
1278
|
-
[GitHub - Cap-go/demo-app](https://github.com/Cap-go/demo-app/)
|
|
1279
|
-
|
|
1280
|
-
Donβt forget to configure CI env variable with your API key
|
|
1281
|
-
|
|
1282
|
-
## Dev contribution
|
|
1283
|
-
|
|
1284
|
-
1. Install development dependencies
|
|
1285
|
-
|
|
1286
|
-
```shell
|
|
1287
|
-
rm -rf node_modules
|
|
1288
|
-
npm i
|
|
1289
|
-
```
|
|
1290
|
-
|
|
1291
|
-
2. Set `"sourceMap": true,` in `tsconfig.json`
|
|
1292
|
-
|
|
1293
|
-
3. Run webpack development server
|
|
1294
|
-
|
|
1295
|
-
```shell
|
|
1296
|
-
npm run dev
|
|
1297
|
-
```
|
|
1298
|
-
|
|
1299
|
-
4. Attach debugger to the process started with `npm run dev`
|
|
1300
|
-
|
|
1301
|
-
> VS Code:
|
|
1302
|
-
|
|
1303
|
-
- Run `Debug on fixtures` launch configuration
|
|
1304
|
-
- Edit configuration to debug on different files
|
|
1305
|
-
|
|
1306
|
-
> Other IDEs:
|
|
1307
|
-
|
|
1308
|
-
- Attach debugger of your choice to the running process, use `.vscode/launch.json` `Debug on fixtures` configuration as the example
|
|
1309
|
-
|
|
1310
|
-
## Production build
|
|
1311
|
-
|
|
1312
|
-
1. Set `"sourceMap": false,` in `tsconfig.json`
|
|
1313
|
-
|
|
1314
|
-
> TODO: add separate build config
|
|
1315
|
-
|
|
1316
|
-
2. Run
|
|
1317
|
-
|
|
1318
|
-
```shell
|
|
1319
|
-
npm install && set NODE_ENV=production&& npx webpack --config webpack.config.js && rm -rf node_modules && npm i --only=prod && npm prune --production && npm shrinkwrap
|
|
1320
|
-
```
|
|
1321
|
-
|
|
1322
|
-
## Publish to NPM
|
|
1323
|
-
|
|
1324
|
-
To release a new package version:
|
|
1325
|
-
|
|
1326
|
-
1. Bump version in `package.json` manually
|
|
1327
|
-
2. Run commands from **Production build** section
|
|
1328
|
-
3. Run `npm publish --dry-run`:
|
|
1329
|
-
|
|
1330
|
-
- ensure that only necessary files are listed in package preview
|
|
1331
|
-
|
|
1332
|
-
- ensure that `npm-shrinkwrap.json` **does not include development dependencies**
|
|
1333
|
-
|
|
1334
|
-
4. Run `npm publish` or `npm publish --tag beta`
|
|
1335
|
-
|
|
1336
|
-
## Pack executable
|
|
1337
|
-
|
|
1338
|
-
**prerequisite**: perform production build
|
|
1339
|
-
|
|
1340
|
-
> Pkg will not resolve dynamic module imports, so avoid these at all costs. (Basically, just use plain ordinary static `import Something from 'somewhere'` and no issue should arise)
|
|
1341
|
-
|
|
1342
|
-
Build for all supported platforms
|
|
1343
|
-
|
|
1344
|
-
```shell
|
|
1345
|
-
pkg ./dist/index.js
|
|
1346
|
-
```
|
|
1347
|
-
|
|
1348
|
-
> You can specify targets with `-t` option (refer to `pkg --help` and examples on [pkg's npm](https://www.npmjs.com/package/pkg))
|
|
1349
|
-
> e.g. use `pkg -t node14-win-x64 ./dist/index.js` to build for Node14, Windows x64
|
|
1350
|
-
|
|
1351
|
-
Build for Node14 Windows x64
|
|
1352
|
-
|
|
1353
|
-
```shell
|
|
1354
|
-
pkg -t node14-win-x64 ./dist/index.js
|
|
1355
|
-
```
|