@dxos/cli 0.1.53-main.3ecc504 → 0.1.53-main.499755c

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 (135) hide show
  1. package/README.md +103 -72
  2. package/bin/dev +3 -0
  3. package/dist/src/base-command.d.ts +12 -9
  4. package/dist/src/base-command.d.ts.map +1 -1
  5. package/dist/src/base-command.js +27 -14
  6. package/dist/src/base-command.js.map +1 -1
  7. package/dist/src/commands/agent/agent.test.d.ts +2 -0
  8. package/dist/src/commands/agent/agent.test.d.ts.map +1 -0
  9. package/dist/src/commands/agent/agent.test.js +175 -0
  10. package/dist/src/commands/agent/agent.test.js.map +1 -0
  11. package/dist/src/commands/agent/list.d.ts.map +1 -1
  12. package/dist/src/commands/agent/list.js +4 -2
  13. package/dist/src/commands/agent/list.js.map +1 -1
  14. package/dist/src/commands/agent/restart.js +1 -1
  15. package/dist/src/commands/agent/restart.js.map +1 -1
  16. package/dist/src/commands/agent/start.d.ts +1 -0
  17. package/dist/src/commands/agent/start.d.ts.map +1 -1
  18. package/dist/src/commands/agent/start.js +18 -12
  19. package/dist/src/commands/agent/start.js.map +1 -1
  20. package/dist/src/commands/agent/stop.d.ts +1 -0
  21. package/dist/src/commands/agent/stop.d.ts.map +1 -1
  22. package/dist/src/commands/agent/stop.js +1 -1
  23. package/dist/src/commands/agent/stop.js.map +1 -1
  24. package/dist/src/commands/app/create.d.ts +1 -0
  25. package/dist/src/commands/app/create.d.ts.map +1 -1
  26. package/dist/src/commands/app/open.d.ts +1 -0
  27. package/dist/src/commands/app/open.d.ts.map +1 -1
  28. package/dist/src/commands/app/open.js +4 -4
  29. package/dist/src/commands/app/open.js.map +1 -1
  30. package/dist/src/commands/app/publish.d.ts +1 -0
  31. package/dist/src/commands/app/publish.d.ts.map +1 -1
  32. package/dist/src/commands/debug/stats.d.ts +2 -1
  33. package/dist/src/commands/debug/stats.d.ts.map +1 -1
  34. package/dist/src/commands/debug/stats.js +28 -1
  35. package/dist/src/commands/debug/stats.js.map +1 -1
  36. package/dist/src/commands/device/index.d.ts.map +1 -1
  37. package/dist/src/commands/device/index.js +4 -0
  38. package/dist/src/commands/device/index.js.map +1 -1
  39. package/dist/src/commands/function/{dev.d.ts → dev-server.d.ts} +8 -2
  40. package/dist/src/commands/function/dev-server.d.ts.map +1 -0
  41. package/dist/src/commands/function/dev-server.js +69 -0
  42. package/dist/src/commands/function/dev-server.js.map +1 -0
  43. package/dist/src/commands/function/exec.d.ts +4 -0
  44. package/dist/src/commands/function/exec.d.ts.map +1 -1
  45. package/dist/src/commands/function/exec.js +4 -0
  46. package/dist/src/commands/function/exec.js.map +1 -1
  47. package/dist/src/commands/function/list.d.ts +4 -0
  48. package/dist/src/commands/function/list.d.ts.map +1 -1
  49. package/dist/src/commands/function/list.js +4 -0
  50. package/dist/src/commands/function/list.js.map +1 -1
  51. package/dist/src/commands/function/logs.d.ts +4 -0
  52. package/dist/src/commands/function/logs.d.ts.map +1 -1
  53. package/dist/src/commands/function/logs.js +4 -0
  54. package/dist/src/commands/function/logs.js.map +1 -1
  55. package/dist/src/commands/halo/credential/list.d.ts +1 -0
  56. package/dist/src/commands/halo/credential/list.d.ts.map +1 -1
  57. package/dist/src/commands/halo/join.d.ts +1 -0
  58. package/dist/src/commands/halo/join.d.ts.map +1 -1
  59. package/dist/src/commands/halo/join.js +2 -2
  60. package/dist/src/commands/halo/join.js.map +1 -1
  61. package/dist/src/commands/halo/share.d.ts +1 -0
  62. package/dist/src/commands/halo/share.d.ts.map +1 -1
  63. package/dist/src/commands/halo/share.js +4 -4
  64. package/dist/src/commands/halo/share.js.map +1 -1
  65. package/dist/src/commands/kube/deploy.d.ts +1 -0
  66. package/dist/src/commands/kube/deploy.d.ts.map +1 -1
  67. package/dist/src/commands/reset/index.d.ts +1 -0
  68. package/dist/src/commands/reset/index.d.ts.map +1 -1
  69. package/dist/src/commands/reset/index.js +8 -5
  70. package/dist/src/commands/reset/index.js.map +1 -1
  71. package/dist/src/commands/space/create.d.ts.map +1 -1
  72. package/dist/src/commands/space/create.js +2 -29
  73. package/dist/src/commands/space/create.js.map +1 -1
  74. package/dist/src/commands/space/epoch.d.ts +1 -0
  75. package/dist/src/commands/space/epoch.d.ts.map +1 -1
  76. package/dist/src/commands/space/epoch.js +1 -0
  77. package/dist/src/commands/space/epoch.js.map +1 -1
  78. package/dist/src/commands/space/invite.d.ts.map +1 -1
  79. package/dist/src/commands/space/invite.js +4 -4
  80. package/dist/src/commands/space/invite.js.map +1 -1
  81. package/dist/src/commands/space/join.d.ts +1 -0
  82. package/dist/src/commands/space/join.d.ts.map +1 -1
  83. package/dist/src/commands/space/join.js +3 -2
  84. package/dist/src/commands/space/join.js.map +1 -1
  85. package/dist/src/commands/space/list.d.ts +1 -0
  86. package/dist/src/commands/space/list.d.ts.map +1 -1
  87. package/dist/src/commands/space/list.js +1 -0
  88. package/dist/src/commands/space/list.js.map +1 -1
  89. package/dist/src/commands/space/members.d.ts +1 -0
  90. package/dist/src/commands/space/members.d.ts.map +1 -1
  91. package/dist/src/commands/space/members.js +1 -0
  92. package/dist/src/commands/space/members.js.map +1 -1
  93. package/dist/src/commands/tunnel/set.d.ts +1 -0
  94. package/dist/src/commands/tunnel/set.d.ts.map +1 -1
  95. package/dist/src/help.d.ts +6 -0
  96. package/dist/src/help.d.ts.map +1 -0
  97. package/dist/src/help.js +23 -0
  98. package/dist/src/help.js.map +1 -0
  99. package/dist/src/hooks/command-not-found.d.ts +4 -0
  100. package/dist/src/hooks/command-not-found.d.ts.map +1 -0
  101. package/dist/src/hooks/command-not-found.js +14 -0
  102. package/dist/src/hooks/command-not-found.js.map +1 -0
  103. package/dist/src/util/invitation.d.ts +1 -1
  104. package/dist/src/util/invitation.d.ts.map +1 -1
  105. package/dist/src/util/invitation.js +7 -7
  106. package/dist/src/util/invitation.js.map +1 -1
  107. package/dist/src/util/print.d.ts +3 -4
  108. package/dist/src/util/print.d.ts.map +1 -1
  109. package/dist/src/util/print.js +2 -2
  110. package/dist/src/util/print.js.map +1 -1
  111. package/dist/src/util/publish/publisher-rpc-peer.d.ts.map +1 -1
  112. package/dist/src/util/publish/publisher-rpc-peer.js +4 -5
  113. package/dist/src/util/publish/publisher-rpc-peer.js.map +1 -1
  114. package/dist/src/util/supervisor/supervisor-rpc-peer.d.ts.map +1 -1
  115. package/dist/src/util/supervisor/supervisor-rpc-peer.js +4 -5
  116. package/dist/src/util/supervisor/supervisor-rpc-peer.js.map +1 -1
  117. package/dist/src/util/telemetry.d.ts.map +1 -1
  118. package/dist/src/util/telemetry.js.map +1 -1
  119. package/dist/src/util/telemetryrc.json +1 -1
  120. package/dist/src/util/test-util.d.ts +1 -0
  121. package/dist/src/util/test-util.d.ts.map +1 -1
  122. package/dist/src/util/test-util.js +14 -5
  123. package/dist/src/util/test-util.js.map +1 -1
  124. package/dist/src/util/tunnel/tunnel-rpc-peer.d.ts.map +1 -1
  125. package/dist/src/util/tunnel/tunnel-rpc-peer.js +4 -5
  126. package/dist/src/util/tunnel/tunnel-rpc-peer.js.map +1 -1
  127. package/dist/src/util/util.d.ts +1 -1
  128. package/dist/src/util/util.d.ts.map +1 -1
  129. package/dist/src/util/util.js +1 -0
  130. package/dist/src/util/util.js.map +1 -1
  131. package/oclif.manifest.json +39 -45
  132. package/package.json +31 -32
  133. package/dist/src/commands/function/dev.d.ts.map +0 -1
  134. package/dist/src/commands/function/dev.js +0 -37
  135. package/dist/src/commands/function/dev.js.map +0 -1
