@dxos/cli 0.1.53-main.14243d1 → 0.1.53-main.1ba2b9f

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 (113) hide show
  1. package/README.md +96 -79
  2. package/dist/src/base-command.d.ts +3 -1
  3. package/dist/src/base-command.d.ts.map +1 -1
  4. package/dist/src/base-command.js +24 -14
  5. package/dist/src/base-command.js.map +1 -1
  6. package/dist/src/commands/agent/agent.test.d.ts +2 -0
  7. package/dist/src/commands/agent/agent.test.d.ts.map +1 -0
  8. package/dist/src/commands/agent/agent.test.js +186 -0
  9. package/dist/src/commands/agent/agent.test.js.map +1 -0
  10. package/dist/src/commands/agent/list.d.ts.map +1 -1
  11. package/dist/src/commands/agent/list.js +22 -1
  12. package/dist/src/commands/agent/list.js.map +1 -1
  13. package/dist/src/commands/agent/restart.d.ts +10 -0
  14. package/dist/src/commands/agent/restart.d.ts.map +1 -1
  15. package/dist/src/commands/agent/restart.js +9 -2
  16. package/dist/src/commands/agent/restart.js.map +1 -1
  17. package/dist/src/commands/agent/start.d.ts +1 -0
  18. package/dist/src/commands/agent/start.d.ts.map +1 -1
  19. package/dist/src/commands/agent/start.js +22 -27
  20. package/dist/src/commands/agent/start.js.map +1 -1
  21. package/dist/src/commands/agent/stop.d.ts +2 -0
  22. package/dist/src/commands/agent/stop.d.ts.map +1 -1
  23. package/dist/src/commands/agent/stop.js +17 -7
  24. package/dist/src/commands/agent/stop.js.map +1 -1
  25. package/dist/src/commands/app/create.d.ts +1 -0
  26. package/dist/src/commands/app/create.d.ts.map +1 -1
  27. package/dist/src/commands/app/open.d.ts +1 -0
  28. package/dist/src/commands/app/open.d.ts.map +1 -1
  29. package/dist/src/commands/app/open.js +4 -4
  30. package/dist/src/commands/app/open.js.map +1 -1
  31. package/dist/src/commands/app/publish.d.ts +1 -0
  32. package/dist/src/commands/app/publish.d.ts.map +1 -1
  33. package/dist/src/commands/config/index.d.ts.map +1 -1
  34. package/dist/src/commands/config/index.js +3 -1
  35. package/dist/src/commands/config/index.js.map +1 -1
  36. package/dist/src/commands/debug/stats.d.ts +1 -0
  37. package/dist/src/commands/debug/stats.d.ts.map +1 -1
  38. package/dist/src/commands/debug/stats.js +21 -16
  39. package/dist/src/commands/debug/stats.js.map +1 -1
  40. package/dist/src/commands/function/dev-server.d.ts +2 -1
  41. package/dist/src/commands/function/dev-server.d.ts.map +1 -1
  42. package/dist/src/commands/function/dev-server.js +1 -1
  43. package/dist/src/commands/function/dev-server.js.map +1 -1
  44. package/dist/src/commands/halo/credential/list.d.ts +1 -0
  45. package/dist/src/commands/halo/credential/list.d.ts.map +1 -1
  46. package/dist/src/commands/halo/join.d.ts +1 -0
  47. package/dist/src/commands/halo/join.d.ts.map +1 -1
  48. package/dist/src/commands/halo/join.js +2 -2
  49. package/dist/src/commands/halo/join.js.map +1 -1
  50. package/dist/src/commands/halo/share.d.ts +1 -0
  51. package/dist/src/commands/halo/share.d.ts.map +1 -1
  52. package/dist/src/commands/halo/share.js +4 -4
  53. package/dist/src/commands/halo/share.js.map +1 -1
  54. package/dist/src/commands/kube/deploy.d.ts +1 -0
  55. package/dist/src/commands/kube/deploy.d.ts.map +1 -1
  56. package/dist/src/commands/reset/index.d.ts +1 -0
  57. package/dist/src/commands/reset/index.d.ts.map +1 -1
  58. package/dist/src/commands/reset/index.js +1 -1
  59. package/dist/src/commands/reset/index.js.map +1 -1
  60. package/dist/src/commands/space/create.d.ts.map +1 -1
  61. package/dist/src/commands/space/create.js +1 -29
  62. package/dist/src/commands/space/create.js.map +1 -1
  63. package/dist/src/commands/space/epoch.d.ts +1 -0
  64. package/dist/src/commands/space/epoch.d.ts.map +1 -1
  65. package/dist/src/commands/space/invite.d.ts.map +1 -1
  66. package/dist/src/commands/space/invite.js +2 -2
  67. package/dist/src/commands/space/invite.js.map +1 -1
  68. package/dist/src/commands/space/join.d.ts +1 -0
  69. package/dist/src/commands/space/join.d.ts.map +1 -1
  70. package/dist/src/commands/space/join.js +2 -2
  71. package/dist/src/commands/space/join.js.map +1 -1
  72. package/dist/src/commands/space/list.d.ts +1 -0
  73. package/dist/src/commands/space/list.d.ts.map +1 -1
  74. package/dist/src/commands/space/members.d.ts +1 -0
  75. package/dist/src/commands/space/members.d.ts.map +1 -1
  76. package/dist/src/commands/tunnel/set.d.ts +1 -0
  77. package/dist/src/commands/tunnel/set.d.ts.map +1 -1
  78. package/dist/src/help.d.ts +6 -0
  79. package/dist/src/help.d.ts.map +1 -0
  80. package/dist/src/help.js +31 -0
  81. package/dist/src/help.js.map +1 -0
  82. package/dist/src/hooks/command-not-found.d.ts +4 -0
  83. package/dist/src/hooks/command-not-found.d.ts.map +1 -0
  84. package/dist/src/hooks/command-not-found.js +14 -0
  85. package/dist/src/hooks/command-not-found.js.map +1 -0
  86. package/dist/src/util/invitation.d.ts +1 -1
  87. package/dist/src/util/invitation.d.ts.map +1 -1
  88. package/dist/src/util/invitation.js +7 -7
  89. package/dist/src/util/invitation.js.map +1 -1
  90. package/dist/src/util/print.d.ts +3 -4
  91. package/dist/src/util/print.d.ts.map +1 -1
  92. package/dist/src/util/print.js +2 -2
  93. package/dist/src/util/print.js.map +1 -1
  94. package/dist/src/util/publish/publisher-rpc-peer.d.ts.map +1 -1
  95. package/dist/src/util/publish/publisher-rpc-peer.js +4 -5
  96. package/dist/src/util/publish/publisher-rpc-peer.js.map +1 -1
  97. package/dist/src/util/supervisor/supervisor-rpc-peer.d.ts.map +1 -1
  98. package/dist/src/util/supervisor/supervisor-rpc-peer.js +4 -5
  99. package/dist/src/util/supervisor/supervisor-rpc-peer.js.map +1 -1
  100. package/dist/src/util/telemetry.d.ts.map +1 -1
  101. package/dist/src/util/telemetry.js.map +1 -1
  102. package/dist/src/util/telemetryrc.json +1 -1
  103. package/dist/src/util/test-util.d.ts +1 -0
  104. package/dist/src/util/test-util.d.ts.map +1 -1
  105. package/dist/src/util/test-util.js +14 -5
  106. package/dist/src/util/test-util.js.map +1 -1
  107. package/dist/src/util/tunnel/tunnel-rpc-peer.d.ts.map +1 -1
  108. package/dist/src/util/tunnel/tunnel-rpc-peer.js +4 -5
  109. package/dist/src/util/tunnel/tunnel-rpc-peer.js.map +1 -1
  110. package/dist/src/util/util.d.ts +1 -1
  111. package/dist/src/util/util.d.ts.map +1 -1
  112. package/oclif.manifest.json +36 -42
  113. package/package.json +31 -31