package/README.md CHANGED
@@ -2,21 +2,46 @@
2
2
 
3
3
  DXOS command line interface.
4
4
 
5
- TODO(wittjosiah): Add oclif-specific linting rules.
5
+ <!-- toc -->
6
+ * [DX CLI](#dx-cli)
7
+ * [Development](#development)
8
+ * [Usage](#usage)
9
+ <!-- tocstop -->
10
+
6
11
 
7
12
  # Development
8
13
 
9
- Run the build script from the root directory.
14
+ To build the CLI:
15
+
16
+ ```bash
17
+ nx run cli:build --watch=true
18
+ ```
19
+
20
+ Run the CLI from the local directory:
21
+
22
+ ```bash
23
+ ./bin/run config --json
24
+ ```
25
+
26
+ Or source the following script to set the `dx` alias from any directory in the repo.
27
+
28
+ ```bash
29
+ . $(git rev-parse --show-toplevel)/packages/devtools/cli/scripts/dev.sh
30
+
31
+ dx config --json
32
+ ```
33
+
34
+ ## Resetting the CLI
10
35
 
11
36
  ```bash
12
- $ nx run cli:build --watch=true
13
37
  ```
14
38
 
15
- Run the CLI in the local directory.
39
+ ## Reporting errors
40
+
41
+ Run the following command to create a gist of the debug stats.
16
42
 
17
43
  ```bash
18
- $ export DX_CONFIG=./config/config.yml
19
- $ ./bin/run config --json
44
+ dx debug stats --json --no-agent | gh gist create
20
45
  ```
21
46
 
22
47
  # Usage
@@ -27,7 +52,7 @@ $ npm install -g @dxos/cli
27
52
  $ dx COMMAND
28
53
  running command...
29
54
  $ dx (--version)
30
- @dxos/cli/0.1.53-main.3ecc504 linux-x64 node-v18.16.1
55
+ @dxos/cli/0.1.53-main.499755c linux-x64 node-v18.16.1
31
56
  $ dx --help [COMMAND]
32
57
  USAGE
33
58
  $ dx COMMAND
@@ -35,7 +60,7 @@ USAGE
35
60
  ```
36
61
  <!-- usagestop -->
37
62
 
38
- # Commands
63
+ ## Commands
39
64
 
40
65
  <!-- commands -->
41
66
  * [`dx agent list`](#dx-agent-list)
@@ -51,6 +76,7 @@ USAGE
51
76
  * [`dx device`](#dx-device)
52
77
  * [`dx device list`](#dx-device-list)
53
78
  * [`dx function dev`](#dx-function-dev)
79
+ * [`dx function dev-server`](#dx-function-dev-server)
54
80
  * [`dx function exec NAME`](#dx-function-exec-name)
55
81
  * [`dx function list`](#dx-function-list)
56
82
  * [`dx function logs NAME`](#dx-function-logs-name)
@@ -145,15 +171,13 @@ FLAGS
145
171
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
146
172
  --dry-run Dry run.
147
173
  --echo=port Expose ECHO REST API.
174
+ --json Output as JSON.
148
175
  --monitor Run epoch monitoring.
149
176
  --no-agent Auto-start agent.
150
177
  --profile=<value> [default: default] User profile.
151
178
  --timeout=<value> [default: 30] Timeout in seconds.
152
179
  --web-socket=port Expose web socket port.
153
180
 
154
- GLOBAL FLAGS
155
- --json Format output as json.
156
-
157
181
  DESCRIPTION
158
182
  Starts the agent.
159
183
  ```
@@ -172,13 +196,11 @@ FLAGS
172
196
  -v, --verbose Verbose output
173
197
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
174
198
  --dry-run Dry run.
199
+ --json Output as JSON.
175
200
  --no-agent Auto-start agent.
176
201
  --profile=<value> [default: default] User profile.
177
202
  --timeout=<value> [default: 30] Timeout in seconds.
178
203
 
179
- GLOBAL FLAGS
180
- --json Format output as json.
181
-
182
204
  DESCRIPTION
183
205
  Stop agent daemon.
184
206
  ```
@@ -202,14 +224,12 @@ FLAGS
202
224
  -v, --verbose Verbose output
203
225
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
204
226
  --dry-run Dry run.
227
+ --json Output as JSON.
205
228
  --no-agent Auto-start agent.
206
229
  --profile=<value> [default: default] User profile.
207
230
  --tag=<value> Git tag or branch of the DXOS repo to checkout.
208
231
  --timeout=<value> [default: 30] Timeout in seconds.
209
232
 
210
- GLOBAL FLAGS
211
- --json Format output as json.
212
-
213
233
  DESCRIPTION
214
234
  Manage applications.
215
235
  ```
@@ -281,15 +301,13 @@ FLAGS
281
301
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
282
302
  --configPath=<value> Path to dx.yml
283
303
  --dry-run Dry run.
304
+ --json Output as JSON.
284
305
  --no-agent Auto-start agent.
285
306
  --profile=<value> [default: default] User profile.
286
307
  --skipExisting Do not update content on KUBE if version already exists.
287
308
  --timeout=<value> [default: 30] Timeout in seconds.
288
309
  --version=<value> Version of modules to publish.
289
310
 
290
- GLOBAL FLAGS
291
- --json Format output as json.
292
-
293
311
  DESCRIPTION
294
312
  Publish apps.
295
313
  ```
@@ -323,21 +341,19 @@ Output debug stats.
323
341
 
324
342
  ```
325
343
  USAGE
326
- $ dx debug stats [--json] [--dry-run] [-v] [--config <value> --profile <value>] [--no-agent] [--timeout
344
+ $ dx debug stats [--json] [--dry-run] [--verbose] [--config <value> --profile <value>] [--no-agent] [--timeout
327
345
  <value>] [--humanize] [--truncate]
328
346
 
329
347
  FLAGS
330
- -v, --verbose Verbose output
331
348
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
332
349
  --dry-run Dry run.
333
350
  --humanize Humanized keys.
351
+ --json Output as JSON.
334
352
  --no-agent Auto-start agent.
335
353
  --profile=<value> [default: default] User profile.
336
354
  --timeout=<value> [default: 30] Timeout in seconds.
337
355
  --truncate Truncate keys.
338
-
339
- GLOBAL FLAGS
340
- --json Format output as json.
356
+ --verbose Verbose output.
341
357
 
342
358
  DESCRIPTION
343
359
  Output debug stats.
@@ -391,7 +407,7 @@ DESCRIPTION
391
407
 
392
408
  ## `dx function dev`
393
409
 
394
- Functions dev server.
410
+ Development server.
395
411
 
396
412
  ```
397
413
  USAGE
@@ -402,17 +418,55 @@ FLAGS
402
418
  -v, --verbose Verbose output
403
419
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
404
420
  --dry-run Dry run.
421
+ --json Output as JSON.
405
422
  --manifest=<value> [default: functions.yml]
406
423
  --no-agent Auto-start agent.
407
424
  --profile=<value> [default: default] User profile.
408
- --require=<value>...
425
+ --require=<value>... [default: ts-node/register]
409
426
  --timeout=<value> [default: 30] Timeout in seconds.
410
427
 
411
- GLOBAL FLAGS
412
- --json Format output as json.
428
+ DESCRIPTION
429
+ Development server.
430
+
431
+ ALIASES
432
+ $ dx function dev
433
+
434
+ EXAMPLES
435
+ Run with TypeScript support.
436
+
437
+ $ dx function dev-server -r ts-node/register --verbose
438
+ ```
439
+
440
+ ## `dx function dev-server`
441
+
442
+ Development server.
443
+
444
+ ```
445
+ USAGE
446
+ $ dx function dev-server [--json] [--dry-run] [-v] [--config <value> --profile <value>] [--no-agent] [--timeout
447
+ <value>] [--require <value>] [--manifest <value>]
448
+
449
+ FLAGS
450
+ -v, --verbose Verbose output
451
+ --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
452
+ --dry-run Dry run.
453
+ --json Output as JSON.
454
+ --manifest=<value> [default: functions.yml]
455
+ --no-agent Auto-start agent.
456
+ --profile=<value> [default: default] User profile.
457
+ --require=<value>... [default: ts-node/register]
458
+ --timeout=<value> [default: 30] Timeout in seconds.
413
459
 
414
460
  DESCRIPTION
415
- Functions dev server.
461
+ Development server.
462
+
463
+ ALIASES
464
+ $ dx function dev
465
+
466
+ EXAMPLES
467
+ Run with TypeScript support.
468
+
469
+ $ dx function dev-server -r ts-node/register --verbose
416
470
  ```
417
471
 
418
472
  ## `dx function exec NAME`
@@ -558,13 +612,11 @@ FLAGS
558
612
  -v, --verbose Verbose output
559
613
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
560
614
  --dry-run Dry run.
615
+ --json Output as JSON.
561
616
  --no-agent Auto-start agent.
562
617
  --profile=<value> [default: default] User profile.
563
618
  --timeout=<value> [default: 30] Timeout in seconds.
564
619
 
565
- GLOBAL FLAGS
566
- --json Format output as json.
567
-
568
620
  DESCRIPTION
569
621
  Import credential into HALO.
570
622
  ```
@@ -582,14 +634,12 @@ FLAGS
582
634
  -v, --verbose Verbose output
583
635
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
584
636
  --dry-run Dry run.
637
+ --json Output as JSON.
585
638
  --no-agent Auto-start agent.
586
639
  --profile=<value> [default: default] User profile.
587
640
  --timeout=<value> [default: 30] Timeout in seconds.
588
641
  --type=<value> Type
589
642
 
590
- GLOBAL FLAGS
591
- --json Format output as json.
592
-
593
643
  DESCRIPTION
594
644
  List HALO credentials.
595
645
  ```
@@ -608,13 +658,11 @@ FLAGS
608
658
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
609
659
  --dry-run Dry run.
610
660
  --invitation=<value> Invitation code
661
+ --json Output as JSON.
611
662
  --no-agent Auto-start agent.
612
663
  --profile=<value> [default: default] User profile.
613
664
  --timeout=<value> [default: 30] Timeout in seconds.
614
665
 
615
- GLOBAL FLAGS
616
- --json Format output as json.
617
-
618
666
  DESCRIPTION
619
667
  Join HALO (device) invitation.
620
668
  ```
@@ -662,7 +710,7 @@ DESCRIPTION
662
710
  Display help for dx.
663
711
  ```
664
712
 
665
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.8/src/commands/help.ts)_
713
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.14/src/commands/help.ts)_
666
714
 
667
715
  ## `dx kube auth`
668
716
 
@@ -703,14 +751,12 @@ FLAGS
703
751
  --dev Deploy latest version from dev channel
704
752
  --dry-run Dry run.
705
753
  --hostname=<value> (required) Hostname
754
+ --json Output as JSON.
706
755
  --no-agent Auto-start agent.
707
756
  --profile=<value> [default: default] User profile.
708
757
  --provider=<value> [default: digitalocean] Cloud Provider
709
758
  --timeout=<value> [default: 30] Timeout in seconds.
710
759
 
711
- GLOBAL FLAGS
712
- --json Format output as json.
713
-
714
760
  DESCRIPTION
715
761
  Deploy KUBE.
716
762
  ```
@@ -721,11 +767,14 @@ List installed plugins.
721
767
 
722
768
  ```
723
769
  USAGE
724
- $ dx plugins [--core]
770
+ $ dx plugins [--json] [--core]
725
771
 
726
772
  FLAGS
727
773
  --core Show core plugins.
728
774
 
775
+ GLOBAL FLAGS
776
+ --json Format output as json.
777
+
729
778
  DESCRIPTION
730
779
  List installed plugins.
731
780
 
@@ -733,7 +782,7 @@ EXAMPLES
733
782
  $ dx plugins
734
783
  ```
735
784
 
736
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.4.3/src/commands/plugins/index.ts)_
785
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.1.8/src/commands/plugins/index.ts)_
737
786
 
738
787
  ## `dx plugins:install PLUGIN...`
739
788
 
@@ -962,13 +1011,11 @@ FLAGS
962
1011
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
963
1012
  --dry-run Dry run.
964
1013
  --force Force delete.
1014
+ --json Output as JSON.
965
1015
  --no-agent Auto-start agent.
966
1016
  --profile=<value> [default: default] User profile.
967
1017
  --timeout=<value> [default: 30] Timeout in seconds.
968
1018
 
969
- GLOBAL FLAGS
970
- --json Format output as json.
971
-
972
1019
  DESCRIPTION
973
1020
  Reset user data.
974
1021
  ```
@@ -985,13 +1032,11 @@ FLAGS
985
1032
  -v, --verbose Verbose output
986
1033
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
987
1034
  --dry-run Dry run.
1035
+ --json Output as JSON.
988
1036
  --no-agent Auto-start agent.
989
1037
  --profile=<value> [default: default] User profile.
990
1038
  --timeout=<value> [default: 30] Timeout in seconds.
991
1039
 
992
- GLOBAL FLAGS
993
- --json Format output as json.
994
-
995
1040
  DESCRIPTION
996
1041
  Interactive shell.
997
1042
  ```
@@ -1008,13 +1053,11 @@ FLAGS
1008
1053
  -v, --verbose Verbose output
1009
1054
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
1010
1055
  --dry-run Dry run.
1056
+ --json Output as JSON.
1011
1057
  --no-agent Auto-start agent.
1012
1058
  --profile=<value> [default: default] User profile.
1013
1059
  --timeout=<value> [default: 30] Timeout in seconds.
1014
1060
 
1015
- GLOBAL FLAGS
1016
- --json Format output as json.
1017
-
1018
1061
  DESCRIPTION
1019
1062
  List spaces.
1020
1063
  ```
@@ -1064,6 +1107,7 @@ FLAGS
1064
1107
  --csv output is csv format [alias: --output=csv]
1065
1108
  --dry-run Dry run.
1066
1109
  --filter=<value> filter property by partial string matching, ex: name=foo
1110
+ --json Output as JSON.
1067
1111
  --no-agent Auto-start agent.
1068
1112
  --no-header hide table header from output
1069
1113
  --no-truncate do not truncate output to fit screen
@@ -1073,9 +1117,6 @@ FLAGS
1073
1117
  --sort=<value> property to sort by (prepend '-' for descending)
1074
1118
  --timeout=<value> [default: 30] Timeout in seconds.
1075
1119
 
1076
- GLOBAL FLAGS
1077
- --json Format output as json.
1078
-
1079
1120
  DESCRIPTION
1080
1121
  Create new epoch.
1081
1122
  ```
@@ -1093,13 +1134,11 @@ FLAGS
1093
1134
  -v, --verbose Verbose output
1094
1135
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
1095
1136
  --dry-run Dry run.
1137
+ --json Output as JSON.
1096
1138
  --no-agent Auto-start agent.
1097
1139
  --profile=<value> [default: default] User profile.
1098
1140
  --timeout=<value> [default: 30] Timeout in seconds.
1099
1141
 
1100
- GLOBAL FLAGS
1101
- --json Format output as json.
1102
-
1103
1142
  DESCRIPTION
1104
1143
  Create space invitation.
1105
1144
  ```
@@ -1118,14 +1157,12 @@ FLAGS
1118
1157
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
1119
1158
  --dry-run Dry run.
1120
1159
  --invitation=<value> Invitation code
1160
+ --json Output as JSON.
1121
1161
  --no-agent Auto-start agent.
1122
1162
  --profile=<value> [default: default] User profile.
1123
1163
  --secret=<value> Invitation secret
1124
1164
  --timeout=<value> [default: 30] Timeout in seconds.
1125
1165
 
1126
- GLOBAL FLAGS
1127
- --json Format output as json.
1128
-
1129
1166
  DESCRIPTION
1130
1167
  Join space invitation
1131
1168
  ```
@@ -1148,6 +1185,7 @@ FLAGS
1148
1185
  --csv output is csv format [alias: --output=csv]
1149
1186
  --dry-run Dry run.
1150
1187
  --filter=<value> filter property by partial string matching, ex: name=foo
1188
+ --json Output as JSON.
1151
1189
  --no-agent Auto-start agent.
1152
1190
  --no-header hide table header from output
1153
1191
  --no-truncate do not truncate output to fit screen
@@ -1157,9 +1195,6 @@ FLAGS
1157
1195
  --sort=<value> property to sort by (prepend '-' for descending)
1158
1196
  --timeout=<value> [default: 30] Timeout in seconds.
1159
1197
 
1160
- GLOBAL FLAGS
1161
- --json Format output as json.
1162
-
1163
1198
  DESCRIPTION
1164
1199
  List spaces.
1165
1200
  ```
@@ -1185,6 +1220,7 @@ FLAGS
1185
1220
  --csv output is csv format [alias: --output=csv]
1186
1221
  --dry-run Dry run.
1187
1222
  --filter=<value> filter property by partial string matching, ex: name=foo
1223
+ --json Output as JSON.
1188
1224
  --no-agent Auto-start agent.
1189
1225
  --no-header hide table header from output
1190
1226
  --no-truncate do not truncate output to fit screen
@@ -1194,9 +1230,6 @@ FLAGS
1194
1230
  --sort=<value> property to sort by (prepend '-' for descending)
1195
1231
  --timeout=<value> [default: 30] Timeout in seconds.
1196
1232
 
1197
- GLOBAL FLAGS
1198
- --json Format output as json.
1199
-
1200
1233
  DESCRIPTION
1201
1234
  List space members.
1202
1235
  ```
@@ -1240,13 +1273,11 @@ FLAGS
1240
1273
  --disabled Disable tunnel.
1241
1274
  --dry-run Dry run.
1242
1275
  --enabled Enable tunnel.
1276
+ --json Output as JSON.
1243
1277
  --no-agent Auto-start agent.
1244
1278
  --profile=<value> [default: default] User profile.
1245
1279
  --timeout=<value> [default: 30] Timeout in seconds.
1246
1280
 
1247
- GLOBAL FLAGS
1248
- --json Format output as json.
1249
-
1250
1281
  DESCRIPTION
1251
1282
  Enable or disable tunnel.
1252
1283
  ```
package/bin/dev CHANGED
@@ -1,6 +1,9 @@
1
1
  #!/usr/bin/env -S node --no-warnings
2
2
  // NOTE: Specify --no-warnings in production script.
3
3
 
4
+ const chalk = require('chalk');
5
+ console.log(chalk`{yellow.bold Warning: Running CLI in dev mode (only for development purposes).}`)
6
+
4
7
  const oclif = require('@oclif/core')
5
8
 
6
9
  const path = require('path')
@@ -7,19 +7,12 @@ export type Args<T extends typeof Command> = Interfaces.InferredArgs<T['args']>;
7
7
  /**
8
8
  * Custom base command.
9
9
  * https://oclif.io/docs/base_class#docsNav
10
- * Ref: https://github.com/salesforcecli/sf-plugins-core/blob/main/src/sfCommand.ts
10
+ * https://github.com/salesforcecli/sf-plugins-core/blob/main/src/sfCommand.ts
11
11
  */
12
12
  export declare abstract class BaseCommand<T extends typeof Command = any> extends Command {
13
- private _clientConfig?;
14
- private _client?;
15
- protected _startTime: Date;
16
- private _failing;
17
- private readonly _stdin?;
18
- protected flags: Flags<T>;
19
- protected args: Args<T>;
20
- protected _telemetryContext?: TelemetryContext;
21
13
  static enableJsonFlag: boolean;
22
14
  static flags: {
15
+ json: Interfaces.BooleanFlag<boolean>;
23
16
  'dry-run': Interfaces.BooleanFlag<boolean>;
24
17
  verbose: Interfaces.BooleanFlag<boolean>;
25
18
  profile: Interfaces.OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
@@ -27,9 +20,18 @@ export declare abstract class BaseCommand<T extends typeof Command = any> extend
27
20
  'no-agent': Interfaces.BooleanFlag<boolean>;
28
21
  timeout: Interfaces.OptionFlag<number, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
29
22
  };
23
+ private readonly _stdin?;
24
+ private _clientConfig?;
25
+ private _client?;
26
+ private _startTime;
27
+ private _failing;
28
+ protected _telemetryContext?: TelemetryContext;
29
+ protected flags: Flags<T>;
30
+ protected args: Args<T>;
30
31
  constructor(argv: string[], config: OclifConfig);
31
32
  get clientConfig(): Config;
32
33
  get stdin(): string | undefined;
34
+ get duration(): number;
33
35
  done(): void;
34
36
  /**
35
37
  * Load the client config.
@@ -54,6 +56,7 @@ export declare abstract class BaseCommand<T extends typeof Command = any> extend
54
56
  * https://oclif.io/docs/error_handling
55
57
  */
56
58
  error(err: string | Error, options?: any): never;
59
+ catch(err: Error, options?: any): Promise<void>;
57
60
  /**
58
61
  * Called after each command run.
59
62
  */
@@ -1 +1 @@
1
- {"version":3,"file":"base-command.d.ts","sourceRoot":"","sources":["../../src/base-command.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,WAAW,EAAS,UAAU,EAAE,MAAM,aAAa,CAAC;AAUhF,OAAO,EAAE,MAAM,EAAiB,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,MAAM,EAAa,MAAM,EAAuB,MAAM,cAAc,CAAC;AAS9E,OAAO,EAML,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,E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CAUrC"}
@@ -42,12 +42,14 @@ const pkg_up_1 = __importDefault(require("pkg-up"));
42
42
  const agent_1 = require("@dxos/agent");
43
43
  const client_1 = require("@dxos/client");
44
44
  const client_protocol_1 = require("@dxos/client-protocol");
45
+ const services_1 = require("@dxos/client/services");
45
46
  const debug_1 = require("@dxos/debug");
46
47
  const log_1 = require("@dxos/log");
47
48
  const Sentry = __importStar(require("@dxos/sentry"));
48
49
  const sentry_1 = require("@dxos/sentry");
49
50
  const Telemetry = __importStar(require("@dxos/telemetry"));
50
51
  const util_1 = require("./util");
52
+ const DEFAULT_CONFIG = 'config/config-default.yml';
51
53
  // TODO(wittjosiah): Factor out.
52
54
  const exists = async (...args) => {
53
55
  try {
@@ -66,7 +68,7 @@ const exists = async (...args) => {
66
68
  /**
67
69
  * Custom base command.
68
70
  * https://oclif.io/docs/base_class#docsNav
69
- * Ref: https://github.com/salesforcecli/sf-plugins-core/blob/main/src/sfCommand.ts
71
+ * https://github.com/salesforcecli/sf-plugins-core/blob/main/src/sfCommand.ts
70
72
  */
71
73
  class BaseCommand extends core_1.Command {
72
74
  constructor(argv, config) {
@@ -87,8 +89,11 @@ class BaseCommand extends core_1.Command {
87
89
  get stdin() {
88
90
  return this._stdin;
89
91
  }
92
+ get duration() {
93
+ return Date.now() - this._startTime.getTime();
94
+ }
90
95
  done() {
91
- (0, log_1.log)('ok', {}, { file: "packages/devtools/cli/src/base-command.ts", line: 139, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation.", callSite: (fn, args) => fn(...args) });
96
+ (0, log_1.log)('ok', {}, { file: "packages/devtools/cli/src/base-command.ts", line: 159, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation.", callSite: (fn, args) => fn(...args) });
92
97
  }
93
98
  /**
94
99
  * Load the client config.
@@ -108,13 +113,13 @@ class BaseCommand extends core_1.Command {
108
113
  await this._loadConfig();
109
114
  }
110
115
  async _initTelemetry() {
111
- this._telemetryContext = await (0, util_1.getTelemetryContext)(client_1.DX_DATA);
116
+ this._telemetryContext = await (0, util_1.getTelemetryContext)(client_protocol_1.DX_DATA);
112
117
  const { mode, installationId, group, environment, release } = this._telemetryContext;
113
118
  {
114
119
  if (group === 'dxos') {
115
- (0, log_1.log)((0, chalk_1.default) `✨ {bgMagenta Running as internal user} ✨\n`, {}, { file: "packages/devtools/cli/src/base-command.ts", line: 169, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation.", callSite: (fn, args) => fn(...args) });
120
+ (0, log_1.log)((0, chalk_1.default) `✨ {bgMagenta Running as internal user} ✨\n`, {}, { file: "packages/devtools/cli/src/base-command.ts", line: 189, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation.", callSite: (fn, args) => fn(...args) });
116
121
  }
117
- await (0, util_1.showTelemetryBanner)(client_1.DX_DATA);
122
+ await (0, util_1.showTelemetryBanner)(client_protocol_1.DX_DATA);
118
123
  }
119
124
  if (util_1.SENTRY_DESTINATION && mode !== 'disabled') {
120
125
  Sentry.init({
@@ -131,7 +136,7 @@ class BaseCommand extends core_1.Command {
131
136
  });
132
137
  }
133
138
  if (util_1.TELEMETRY_API_KEY) {
134
- mode === 'disabled' && (await (0, util_1.disableTelemetry)(client_1.DX_DATA));
139
+ mode === 'disabled' && (await (0, util_1.disableTelemetry)(client_protocol_1.DX_DATA));
135
140
  Telemetry.init({
136
141
  apiKey: util_1.TELEMETRY_API_KEY,
137
142
  batchSize: 20,
@@ -155,14 +160,14 @@ class BaseCommand extends core_1.Command {
155
160
  const { config: configFile } = this.flags;
156
161
  const configExists = await exists(configFile);
157
162
  if (!configExists) {
158
- const defaultConfigPath = (0, node_path_1.join)((0, node_path_1.dirname)((_a = pkg_up_1.default.sync({ cwd: __dirname })) !== null && _a !== void 0 ? _a : (0, debug_1.raise)(new Error('Could not find package.json'))), 'config/config-default.yml');
163
+ const defaultConfigPath = (0, node_path_1.join)((0, node_path_1.dirname)((_a = pkg_up_1.default.sync({ cwd: __dirname })) !== null && _a !== void 0 ? _a : (0, debug_1.raise)(new Error('Could not find package.json'))), DEFAULT_CONFIG);
159
164
  const yamlConfig = js_yaml_1.default.load(await (0, promises_1.readFile)(defaultConfigPath, 'utf-8'));
160
165
  {
161
166
  // Isolate DX_PROFILE storages.
162
167
  (_b = yamlConfig.runtime) !== null && _b !== void 0 ? _b : (yamlConfig.runtime = {});
163
168
  (_c = (_f = yamlConfig.runtime).client) !== null && _c !== void 0 ? _c : (_f.client = {});
164
169
  (_d = (_g = yamlConfig.runtime.client).storage) !== null && _d !== void 0 ? _d : (_g.storage = {});
165
- yamlConfig.runtime.client.storage.path = (0, node_path_1.join)((_e = yamlConfig.runtime.client.storage.path) !== null && _e !== void 0 ? _e : client_1.DX_DATA, this.flags.profile);
170
+ yamlConfig.runtime.client.storage.path = (0, node_path_1.join)((_e = yamlConfig.runtime.client.storage.path) !== null && _e !== void 0 ? _e : client_protocol_1.DX_DATA, this.flags.profile);
166
171
  }
167
172
  await (0, promises_1.mkdir)((0, node_path_1.dirname)(configFile), { recursive: true });
168
173
  await (0, promises_1.writeFile)(configFile, js_yaml_1.default.dump(yamlConfig), 'utf-8');
@@ -190,8 +195,12 @@ class BaseCommand extends core_1.Command {
190
195
  }
191
196
  error(err, options) {
192
197
  super.error(err, options);
193
- Sentry.captureException(err);
198
+ }
199
+ async catch(err, options) {
200
+ // Will only submit if API key exists (i.e., prod).
201
+ super.error(err, options);
194
202
  this._failing = true;
203
+ throw err;
195
204
  }
196
205
  /**
197
206
  * Called after each command run.
@@ -215,7 +224,7 @@ class BaseCommand extends core_1.Command {
215
224
  const running = await daemon.isRunning(this.flags.profile);
216
225
  if (!running) {
217
226
  this.log(`Starting agent (${this.flags.profile})`);
218
- await daemon.start(this.flags.profile);
227
+ await daemon.start(this.flags.profile, { config: this.flags.config });
219
228
  }
220
229
  });
221
230
  }
@@ -226,16 +235,15 @@ class BaseCommand extends core_1.Command {
226
235
  async getClient() {
227
236
  (0, node_assert_1.default)(this._clientConfig);
228
237
  if (!this._client) {
229
- (0, node_assert_1.default)(this._clientConfig);
230
238
  if (this.flags['no-agent']) {
231
239
  this._client = new client_1.Client({ config: this._clientConfig });
232
240
  }
233
241
  else {
234
242
  await this.maybeStartDaemon();
235
- this._client = new client_1.Client({ config: this._clientConfig, services: (0, client_1.fromAgent)({ profile: this.flags.profile }) });
243
+ this._client = new client_1.Client({ config: this._clientConfig, services: (0, services_1.fromAgent)({ profile: this.flags.profile }) });
236
244
  }
237
245
  await this._client.initialize();
238
- (0, log_1.log)('Client initialized', { profile: this.flags.profile }, { file: "packages/devtools/cli/src/base-command.ts", line: 319, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation.", callSite: (fn, args) => fn(...args) });
246
+ (0, log_1.log)('Client initialized', { profile: this.flags.profile }, { file: "packages/devtools/cli/src/base-command.ts", line: 341, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation.", callSite: (fn, args) => fn(...args) });
239
247
  }
240
248
  return this._client;
241
249
  }
@@ -256,7 +264,7 @@ class BaseCommand extends core_1.Command {
256
264
  * Convenience function to wrap starting the agent.
257
265
  */
258
266
  async execWithDaemon(callback) {
259
- const daemon = new agent_1.ForeverDaemon(`${client_1.DX_RUNTIME}`);
267
+ const daemon = new agent_1.ForeverDaemon(`${client_protocol_1.DX_RUNTIME}`);
260
268
  await daemon.connect();
261
269
  const value = await callback(daemon);
262
270
  await daemon.disconnect();
@@ -334,6 +342,11 @@ class BaseCommand extends core_1.Command {
334
342
  }
335
343
  BaseCommand.enableJsonFlag = true;
336
344
  BaseCommand.flags = {
345
+ // Even though oclif should support this out of the box there seems to be a bug.
346
+ json: core_1.Flags.boolean({
347
+ description: 'Output as JSON.',
348
+ default: false,
349
+ }),
337
350
  'dry-run': core_1.Flags.boolean({
338
351
  description: 'Dry run.',
339
352
  default: false,