package/README.md CHANGED
@@ -2,21 +2,74 @@
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
+ * [Instalation](#instalation)
8
+ * [Running an Agent](#running-an-agent)
9
+ * [Development](#development)
10
+ * [Usage](#usage)
11
+ <!-- tocstop -->
12
+
13
+ # Instalation
14
+ ```terminal
15
+ npm install -g @dxos/cli@main
16
+ ```
17
+ ---
18
+ # Running an Agent
19
+ Agent is a name for DXOS Client which is run by CLI in the background in the daemonized process.
20
+ ## Starting agent
21
+ Agent is automatically started by each command that requires Client (to avoid this behavior use `--no-agent` flag). You can use `--profile` flag (default value is `default`) to run agent in an isolated profile, and `--foreground` to run agent in attached process.
22
+ ```terminal
23
+ dx agent start
24
+ ```
25
+ see: [dx agent start](#dx-agent-start)
26
+
27
+ ## Adding Agent to your Composer Identity
28
+ 1. Go to [Composer](https://composer.dev.dxos.org). And create a device invitation.
29
+ ![Composer add device](./public/composer-sidebar.png)
30
+ ![Composer invitation](./public/composer-add-device.png)
31
+
32
+ 1. Run halo join command in your terminal.
33
+ ![CLI halo join flow](./public/cli-halo-join.png)
34
+
35
+ 1. Proceed with invitation
36
+
37
+ ## Troubleshooting
38
+ 1. Make sure you are running the latest version of the shared worker in the browser. Go to the shared workers tab chrome://inspect/#workers, kill `dxos-vault` worker, then reload the Composer tab.
39
+ 2. Restart your agent with [```dx agent restart```](#dx-agent-restart). Also useful command[ ```dx agent stop --all```](#dx-agent-stop)
40
+ #### Danger Zone
41
+ 3. Reset Storage. Warning: Agent will lose its storage, and config file will be deleted [```dx reset --force```](#dx-reset)
42
+ ---
43
+
6
44
 
7
45
  # Development
8
46
 
9
- Run the build script from the root directory.
47
+ To build the CLI:
48
+
49
+ ```bash
50
+ nx run cli:build --watch=true
51
+ ```
52
+
53
+ Run the CLI from the local directory:
10
54
 
11
55
  ```bash
12
- $ nx run cli:build --watch=true
56
+ ./bin/run config --json
57
+ ```
58
+
59
+ Or source the following script to set the `dx` alias from any directory in the repo.
60
+
61
+ ```bash
62
+ . $(git rev-parse --show-toplevel)/packages/devtools/cli/scripts/dev.sh
63
+
64
+ dx config --json
13
65
  ```
14
66
 
15
- Run the CLI in the local directory.
67
+ ## Reporting errors
68
+
69
+ Run the following command to create a gist of the debug stats.
16
70
 
17
71
  ```bash
18
- $ export DX_CONFIG=./config/config.yml
19
- $ ./bin/run config --json
72
+ dx debug stats --json --no-agent | gh gist create
20
73
  ```
21
74
 
22
75
  # Usage
@@ -27,7 +80,7 @@ $ npm install -g @dxos/cli
27
80
  $ dx COMMAND
28
81
  running command...
29
82
  $ dx (--version)
30
- @dxos/cli/0.1.53-main.14243d1 linux-x64 node-v18.16.1
83
+ @dxos/cli/0.1.53-main.1ba2b9f linux-x64 node-v18.17.0
31
84
  $ dx --help [COMMAND]
32
85
  USAGE
33
86
  $ dx COMMAND
@@ -35,7 +88,7 @@ USAGE
35
88
  ```
36
89
  <!-- usagestop -->
37
90
 
38
- # Commands
91
+ ## Commands
39
92
 
40
93
  <!-- commands -->
41
94
  * [`dx agent list`](#dx-agent-list)
@@ -114,19 +167,19 @@ Restart agent daemon.
114
167
 
115
168
  ```
116
169
  USAGE
117
- $ dx agent restart [--json] [--dry-run] [-v] [--config <value> --profile <value>] [--no-agent] [--timeout <value>]
170
+ $ dx agent restart [--json] [--dry-run] [-v] [--config <value> --profile <value>] [--no-agent] [--timeout
171
+ <value>] [--force]
118
172
 
119
173
  FLAGS
120
174
  -v, --verbose Verbose output
121
175
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
122
176
  --dry-run Dry run.
177
+ --force Force restart.
178
+ --json Output as JSON.
123
179
  --no-agent Auto-start agent.
124
180
  --profile=<value> [default: default] User profile.
125
181
  --timeout=<value> [default: 30] Timeout in seconds.
126
182
 
127
- GLOBAL FLAGS
128
- --json Format output as json.
129
-
130
183
  DESCRIPTION
131
184
  Restart agent daemon.
132
185
  ```
@@ -146,15 +199,13 @@ FLAGS
146
199
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
147
200
  --dry-run Dry run.
148
201
  --echo=port Expose ECHO REST API.
202
+ --json Output as JSON.
149
203
  --monitor Run epoch monitoring.
150
204
  --no-agent Auto-start agent.
151
205
  --profile=<value> [default: default] User profile.
152
206
  --timeout=<value> [default: 30] Timeout in seconds.
153
207
  --web-socket=port Expose web socket port.
154
208
 
155
- GLOBAL FLAGS
156
- --json Format output as json.
157
-
158
209
  DESCRIPTION
159
210
  Starts the agent.
160
211
  ```
@@ -166,20 +217,19 @@ Stop agent daemon.
166
217
  ```
167
218
  USAGE
168
219
  $ dx agent stop [--json] [--dry-run] [-v] [--config <value> --profile <value>] [--no-agent] [--timeout
169
- <value>] [-a]
220
+ <value>] [--all] [--force]
170
221
 
171
222
  FLAGS
172
- -a, --all Stop all agents.
173
223
  -v, --verbose Verbose output
224
+ --all Stop all agents.
174
225
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
175
226
  --dry-run Dry run.
227
+ --force Force stop.
228
+ --json Output as JSON.
176
229
  --no-agent Auto-start agent.
177
230
  --profile=<value> [default: default] User profile.
178
231
  --timeout=<value> [default: 30] Timeout in seconds.
179
232
 
180
- GLOBAL FLAGS
181
- --json Format output as json.
182
-
183
233
  DESCRIPTION
184
234
  Stop agent daemon.
185
235
  ```
@@ -203,14 +253,12 @@ FLAGS
203
253
  -v, --verbose Verbose output
204
254
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
205
255
  --dry-run Dry run.
256
+ --json Output as JSON.
206
257
  --no-agent Auto-start agent.
207
258
  --profile=<value> [default: default] User profile.
208
259
  --tag=<value> Git tag or branch of the DXOS repo to checkout.
209
260
  --timeout=<value> [default: 30] Timeout in seconds.
210
261
 
211
- GLOBAL FLAGS
212
- --json Format output as json.
213
-
214
262
  DESCRIPTION
215
263
  Manage applications.
216
264
  ```
@@ -282,15 +330,13 @@ FLAGS
282
330
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
283
331
  --configPath=<value> Path to dx.yml
284
332
  --dry-run Dry run.
333
+ --json Output as JSON.
285
334
  --no-agent Auto-start agent.
286
335
  --profile=<value> [default: default] User profile.
287
336
  --skipExisting Do not update content on KUBE if version already exists.
288
337
  --timeout=<value> [default: 30] Timeout in seconds.
289
338
  --version=<value> Version of modules to publish.
290
339
 
291
- GLOBAL FLAGS
292
- --json Format output as json.
293
-
294
340
  DESCRIPTION
295
341
  Publish apps.
296
342
  ```
@@ -331,15 +377,13 @@ FLAGS
331
377
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
332
378
  --dry-run Dry run.
333
379
  --humanize Humanized keys.
380
+ --json Output as JSON.
334
381
  --no-agent Auto-start agent.
335
382
  --profile=<value> [default: default] User profile.
336
383
  --timeout=<value> [default: 30] Timeout in seconds.
337
384
  --truncate Truncate keys.
338
385
  --verbose Verbose output.
339
386
 
340
- GLOBAL FLAGS
341
- --json Format output as json.
342
-
343
387
  DESCRIPTION
344
388
  Output debug stats.
345
389
  ```
@@ -403,15 +447,13 @@ FLAGS
403
447
  -v, --verbose Verbose output
404
448
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
405
449
  --dry-run Dry run.
450
+ --json Output as JSON.
406
451
  --manifest=<value> [default: functions.yml]
407
452
  --no-agent Auto-start agent.
408
453
  --profile=<value> [default: default] User profile.
409
- --require=<value>...
454
+ --require=<value>... [default: ts-node/register]
410
455
  --timeout=<value> [default: 30] Timeout in seconds.
411
456
 
412
- GLOBAL FLAGS
413
- --json Format output as json.
414
-
415
457
  DESCRIPTION
416
458
  Development server.
417
459
 
@@ -437,15 +479,13 @@ FLAGS
437
479
  -v, --verbose Verbose output
438
480
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
439
481
  --dry-run Dry run.
482
+ --json Output as JSON.
440
483
  --manifest=<value> [default: functions.yml]
441
484
  --no-agent Auto-start agent.
442
485
  --profile=<value> [default: default] User profile.
443
- --require=<value>...
486
+ --require=<value>... [default: ts-node/register]
444
487
  --timeout=<value> [default: 30] Timeout in seconds.
445
488
 
446
- GLOBAL FLAGS
447
- --json Format output as json.
448
-
449
489
  DESCRIPTION
450
490
  Development server.
451
491
 
@@ -601,13 +641,11 @@ FLAGS
601
641
  -v, --verbose Verbose output
602
642
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
603
643
  --dry-run Dry run.
644
+ --json Output as JSON.
604
645
  --no-agent Auto-start agent.
605
646
  --profile=<value> [default: default] User profile.
606
647
  --timeout=<value> [default: 30] Timeout in seconds.
607
648
 
608
- GLOBAL FLAGS
609
- --json Format output as json.
610
-
611
649
  DESCRIPTION
612
650
  Import credential into HALO.
613
651
  ```
@@ -625,14 +663,12 @@ FLAGS
625
663
  -v, --verbose Verbose output
626
664
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
627
665
  --dry-run Dry run.
666
+ --json Output as JSON.
628
667
  --no-agent Auto-start agent.
629
668
  --profile=<value> [default: default] User profile.
630
669
  --timeout=<value> [default: 30] Timeout in seconds.
631
670
  --type=<value> Type
632
671
 
633
- GLOBAL FLAGS
634
- --json Format output as json.
635
-
636
672
  DESCRIPTION
637
673
  List HALO credentials.
638
674
  ```
@@ -651,13 +687,11 @@ FLAGS
651
687
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
652
688
  --dry-run Dry run.
653
689
  --invitation=<value> Invitation code
690
+ --json Output as JSON.
654
691
  --no-agent Auto-start agent.
655
692
  --profile=<value> [default: default] User profile.
656
693
  --timeout=<value> [default: 30] Timeout in seconds.
657
694
 
658
- GLOBAL FLAGS
659
- --json Format output as json.
660
-
661
695
  DESCRIPTION
662
696
  Join HALO (device) invitation.
663
697
  ```
@@ -705,7 +739,7 @@ DESCRIPTION
705
739
  Display help for dx.
706
740
  ```
707
741
 
708
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.8/src/commands/help.ts)_
742
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.14/src/commands/help.ts)_
709
743
 
710
744
  ## `dx kube auth`
711
745
 
@@ -746,14 +780,12 @@ FLAGS
746
780
  --dev Deploy latest version from dev channel
747
781
  --dry-run Dry run.
748
782
  --hostname=<value> (required) Hostname
783
+ --json Output as JSON.
749
784
  --no-agent Auto-start agent.
750
785
  --profile=<value> [default: default] User profile.
751
786
  --provider=<value> [default: digitalocean] Cloud Provider
752
787
  --timeout=<value> [default: 30] Timeout in seconds.
753
788
 
754
- GLOBAL FLAGS
755
- --json Format output as json.
756
-
757
789
  DESCRIPTION
758
790
  Deploy KUBE.
759
791
  ```
@@ -764,11 +796,14 @@ List installed plugins.
764
796
 
765
797
  ```
766
798
  USAGE
767
- $ dx plugins [--core]
799
+ $ dx plugins [--json] [--core]
768
800
 
769
801
  FLAGS
770
802
  --core Show core plugins.
771
803
 
804
+ GLOBAL FLAGS
805
+ --json Format output as json.
806
+
772
807
  DESCRIPTION
773
808
  List installed plugins.
774
809
 
@@ -776,7 +811,7 @@ EXAMPLES
776
811
  $ dx plugins
777
812
  ```
778
813
 
779
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.4.3/src/commands/plugins/index.ts)_
814
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.1.8/src/commands/plugins/index.ts)_
780
815
 
781
816
  ## `dx plugins:install PLUGIN...`
782
817
 
@@ -1005,13 +1040,11 @@ FLAGS
1005
1040
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
1006
1041
  --dry-run Dry run.
1007
1042
  --force Force delete.
1043
+ --json Output as JSON.
1008
1044
  --no-agent Auto-start agent.
1009
1045
  --profile=<value> [default: default] User profile.
1010
1046
  --timeout=<value> [default: 30] Timeout in seconds.
1011
1047
 
1012
- GLOBAL FLAGS
1013
- --json Format output as json.
1014
-
1015
1048
  DESCRIPTION
1016
1049
  Reset user data.
1017
1050
  ```
@@ -1028,13 +1061,11 @@ FLAGS
1028
1061
  -v, --verbose Verbose output
1029
1062
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
1030
1063
  --dry-run Dry run.
1064
+ --json Output as JSON.
1031
1065
  --no-agent Auto-start agent.
1032
1066
  --profile=<value> [default: default] User profile.
1033
1067
  --timeout=<value> [default: 30] Timeout in seconds.
1034
1068
 
1035
- GLOBAL FLAGS
1036
- --json Format output as json.
1037
-
1038
1069
  DESCRIPTION
1039
1070
  Interactive shell.
1040
1071
  ```
@@ -1051,13 +1082,11 @@ FLAGS
1051
1082
  -v, --verbose Verbose output
1052
1083
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
1053
1084
  --dry-run Dry run.
1085
+ --json Output as JSON.
1054
1086
  --no-agent Auto-start agent.
1055
1087
  --profile=<value> [default: default] User profile.
1056
1088
  --timeout=<value> [default: 30] Timeout in seconds.
1057
1089
 
1058
- GLOBAL FLAGS
1059
- --json Format output as json.
1060
-
1061
1090
  DESCRIPTION
1062
1091
  List spaces.
1063
1092
  ```
@@ -1107,6 +1136,7 @@ FLAGS
1107
1136
  --csv output is csv format [alias: --output=csv]
1108
1137
  --dry-run Dry run.
1109
1138
  --filter=<value> filter property by partial string matching, ex: name=foo
1139
+ --json Output as JSON.
1110
1140
  --no-agent Auto-start agent.
1111
1141
  --no-header hide table header from output
1112
1142
  --no-truncate do not truncate output to fit screen
@@ -1116,9 +1146,6 @@ FLAGS
1116
1146
  --sort=<value> property to sort by (prepend '-' for descending)
1117
1147
  --timeout=<value> [default: 30] Timeout in seconds.
1118
1148
 
1119
- GLOBAL FLAGS
1120
- --json Format output as json.
1121
-
1122
1149
  DESCRIPTION
1123
1150
  Create new epoch.
1124
1151
  ```
@@ -1136,13 +1163,11 @@ FLAGS
1136
1163
  -v, --verbose Verbose output
1137
1164
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
1138
1165
  --dry-run Dry run.
1166
+ --json Output as JSON.
1139
1167
  --no-agent Auto-start agent.
1140
1168
  --profile=<value> [default: default] User profile.
1141
1169
  --timeout=<value> [default: 30] Timeout in seconds.
1142
1170
 
1143
- GLOBAL FLAGS
1144
- --json Format output as json.
1145
-
1146
1171
  DESCRIPTION
1147
1172
  Create space invitation.
1148
1173
  ```
@@ -1161,14 +1186,12 @@ FLAGS
1161
1186
  --config=path [default: /home/runner/.config/dx/profile/default.yml] Config file.
1162
1187
  --dry-run Dry run.
1163
1188
  --invitation=<value> Invitation code
1189
+ --json Output as JSON.
1164
1190
  --no-agent Auto-start agent.
1165
1191
  --profile=<value> [default: default] User profile.
1166
1192
  --secret=<value> Invitation secret
1167
1193
  --timeout=<value> [default: 30] Timeout in seconds.
1168
1194
 
1169
- GLOBAL FLAGS
1170
- --json Format output as json.
1171
-
1172
1195
  DESCRIPTION
1173
1196
  Join space invitation
1174
1197
  ```
@@ -1191,6 +1214,7 @@ FLAGS
1191
1214
  --csv output is csv format [alias: --output=csv]
1192
1215
  --dry-run Dry run.
1193
1216
  --filter=<value> filter property by partial string matching, ex: name=foo
1217
+ --json Output as JSON.
1194
1218
  --no-agent Auto-start agent.
1195
1219
  --no-header hide table header from output
1196
1220
  --no-truncate do not truncate output to fit screen
@@ -1200,9 +1224,6 @@ FLAGS
1200
1224
  --sort=<value> property to sort by (prepend '-' for descending)
1201
1225
  --timeout=<value> [default: 30] Timeout in seconds.
1202
1226
 
1203
- GLOBAL FLAGS
1204
- --json Format output as json.
1205
-
1206
1227
  DESCRIPTION
1207
1228
  List spaces.
1208
1229
  ```
@@ -1228,6 +1249,7 @@ FLAGS
1228
1249
  --csv output is csv format [alias: --output=csv]
1229
1250
  --dry-run Dry run.
1230
1251
  --filter=<value> filter property by partial string matching, ex: name=foo
1252
+ --json Output as JSON.
1231
1253
  --no-agent Auto-start agent.
1232
1254
  --no-header hide table header from output
1233
1255
  --no-truncate do not truncate output to fit screen
@@ -1237,9 +1259,6 @@ FLAGS
1237
1259
  --sort=<value> property to sort by (prepend '-' for descending)
1238
1260
  --timeout=<value> [default: 30] Timeout in seconds.
1239
1261
 
1240
- GLOBAL FLAGS
1241
- --json Format output as json.
1242
-
1243
1262
  DESCRIPTION
1244
1263
  List space members.
1245
1264
  ```
@@ -1283,13 +1302,11 @@ FLAGS
1283
1302
  --disabled Disable tunnel.
1284
1303
  --dry-run Dry run.
1285
1304
  --enabled Enable tunnel.
1305
+ --json Output as JSON.
1286
1306
  --no-agent Auto-start agent.
1287
1307
  --profile=<value> [default: default] User profile.
1288
1308
  --timeout=<value> [default: 30] Timeout in seconds.
1289
1309
 
1290
- GLOBAL FLAGS
1291
- --json Format output as json.
1292
-
1293
1310
  DESCRIPTION
1294
1311
  Enable or disable tunnel.
1295
1312
  ```
@@ -7,11 +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
13
  static enableJsonFlag: boolean;
14
14
  static flags: {
15
+ json: Interfaces.BooleanFlag<boolean>;
15
16
  'dry-run': Interfaces.BooleanFlag<boolean>;
16
17
  verbose: Interfaces.BooleanFlag<boolean>;
17
18
  profile: Interfaces.OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
@@ -55,6 +56,7 @@ export declare abstract class BaseCommand<T extends typeof Command = any> extend
55
56
  * https://oclif.io/docs/error_handling
56
57
  */
57
58
  error(err: string | Error, options?: any): never;
59
+ catch(err: Error, options?: any): Promise<void>;
58
60
  /**
59
61
  * Called after each command run.
60
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,EAOL,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACd,MAAM,QAAQ,CAAC;AAgBhB,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,OAAO,OAAO,IAAI,UAAU,CAAC,aAAa,CAAC,CAAC,OAAO,WAAW,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AACvH,MAAM,MAAM,IAAI,CAAC,CAAC,SAAS,OAAO,OAAO,IAAI,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAEhF;;;;GAIG;AACH,8BAAsB,WAAW,CAAC,CAAC,SAAS,OAAO,OAAO,GAAG,GAAG,CAAE,SAAQ,OAAO;IAC/E,OAAuB,cAAc,UAAQ;IAE7C,OAAgB,KAAK;;;;;;;MAyCnB;IAEF,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAS;IACjC,OAAO,CAAC,aAAa,CAAC,CAAS;IAC/B,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,OAAO,CAAC,UAAU,CAAO;IACzB,OAAO,CAAC,QAAQ,CAAS;IAEzB,SAAS,CAAC,iBAAiB,CAAC,EAAE,gBAAgB,CAAC;IAE/C,SAAS,CAAC,KAAK,EAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC3B,SAAS,CAAC,IAAI,EAAG,I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AAC,GAAG,SAAS,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAkBzG,iBAAiB,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAkBtG,kBAAkB,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAkBjH,qBAAqB,CAAC,MAAM,EAAE,MAAM;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) {
@@ -91,7 +93,7 @@ class BaseCommand extends core_1.Command {
91
93
  return Date.now() - this._startTime.getTime();
92
94
  }
93
95
  done() {
94
- (0, log_1.log)('ok', {}, { file: "packages/devtools/cli/src/base-command.ts", line: 143, 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) });
95
97
  }
96
98
  /**
97
99
  * Load the client config.
@@ -111,13 +113,13 @@ class BaseCommand extends core_1.Command {
111
113
  await this._loadConfig();
112
114
  }
113
115
  async _initTelemetry() {
114
- this._telemetryContext = await (0, util_1.getTelemetryContext)(client_1.DX_DATA);
116
+ this._telemetryContext = await (0, util_1.getTelemetryContext)(client_protocol_1.DX_DATA);
115
117
  const { mode, installationId, group, environment, release } = this._telemetryContext;
116
118
  {
117
119
  if (group === 'dxos') {
118
- (0, log_1.log)((0, chalk_1.default) `✨ {bgMagenta Running as internal user} ✨\n`, {}, { file: "packages/devtools/cli/src/base-command.ts", line: 173, 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) });
119
121
  }
120
- await (0, util_1.showTelemetryBanner)(client_1.DX_DATA);
122
+ await (0, util_1.showTelemetryBanner)(client_protocol_1.DX_DATA);
121
123
  }
122
124
  if (util_1.SENTRY_DESTINATION && mode !== 'disabled') {
123
125
  Sentry.init({
@@ -134,7 +136,7 @@ class BaseCommand extends core_1.Command {
134
136
  });
135
137
  }
136
138
  if (util_1.TELEMETRY_API_KEY) {
137
- mode === 'disabled' && (await (0, util_1.disableTelemetry)(client_1.DX_DATA));
139
+ mode === 'disabled' && (await (0, util_1.disableTelemetry)(client_protocol_1.DX_DATA));
138
140
  Telemetry.init({
139
141
  apiKey: util_1.TELEMETRY_API_KEY,
140
142
  batchSize: 20,
@@ -158,14 +160,14 @@ class BaseCommand extends core_1.Command {
158
160
  const { config: configFile } = this.flags;
159
161
  const configExists = await exists(configFile);
160
162
  if (!configExists) {
161
- 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);
162
164
  const yamlConfig = js_yaml_1.default.load(await (0, promises_1.readFile)(defaultConfigPath, 'utf-8'));
163
165
  {
164
166
  // Isolate DX_PROFILE storages.
165
167
  (_b = yamlConfig.runtime) !== null && _b !== void 0 ? _b : (yamlConfig.runtime = {});
166
168
  (_c = (_f = yamlConfig.runtime).client) !== null && _c !== void 0 ? _c : (_f.client = {});
167
169
  (_d = (_g = yamlConfig.runtime.client).storage) !== null && _d !== void 0 ? _d : (_g.storage = {});
168
- 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);
169
171
  }
170
172
  await (0, promises_1.mkdir)((0, node_path_1.dirname)(configFile), { recursive: true });
171
173
  await (0, promises_1.writeFile)(configFile, js_yaml_1.default.dump(yamlConfig), 'utf-8');
@@ -193,8 +195,12 @@ class BaseCommand extends core_1.Command {
193
195
  }
194
196
  error(err, options) {
195
197
  super.error(err, options);
196
- 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);
197
202
  this._failing = true;
203
+ throw err;
198
204
  }
199
205
  /**
200
206
  * Called after each command run.
@@ -218,7 +224,7 @@ class BaseCommand extends core_1.Command {
218
224
  const running = await daemon.isRunning(this.flags.profile);
219
225
  if (!running) {
220
226
  this.log(`Starting agent (${this.flags.profile})`);
221
- await daemon.start(this.flags.profile);
227
+ await daemon.start(this.flags.profile, { config: this.flags.config });
222
228
  }
223
229
  });
224
230
  }
@@ -229,16 +235,15 @@ class BaseCommand extends core_1.Command {
229
235
  async getClient() {
230
236
  (0, node_assert_1.default)(this._clientConfig);
231
237
  if (!this._client) {
232
- (0, node_assert_1.default)(this._clientConfig);
233
238
  if (this.flags['no-agent']) {
234
239
  this._client = new client_1.Client({ config: this._clientConfig });
235
240
  }
236
241
  else {
237
242
  await this.maybeStartDaemon();
238
- 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 }) });
239
244
  }
240
245
  await this._client.initialize();
241
- (0, log_1.log)('Client initialized', { profile: this.flags.profile }, { file: "packages/devtools/cli/src/base-command.ts", line: 323, 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) });
242
247
  }
243
248
  return this._client;
244
249
  }
@@ -259,7 +264,7 @@ class BaseCommand extends core_1.Command {
259
264
  * Convenience function to wrap starting the agent.
260
265
  */
261
266
  async execWithDaemon(callback) {
262
- const daemon = new agent_1.ForeverDaemon(`${client_1.DX_RUNTIME}`);
267
+ const daemon = new agent_1.ForeverDaemon(client_protocol_1.DX_RUNTIME);
263
268
  await daemon.connect();
264
269
  const value = await callback(daemon);
265
270
  await daemon.disconnect();
@@ -337,6 +342,11 @@ class BaseCommand extends core_1.Command {
337
342
  }
338
343
  BaseCommand.enableJsonFlag = true;
339
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
+ }),
340
350
  'dry-run': core_1.Flags.boolean({
341
351
  description: 'Dry run.',
342
352
  default: false,