hereya-cli 0.77.5 → 0.79.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +99 -55
- package/dist/backend/cloud/cloud-backend.d.ts +2 -1
- package/dist/backend/cloud/cloud-backend.js +15 -0
- package/dist/backend/common.d.ts +10 -3
- package/dist/commands/clone/index.d.ts +12 -0
- package/dist/commands/clone/index.js +105 -0
- package/dist/commands/list/index.d.ts +6 -0
- package/dist/commands/list/index.js +29 -0
- package/oclif.manifest.json +123 -59
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ $ npm install -g hereya-cli
|
|
|
21
21
|
$ hereya COMMAND
|
|
22
22
|
running command...
|
|
23
23
|
$ hereya (--version)
|
|
24
|
-
hereya-cli/0.
|
|
24
|
+
hereya-cli/0.79.0 linux-x64 node-v24.14.0
|
|
25
25
|
$ hereya --help [COMMAND]
|
|
26
26
|
USAGE
|
|
27
27
|
$ hereya COMMAND
|
|
@@ -32,6 +32,7 @@ USAGE
|
|
|
32
32
|
<!-- commands -->
|
|
33
33
|
* [`hereya add PACKAGE`](#hereya-add-package)
|
|
34
34
|
* [`hereya bootstrap INFRASTRUCTURETYPE`](#hereya-bootstrap-infrastructuretype)
|
|
35
|
+
* [`hereya clone PROJECT`](#hereya-clone-project)
|
|
35
36
|
* [`hereya config export-backend [FILE]`](#hereya-config-export-backend-file)
|
|
36
37
|
* [`hereya config get-backend`](#hereya-config-get-backend)
|
|
37
38
|
* [`hereya config import-backend FILE`](#hereya-config-import-backend-file)
|
|
@@ -61,6 +62,7 @@ USAGE
|
|
|
61
62
|
* [`hereya help [COMMAND]`](#hereya-help-command)
|
|
62
63
|
* [`hereya import PACKAGE`](#hereya-import-package)
|
|
63
64
|
* [`hereya init PROJECT`](#hereya-init-project)
|
|
65
|
+
* [`hereya list`](#hereya-list)
|
|
64
66
|
* [`hereya login [URL]`](#hereya-login-url)
|
|
65
67
|
* [`hereya logout`](#hereya-logout)
|
|
66
68
|
* [`hereya provid PACKAGE`](#hereya-provid-package)
|
|
@@ -118,7 +120,7 @@ EXAMPLES
|
|
|
118
120
|
$ hereya add cloudy/docker_postgres
|
|
119
121
|
```
|
|
120
122
|
|
|
121
|
-
_See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
123
|
+
_See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/add/index.ts)_
|
|
122
124
|
|
|
123
125
|
## `hereya bootstrap INFRASTRUCTURETYPE`
|
|
124
126
|
|
|
@@ -143,7 +145,32 @@ EXAMPLES
|
|
|
143
145
|
$ hereya bootstrap local
|
|
144
146
|
```
|
|
145
147
|
|
|
146
|
-
_See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
148
|
+
_See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/bootstrap/index.ts)_
|
|
149
|
+
|
|
150
|
+
## `hereya clone PROJECT`
|
|
151
|
+
|
|
152
|
+
Clone an existing template-based project to the local machine.
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
USAGE
|
|
156
|
+
$ hereya clone PROJECT [--chdir <value>]
|
|
157
|
+
|
|
158
|
+
ARGUMENTS
|
|
159
|
+
PROJECT project name
|
|
160
|
+
|
|
161
|
+
FLAGS
|
|
162
|
+
--chdir=<value> directory to clone into
|
|
163
|
+
|
|
164
|
+
DESCRIPTION
|
|
165
|
+
Clone an existing template-based project to the local machine.
|
|
166
|
+
|
|
167
|
+
EXAMPLES
|
|
168
|
+
$ hereya clone myProject
|
|
169
|
+
|
|
170
|
+
$ hereya clone myProject --chdir=./myProject
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
_See code: [src/commands/clone/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/clone/index.ts)_
|
|
147
174
|
|
|
148
175
|
## `hereya config export-backend [FILE]`
|
|
149
176
|
|
|
@@ -165,7 +192,7 @@ EXAMPLES
|
|
|
165
192
|
$ hereya config export-backend ./path/to/export.json
|
|
166
193
|
```
|
|
167
194
|
|
|
168
|
-
_See code: [src/commands/config/export-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
195
|
+
_See code: [src/commands/config/export-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/config/export-backend/index.ts)_
|
|
169
196
|
|
|
170
197
|
## `hereya config get-backend`
|
|
171
198
|
|
|
@@ -182,7 +209,7 @@ EXAMPLES
|
|
|
182
209
|
$ hereya config get-backend
|
|
183
210
|
```
|
|
184
211
|
|
|
185
|
-
_See code: [src/commands/config/get-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
212
|
+
_See code: [src/commands/config/get-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/config/get-backend/index.ts)_
|
|
186
213
|
|
|
187
214
|
## `hereya config import-backend FILE`
|
|
188
215
|
|
|
@@ -202,7 +229,7 @@ EXAMPLES
|
|
|
202
229
|
$ hereya config import-backend ./path/to/cloud-backend.json
|
|
203
230
|
```
|
|
204
231
|
|
|
205
|
-
_See code: [src/commands/config/import-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
232
|
+
_See code: [src/commands/config/import-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/config/import-backend/index.ts)_
|
|
206
233
|
|
|
207
234
|
## `hereya config use-backend TYPE`
|
|
208
235
|
|
|
@@ -224,7 +251,7 @@ EXAMPLES
|
|
|
224
251
|
$ hereya config use-backend local
|
|
225
252
|
```
|
|
226
253
|
|
|
227
|
-
_See code: [src/commands/config/use-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
254
|
+
_See code: [src/commands/config/use-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/config/use-backend/index.ts)_
|
|
228
255
|
|
|
229
256
|
## `hereya delete-state`
|
|
230
257
|
|
|
@@ -250,7 +277,7 @@ EXAMPLES
|
|
|
250
277
|
$ hereya delete-state --workspace staging
|
|
251
278
|
```
|
|
252
279
|
|
|
253
|
-
_See code: [src/commands/delete-state/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
280
|
+
_See code: [src/commands/delete-state/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/delete-state/index.ts)_
|
|
254
281
|
|
|
255
282
|
## `hereya deploy`
|
|
256
283
|
|
|
@@ -276,7 +303,7 @@ EXAMPLES
|
|
|
276
303
|
$ hereya deploy
|
|
277
304
|
```
|
|
278
305
|
|
|
279
|
-
_See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
306
|
+
_See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/deploy/index.ts)_
|
|
280
307
|
|
|
281
308
|
## `hereya devenv config`
|
|
282
309
|
|
|
@@ -296,7 +323,7 @@ EXAMPLES
|
|
|
296
323
|
$ hereya devenv config -w my-workspace
|
|
297
324
|
```
|
|
298
325
|
|
|
299
|
-
_See code: [src/commands/devenv/config/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
326
|
+
_See code: [src/commands/devenv/config/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/devenv/config/index.ts)_
|
|
300
327
|
|
|
301
328
|
## `hereya devenv install`
|
|
302
329
|
|
|
@@ -321,7 +348,7 @@ EXAMPLES
|
|
|
321
348
|
$ hereya devenv install -w my-workspace -p instanceType=t3.large
|
|
322
349
|
```
|
|
323
350
|
|
|
324
|
-
_See code: [src/commands/devenv/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
351
|
+
_See code: [src/commands/devenv/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/devenv/install/index.ts)_
|
|
325
352
|
|
|
326
353
|
## `hereya devenv project init PROJECT`
|
|
327
354
|
|
|
@@ -353,7 +380,7 @@ EXAMPLES
|
|
|
353
380
|
$ hereya devenv project init my-app -w my-workspace -t acme/node-starter -p region=us-east-1
|
|
354
381
|
```
|
|
355
382
|
|
|
356
|
-
_See code: [src/commands/devenv/project/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
383
|
+
_See code: [src/commands/devenv/project/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/devenv/project/init/index.ts)_
|
|
357
384
|
|
|
358
385
|
## `hereya devenv project uninit PROJECT`
|
|
359
386
|
|
|
@@ -379,7 +406,7 @@ EXAMPLES
|
|
|
379
406
|
$ hereya devenv project uninit my-app -w my-workspace --force
|
|
380
407
|
```
|
|
381
408
|
|
|
382
|
-
_See code: [src/commands/devenv/project/uninit/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
409
|
+
_See code: [src/commands/devenv/project/uninit/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/devenv/project/uninit/index.ts)_
|
|
383
410
|
|
|
384
411
|
## `hereya devenv ssh`
|
|
385
412
|
|
|
@@ -399,7 +426,7 @@ EXAMPLES
|
|
|
399
426
|
$ hereya devenv ssh -w my-workspace
|
|
400
427
|
```
|
|
401
428
|
|
|
402
|
-
_See code: [src/commands/devenv/ssh/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
429
|
+
_See code: [src/commands/devenv/ssh/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/devenv/ssh/index.ts)_
|
|
403
430
|
|
|
404
431
|
## `hereya devenv uninstall`
|
|
405
432
|
|
|
@@ -420,7 +447,7 @@ EXAMPLES
|
|
|
420
447
|
$ hereya devenv uninstall -w my-workspace
|
|
421
448
|
```
|
|
422
449
|
|
|
423
|
-
_See code: [src/commands/devenv/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
450
|
+
_See code: [src/commands/devenv/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/devenv/uninstall/index.ts)_
|
|
424
451
|
|
|
425
452
|
## `hereya doc PACKAGE`
|
|
426
453
|
|
|
@@ -453,7 +480,7 @@ EXAMPLES
|
|
|
453
480
|
$ hereya doc my-package --no-doc
|
|
454
481
|
```
|
|
455
482
|
|
|
456
|
-
_See code: [src/commands/doc/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
483
|
+
_See code: [src/commands/doc/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/doc/index.ts)_
|
|
457
484
|
|
|
458
485
|
## `hereya docker run IMAGE`
|
|
459
486
|
|
|
@@ -484,7 +511,7 @@ EXAMPLES
|
|
|
484
511
|
$ hereya docker run myapp:latest -- --rm -v ./data:/data
|
|
485
512
|
```
|
|
486
513
|
|
|
487
|
-
_See code: [src/commands/docker/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
514
|
+
_See code: [src/commands/docker/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/docker/run/index.ts)_
|
|
488
515
|
|
|
489
516
|
## `hereya down`
|
|
490
517
|
|
|
@@ -511,7 +538,7 @@ EXAMPLES
|
|
|
511
538
|
$ hereya down
|
|
512
539
|
```
|
|
513
540
|
|
|
514
|
-
_See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
541
|
+
_See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/down/index.ts)_
|
|
515
542
|
|
|
516
543
|
## `hereya env [NAME]`
|
|
517
544
|
|
|
@@ -542,7 +569,7 @@ EXAMPLES
|
|
|
542
569
|
$ hereya env -w dev -l
|
|
543
570
|
```
|
|
544
571
|
|
|
545
|
-
_See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
572
|
+
_See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/env/index.ts)_
|
|
546
573
|
|
|
547
574
|
## `hereya env set [NAME]`
|
|
548
575
|
|
|
@@ -569,7 +596,7 @@ EXAMPLES
|
|
|
569
596
|
$ hereya env set FOO -v bar -w dev
|
|
570
597
|
```
|
|
571
598
|
|
|
572
|
-
_See code: [src/commands/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
599
|
+
_See code: [src/commands/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/env/set/index.ts)_
|
|
573
600
|
|
|
574
601
|
## `hereya executor start`
|
|
575
602
|
|
|
@@ -602,7 +629,7 @@ EXAMPLES
|
|
|
602
629
|
HEREYA_TOKEN=<token> HEREYA_CLOUD_URL=https://my-cloud.example.com hereya executor start -w my-workspace
|
|
603
630
|
```
|
|
604
631
|
|
|
605
|
-
_See code: [src/commands/executor/start/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
632
|
+
_See code: [src/commands/executor/start/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/executor/start/index.ts)_
|
|
606
633
|
|
|
607
634
|
## `hereya flow add PACKAGE`
|
|
608
635
|
|
|
@@ -640,7 +667,7 @@ EXAMPLES
|
|
|
640
667
|
$ hereya flow add cloudy/docker_postgres -p DB_NAME=mydb -p DB_USER=admin
|
|
641
668
|
```
|
|
642
669
|
|
|
643
|
-
_See code: [src/commands/flow/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
670
|
+
_See code: [src/commands/flow/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/flow/add/index.ts)_
|
|
644
671
|
|
|
645
672
|
## `hereya flow docker run IMAGE`
|
|
646
673
|
|
|
@@ -670,7 +697,7 @@ EXAMPLES
|
|
|
670
697
|
$ hereya flow docker run --pin myapp:latest -- --rm
|
|
671
698
|
```
|
|
672
699
|
|
|
673
|
-
_See code: [src/commands/flow/docker/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
700
|
+
_See code: [src/commands/flow/docker/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/flow/docker/run/index.ts)_
|
|
674
701
|
|
|
675
702
|
## `hereya flow down`
|
|
676
703
|
|
|
@@ -704,7 +731,7 @@ EXAMPLES
|
|
|
704
731
|
$ hereya flow down --pin
|
|
705
732
|
```
|
|
706
733
|
|
|
707
|
-
_See code: [src/commands/flow/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
734
|
+
_See code: [src/commands/flow/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/flow/down/index.ts)_
|
|
708
735
|
|
|
709
736
|
## `hereya flow env [NAME]`
|
|
710
737
|
|
|
@@ -738,7 +765,7 @@ EXAMPLES
|
|
|
738
765
|
$ hereya flow env -l
|
|
739
766
|
```
|
|
740
767
|
|
|
741
|
-
_See code: [src/commands/flow/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
768
|
+
_See code: [src/commands/flow/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/flow/env/index.ts)_
|
|
742
769
|
|
|
743
770
|
## `hereya flow provid PACKAGE`
|
|
744
771
|
|
|
@@ -767,7 +794,7 @@ EXAMPLES
|
|
|
767
794
|
$ hereya flow provid hereya/postgres --pin
|
|
768
795
|
```
|
|
769
796
|
|
|
770
|
-
_See code: [src/commands/flow/provid/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
797
|
+
_See code: [src/commands/flow/provid/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/flow/provid/index.ts)_
|
|
771
798
|
|
|
772
799
|
## `hereya flow remove PACKAGE`
|
|
773
800
|
|
|
@@ -797,7 +824,7 @@ EXAMPLES
|
|
|
797
824
|
$ hereya flow remove cloudy/docker_postgres --profile staging
|
|
798
825
|
```
|
|
799
826
|
|
|
800
|
-
_See code: [src/commands/flow/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
827
|
+
_See code: [src/commands/flow/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/flow/remove/index.ts)_
|
|
801
828
|
|
|
802
829
|
## `hereya flow run CMD`
|
|
803
830
|
|
|
@@ -826,7 +853,7 @@ EXAMPLES
|
|
|
826
853
|
$ hereya flow run --pin -- npm test
|
|
827
854
|
```
|
|
828
855
|
|
|
829
|
-
_See code: [src/commands/flow/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
856
|
+
_See code: [src/commands/flow/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/flow/run/index.ts)_
|
|
830
857
|
|
|
831
858
|
## `hereya flow up`
|
|
832
859
|
|
|
@@ -860,7 +887,7 @@ EXAMPLES
|
|
|
860
887
|
$ hereya flow up --pin
|
|
861
888
|
```
|
|
862
889
|
|
|
863
|
-
_See code: [src/commands/flow/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
890
|
+
_See code: [src/commands/flow/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/flow/up/index.ts)_
|
|
864
891
|
|
|
865
892
|
## `hereya help [COMMAND]`
|
|
866
893
|
|
|
@@ -917,7 +944,7 @@ EXAMPLES
|
|
|
917
944
|
$ hereya import org/my-package -f state.tfstate -w my-workspace
|
|
918
945
|
```
|
|
919
946
|
|
|
920
|
-
_See code: [src/commands/import/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
947
|
+
_See code: [src/commands/import/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/import/index.ts)_
|
|
921
948
|
|
|
922
949
|
## `hereya init PROJECT`
|
|
923
950
|
|
|
@@ -951,7 +978,24 @@ EXAMPLES
|
|
|
951
978
|
$ hereya init myProject -w=dev -t=acme/node-starter -d=prod -p region=us-east-1
|
|
952
979
|
```
|
|
953
980
|
|
|
954
|
-
_See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
981
|
+
_See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/init/index.ts)_
|
|
982
|
+
|
|
983
|
+
## `hereya list`
|
|
984
|
+
|
|
985
|
+
List your projects.
|
|
986
|
+
|
|
987
|
+
```
|
|
988
|
+
USAGE
|
|
989
|
+
$ hereya list
|
|
990
|
+
|
|
991
|
+
DESCRIPTION
|
|
992
|
+
List your projects.
|
|
993
|
+
|
|
994
|
+
EXAMPLES
|
|
995
|
+
$ hereya list
|
|
996
|
+
```
|
|
997
|
+
|
|
998
|
+
_See code: [src/commands/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/list/index.ts)_
|
|
955
999
|
|
|
956
1000
|
## `hereya login [URL]`
|
|
957
1001
|
|
|
@@ -980,7 +1024,7 @@ EXAMPLES
|
|
|
980
1024
|
$ hereya login --token=your-token https://cloud.hereya.dev
|
|
981
1025
|
```
|
|
982
1026
|
|
|
983
|
-
_See code: [src/commands/login/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1027
|
+
_See code: [src/commands/login/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/login/index.ts)_
|
|
984
1028
|
|
|
985
1029
|
## `hereya logout`
|
|
986
1030
|
|
|
@@ -997,7 +1041,7 @@ EXAMPLES
|
|
|
997
1041
|
$ hereya logout
|
|
998
1042
|
```
|
|
999
1043
|
|
|
1000
|
-
_See code: [src/commands/logout/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1044
|
+
_See code: [src/commands/logout/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/logout/index.ts)_
|
|
1001
1045
|
|
|
1002
1046
|
## `hereya provid PACKAGE`
|
|
1003
1047
|
|
|
@@ -1025,7 +1069,7 @@ EXAMPLES
|
|
|
1025
1069
|
$ hereya provid hereya/postgres --workspace staging
|
|
1026
1070
|
```
|
|
1027
1071
|
|
|
1028
|
-
_See code: [src/commands/provid/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1072
|
+
_See code: [src/commands/provid/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/provid/index.ts)_
|
|
1029
1073
|
|
|
1030
1074
|
## `hereya publish`
|
|
1031
1075
|
|
|
@@ -1048,7 +1092,7 @@ EXAMPLES
|
|
|
1048
1092
|
$ hereya publish --chdir=/path/to/package
|
|
1049
1093
|
```
|
|
1050
1094
|
|
|
1051
|
-
_See code: [src/commands/publish/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1095
|
+
_See code: [src/commands/publish/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/publish/index.ts)_
|
|
1052
1096
|
|
|
1053
1097
|
## `hereya remove PACKAGE`
|
|
1054
1098
|
|
|
@@ -1076,7 +1120,7 @@ EXAMPLES
|
|
|
1076
1120
|
$ hereya remove cloudy/docker_postgres
|
|
1077
1121
|
```
|
|
1078
1122
|
|
|
1079
|
-
_See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1123
|
+
_See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/remove/index.ts)_
|
|
1080
1124
|
|
|
1081
1125
|
## `hereya run CMD`
|
|
1082
1126
|
|
|
@@ -1102,7 +1146,7 @@ EXAMPLES
|
|
|
1102
1146
|
$ hereya run -w uat -- node index.js
|
|
1103
1147
|
```
|
|
1104
1148
|
|
|
1105
|
-
_See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1149
|
+
_See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/run/index.ts)_
|
|
1106
1150
|
|
|
1107
1151
|
## `hereya search QUERY`
|
|
1108
1152
|
|
|
@@ -1133,7 +1177,7 @@ EXAMPLES
|
|
|
1133
1177
|
$ hereya search database --json
|
|
1134
1178
|
```
|
|
1135
1179
|
|
|
1136
|
-
_See code: [src/commands/search/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1180
|
+
_See code: [src/commands/search/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/search/index.ts)_
|
|
1137
1181
|
|
|
1138
1182
|
## `hereya unbootstrap INFRASTRUCTURETYPE`
|
|
1139
1183
|
|
|
@@ -1158,7 +1202,7 @@ EXAMPLES
|
|
|
1158
1202
|
$ hereya unbootstrap local
|
|
1159
1203
|
```
|
|
1160
1204
|
|
|
1161
|
-
_See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1205
|
+
_See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/unbootstrap/index.ts)_
|
|
1162
1206
|
|
|
1163
1207
|
## `hereya undeploy`
|
|
1164
1208
|
|
|
@@ -1184,7 +1228,7 @@ EXAMPLES
|
|
|
1184
1228
|
$ hereya undeploy
|
|
1185
1229
|
```
|
|
1186
1230
|
|
|
1187
|
-
_See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1231
|
+
_See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/undeploy/index.ts)_
|
|
1188
1232
|
|
|
1189
1233
|
## `hereya uninit PROJECT`
|
|
1190
1234
|
|
|
@@ -1212,7 +1256,7 @@ EXAMPLES
|
|
|
1212
1256
|
$ hereya uninit myProject -w dev -p prodWorkspace=prod
|
|
1213
1257
|
```
|
|
1214
1258
|
|
|
1215
|
-
_See code: [src/commands/uninit/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1259
|
+
_See code: [src/commands/uninit/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/uninit/index.ts)_
|
|
1216
1260
|
|
|
1217
1261
|
## `hereya up`
|
|
1218
1262
|
|
|
@@ -1239,7 +1283,7 @@ EXAMPLES
|
|
|
1239
1283
|
$ hereya up
|
|
1240
1284
|
```
|
|
1241
1285
|
|
|
1242
|
-
_See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1286
|
+
_See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/up/index.ts)_
|
|
1243
1287
|
|
|
1244
1288
|
## `hereya update [VERSION]`
|
|
1245
1289
|
|
|
@@ -1261,7 +1305,7 @@ EXAMPLES
|
|
|
1261
1305
|
$ hereya update 0.75.0
|
|
1262
1306
|
```
|
|
1263
1307
|
|
|
1264
|
-
_See code: [src/commands/update/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1308
|
+
_See code: [src/commands/update/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/update/index.ts)_
|
|
1265
1309
|
|
|
1266
1310
|
## `hereya workspace create NAME`
|
|
1267
1311
|
|
|
@@ -1286,7 +1330,7 @@ EXAMPLES
|
|
|
1286
1330
|
$ hereya workspace create dev
|
|
1287
1331
|
```
|
|
1288
1332
|
|
|
1289
|
-
_See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1333
|
+
_See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/workspace/create/index.ts)_
|
|
1290
1334
|
|
|
1291
1335
|
## `hereya workspace delete NAME`
|
|
1292
1336
|
|
|
@@ -1306,7 +1350,7 @@ EXAMPLES
|
|
|
1306
1350
|
$ hereya workspace delete dev
|
|
1307
1351
|
```
|
|
1308
1352
|
|
|
1309
|
-
_See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1353
|
+
_See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/workspace/delete/index.ts)_
|
|
1310
1354
|
|
|
1311
1355
|
## `hereya workspace env [NAME]`
|
|
1312
1356
|
|
|
@@ -1332,7 +1376,7 @@ EXAMPLES
|
|
|
1332
1376
|
$ hereya workspace env myEnv -w dev
|
|
1333
1377
|
```
|
|
1334
1378
|
|
|
1335
|
-
_See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1379
|
+
_See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/workspace/env/index.ts)_
|
|
1336
1380
|
|
|
1337
1381
|
## `hereya workspace env set`
|
|
1338
1382
|
|
|
@@ -1356,7 +1400,7 @@ EXAMPLES
|
|
|
1356
1400
|
$ hereya workspace env set -w my-workspace -n myVar -v my-value -i aws -s
|
|
1357
1401
|
```
|
|
1358
1402
|
|
|
1359
|
-
_See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1403
|
+
_See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/workspace/env/set/index.ts)_
|
|
1360
1404
|
|
|
1361
1405
|
## `hereya workspace env unset`
|
|
1362
1406
|
|
|
@@ -1377,7 +1421,7 @@ EXAMPLES
|
|
|
1377
1421
|
$ hereya workspace env unset -w my-workspace -n myVar
|
|
1378
1422
|
```
|
|
1379
1423
|
|
|
1380
|
-
_See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1424
|
+
_See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/workspace/env/unset/index.ts)_
|
|
1381
1425
|
|
|
1382
1426
|
## `hereya workspace executor install`
|
|
1383
1427
|
|
|
@@ -1396,7 +1440,7 @@ DESCRIPTION
|
|
|
1396
1440
|
Install a remote executor into a workspace
|
|
1397
1441
|
```
|
|
1398
1442
|
|
|
1399
|
-
_See code: [src/commands/workspace/executor/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1443
|
+
_See code: [src/commands/workspace/executor/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/workspace/executor/install/index.ts)_
|
|
1400
1444
|
|
|
1401
1445
|
## `hereya workspace executor token`
|
|
1402
1446
|
|
|
@@ -1413,7 +1457,7 @@ DESCRIPTION
|
|
|
1413
1457
|
Generate a workspace-scoped executor token for the remote executor
|
|
1414
1458
|
```
|
|
1415
1459
|
|
|
1416
|
-
_See code: [src/commands/workspace/executor/token/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1460
|
+
_See code: [src/commands/workspace/executor/token/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/workspace/executor/token/index.ts)_
|
|
1417
1461
|
|
|
1418
1462
|
## `hereya workspace executor uninstall`
|
|
1419
1463
|
|
|
@@ -1431,7 +1475,7 @@ DESCRIPTION
|
|
|
1431
1475
|
Uninstall the remote executor from a workspace
|
|
1432
1476
|
```
|
|
1433
1477
|
|
|
1434
|
-
_See code: [src/commands/workspace/executor/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1478
|
+
_See code: [src/commands/workspace/executor/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/workspace/executor/uninstall/index.ts)_
|
|
1435
1479
|
|
|
1436
1480
|
## `hereya workspace install PACKAGE`
|
|
1437
1481
|
|
|
@@ -1458,7 +1502,7 @@ EXAMPLES
|
|
|
1458
1502
|
$ hereya workspace install hereya/aws-cognito
|
|
1459
1503
|
```
|
|
1460
1504
|
|
|
1461
|
-
_See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1505
|
+
_See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/workspace/install/index.ts)_
|
|
1462
1506
|
|
|
1463
1507
|
## `hereya workspace list`
|
|
1464
1508
|
|
|
@@ -1482,7 +1526,7 @@ EXAMPLES
|
|
|
1482
1526
|
$ hereya workspace list --org personal
|
|
1483
1527
|
```
|
|
1484
1528
|
|
|
1485
|
-
_See code: [src/commands/workspace/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1529
|
+
_See code: [src/commands/workspace/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/workspace/list/index.ts)_
|
|
1486
1530
|
|
|
1487
1531
|
## `hereya workspace set-profile PROFILE`
|
|
1488
1532
|
|
|
@@ -1506,7 +1550,7 @@ EXAMPLES
|
|
|
1506
1550
|
$ hereya workspace set-profile prod-profile -w production
|
|
1507
1551
|
```
|
|
1508
1552
|
|
|
1509
|
-
_See code: [src/commands/workspace/set-profile/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1553
|
+
_See code: [src/commands/workspace/set-profile/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/workspace/set-profile/index.ts)_
|
|
1510
1554
|
|
|
1511
1555
|
## `hereya workspace uninstall PACKAGE`
|
|
1512
1556
|
|
|
@@ -1533,5 +1577,5 @@ EXAMPLES
|
|
|
1533
1577
|
$ hereya workspace uninstall hereya/aws-cognito
|
|
1534
1578
|
```
|
|
1535
1579
|
|
|
1536
|
-
_See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
1580
|
+
_See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.79.0/src/commands/workspace/uninstall/index.ts)_
|
|
1537
1581
|
<!-- commandsstop -->
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Config } from '../../lib/config/common.js';
|
|
2
|
-
import { AddPackageToWorkspaceInput, AddPackageToWorkspaceOutput, Backend, CreateWorkspaceInput, CreateWorkspaceOutput, DeleteStateInput, DeleteStateOutput, DeleteWorkspaceInput, DeleteWorkspaceOutput, ExportBackendOutput, GetPackageOutput, GetProjectMetadataInput, GetProjectMetadataOutput, GetProvisioningIdInput, GetProvisioningIdOutput, GetStateInput, GetStateOutput, GetWorkspaceEnvInput, GetWorkspaceEnvOutput, GetWorkspaceOutput, ImportBackendInput, ImportBackendOutput, InitProjectInput, InitProjectOutput, ListPackageVersionsOutput, ListWorkspacesInput, PublishPackageInput, PublishPackageOutput, RemovePackageFromWorkspaceInput, RemovePackageFromWorkspaceOutput, SaveProjectMetadataInput, SaveProjectMetadataOutput, SearchPackagesInput, SearchPackagesOutput, SetEnvVarInput, SetEnvVarOutput, UnsetEnvVarInput, UnsetEnvVarOutput, UpdateWorkspaceInput, UpdateWorkspaceOutput } from '../common.js';
|
|
2
|
+
import { AddPackageToWorkspaceInput, AddPackageToWorkspaceOutput, Backend, CreateWorkspaceInput, CreateWorkspaceOutput, DeleteStateInput, DeleteStateOutput, DeleteWorkspaceInput, DeleteWorkspaceOutput, ExportBackendOutput, GetPackageOutput, GetProjectMetadataInput, GetProjectMetadataOutput, GetProvisioningIdInput, GetProvisioningIdOutput, GetStateInput, GetStateOutput, GetWorkspaceEnvInput, GetWorkspaceEnvOutput, GetWorkspaceOutput, ImportBackendInput, ImportBackendOutput, InitProjectInput, InitProjectOutput, ListPackageVersionsOutput, ListProjectsOutput, ListWorkspacesInput, PublishPackageInput, PublishPackageOutput, RemovePackageFromWorkspaceInput, RemovePackageFromWorkspaceOutput, SaveProjectMetadataInput, SaveProjectMetadataOutput, SearchPackagesInput, SearchPackagesOutput, SetEnvVarInput, SetEnvVarOutput, UnsetEnvVarInput, UnsetEnvVarOutput, UpdateWorkspaceInput, UpdateWorkspaceOutput } from '../common.js';
|
|
3
3
|
interface CloudBackendConfig {
|
|
4
4
|
accessToken: string;
|
|
5
5
|
clientId: string;
|
|
@@ -52,6 +52,7 @@ export declare class CloudBackend implements Backend {
|
|
|
52
52
|
importBackend(input: ImportBackendInput): Promise<ImportBackendOutput>;
|
|
53
53
|
init(input: InitProjectInput): Promise<InitProjectOutput>;
|
|
54
54
|
listPackageVersions(name: string): Promise<ListPackageVersionsOutput>;
|
|
55
|
+
listProjects(): Promise<ListProjectsOutput>;
|
|
55
56
|
listWorkspaces(input?: ListWorkspacesInput): Promise<string[]>;
|
|
56
57
|
pollExecutorJobs(input: {
|
|
57
58
|
executorId?: string;
|
|
@@ -250,6 +250,7 @@ export class CloudBackend {
|
|
|
250
250
|
};
|
|
251
251
|
}
|
|
252
252
|
return {
|
|
253
|
+
defaultWorkspace: result.defaultWorkspace,
|
|
253
254
|
found: true,
|
|
254
255
|
metadata: result.metadata,
|
|
255
256
|
};
|
|
@@ -452,6 +453,20 @@ export class CloudBackend {
|
|
|
452
453
|
success: true,
|
|
453
454
|
};
|
|
454
455
|
}
|
|
456
|
+
async listProjects() {
|
|
457
|
+
const response = await fetch(`${this.config.url}/api/projects`, {
|
|
458
|
+
headers: { 'Authorization': `Bearer ${this.config.accessToken}` },
|
|
459
|
+
method: 'GET',
|
|
460
|
+
});
|
|
461
|
+
if (!response.ok) {
|
|
462
|
+
throw new Error(JSON.stringify(await this.safeResponseJson(response)));
|
|
463
|
+
}
|
|
464
|
+
const result = await response.json();
|
|
465
|
+
return (result.projects ?? []).map((p) => ({
|
|
466
|
+
defaultWorkspace: p.defaultWorkspace?.name ?? '-',
|
|
467
|
+
name: p.name,
|
|
468
|
+
}));
|
|
469
|
+
}
|
|
455
470
|
async listWorkspaces(input) {
|
|
456
471
|
const url = new URL(`${this.config.url}/api/workspaces`);
|
|
457
472
|
if (input?.org) {
|
package/dist/backend/common.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export interface Backend {
|
|
|
17
17
|
importBackend(input: ImportBackendInput): Promise<ImportBackendOutput>;
|
|
18
18
|
init(options: InitProjectInput): Promise<InitProjectOutput>;
|
|
19
19
|
listPackageVersions?(name: string): Promise<ListPackageVersionsOutput>;
|
|
20
|
+
listProjects?(): Promise<ListProjectsOutput>;
|
|
20
21
|
listWorkspaces(input?: ListWorkspacesInput): Promise<string[]>;
|
|
21
22
|
publishPackage?(input: PublishPackageInput): Promise<PublishPackageOutput>;
|
|
22
23
|
removePackageFromWorkspace(input: RemovePackageFromWorkspaceInput): Promise<RemovePackageFromWorkspaceOutput>;
|
|
@@ -326,11 +327,12 @@ export type ProjectMetadata = {
|
|
|
326
327
|
template: string;
|
|
327
328
|
};
|
|
328
329
|
export type GetProjectMetadataOutput = {
|
|
329
|
-
|
|
330
|
-
reason?: string;
|
|
331
|
-
} | {
|
|
330
|
+
defaultWorkspace: string;
|
|
332
331
|
found: true;
|
|
333
332
|
metadata: ProjectMetadata;
|
|
333
|
+
} | {
|
|
334
|
+
found: false;
|
|
335
|
+
reason?: string;
|
|
334
336
|
};
|
|
335
337
|
export type SaveProjectMetadataInput = {
|
|
336
338
|
metadata: ProjectMetadata;
|
|
@@ -342,3 +344,8 @@ export type SaveProjectMetadataOutput = {
|
|
|
342
344
|
} | {
|
|
343
345
|
success: true;
|
|
344
346
|
};
|
|
347
|
+
export type ProjectSummary = {
|
|
348
|
+
defaultWorkspace: string;
|
|
349
|
+
name: string;
|
|
350
|
+
};
|
|
351
|
+
export type ListProjectsOutput = ProjectSummary[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class Clone extends Command {
|
|
3
|
+
static args: {
|
|
4
|
+
project: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
chdir: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
+
import { Listr, ListrLogger, ListrLogLevels } from 'listr2';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { getBackend } from '../../backend/index.js';
|
|
6
|
+
import { getExecutorForWorkspace } from '../../executor/context.js';
|
|
7
|
+
import { getConfigManager } from '../../lib/config/index.js';
|
|
8
|
+
import { gitUtils } from '../../lib/git-utils.js';
|
|
9
|
+
import { getLogPath } from '../../lib/log.js';
|
|
10
|
+
export default class Clone extends Command {
|
|
11
|
+
static args = {
|
|
12
|
+
project: Args.string({ description: 'project name', required: true }),
|
|
13
|
+
};
|
|
14
|
+
static description = 'Clone an existing template-based project to the local machine.';
|
|
15
|
+
static examples = [
|
|
16
|
+
'<%= config.bin %> <%= command.id %> myProject',
|
|
17
|
+
'<%= config.bin %> <%= command.id %> myProject --chdir=./myProject',
|
|
18
|
+
];
|
|
19
|
+
static flags = {
|
|
20
|
+
chdir: Flags.string({
|
|
21
|
+
description: 'directory to clone into',
|
|
22
|
+
required: false,
|
|
23
|
+
}),
|
|
24
|
+
};
|
|
25
|
+
async run() {
|
|
26
|
+
const { args, flags } = await this.parse(Clone);
|
|
27
|
+
const targetDir = flags.chdir || path.join(process.cwd(), args.project.replaceAll('/', '-'));
|
|
28
|
+
if (fs.existsSync(targetDir)) {
|
|
29
|
+
this.error(`Directory ${targetDir} already exists.`);
|
|
30
|
+
}
|
|
31
|
+
const task = new Listr([
|
|
32
|
+
{
|
|
33
|
+
async task(ctx) {
|
|
34
|
+
const backend = await getBackend();
|
|
35
|
+
if (!backend.getProjectMetadata) {
|
|
36
|
+
throw new Error('Clone requires cloud backend. Run `hereya login` first.');
|
|
37
|
+
}
|
|
38
|
+
const metadata$ = await backend.getProjectMetadata({ project: args.project });
|
|
39
|
+
if (!metadata$.found) {
|
|
40
|
+
throw new Error(`Project metadata not found for ${args.project}. Was it initialized with a template?`);
|
|
41
|
+
}
|
|
42
|
+
ctx.metadata = metadata$.metadata;
|
|
43
|
+
ctx.defaultWorkspace = metadata$.defaultWorkspace;
|
|
44
|
+
},
|
|
45
|
+
title: 'Fetching project metadata',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
async task(ctx) {
|
|
49
|
+
const gitEnvToResolve = {};
|
|
50
|
+
for (const [key, value] of Object.entries(ctx.metadata.env || {})) {
|
|
51
|
+
if (key.startsWith('hereyaGit'))
|
|
52
|
+
gitEnvToResolve[key] = value;
|
|
53
|
+
}
|
|
54
|
+
const executor$ = await getExecutorForWorkspace(ctx.defaultWorkspace);
|
|
55
|
+
if (!executor$.success)
|
|
56
|
+
throw new Error(executor$.reason);
|
|
57
|
+
ctx.resolvedGitEnv = await executor$.executor.resolveEnvValues({ env: gitEnvToResolve });
|
|
58
|
+
if (!ctx.resolvedGitEnv.hereyaGitRemoteUrl) {
|
|
59
|
+
throw new Error('Project metadata does not contain hereyaGitRemoteUrl. Was it initialized with a template?');
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
title: 'Resolving git credentials',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
async task(ctx) {
|
|
66
|
+
const cloneResult = await gitUtils.cloneWithCredentialHelper({
|
|
67
|
+
gitUrl: ctx.resolvedGitEnv.hereyaGitRemoteUrl,
|
|
68
|
+
hereyaBinPath: process.argv[1],
|
|
69
|
+
password: ctx.resolvedGitEnv.hereyaGitPassword,
|
|
70
|
+
targetDir,
|
|
71
|
+
username: ctx.resolvedGitEnv.hereyaGitUsername,
|
|
72
|
+
});
|
|
73
|
+
if (!cloneResult.success)
|
|
74
|
+
throw new Error(cloneResult.reason);
|
|
75
|
+
},
|
|
76
|
+
title: 'Cloning project repository',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
async task(ctx) {
|
|
80
|
+
const configManager = getConfigManager();
|
|
81
|
+
const existing = await configManager.loadConfig({ projectRootDir: targetDir });
|
|
82
|
+
const config = {
|
|
83
|
+
...(existing.found ? existing.config : {}),
|
|
84
|
+
project: args.project,
|
|
85
|
+
workspace: ctx.defaultWorkspace,
|
|
86
|
+
};
|
|
87
|
+
await configManager.saveConfig({ config, projectRootDir: targetDir });
|
|
88
|
+
await gitUtils.setupCredentialHelper({ hereyaBinPath: process.argv[1], projectDir: targetDir });
|
|
89
|
+
const backend = await getBackend();
|
|
90
|
+
await backend.saveState(config, ctx.defaultWorkspace);
|
|
91
|
+
},
|
|
92
|
+
title: 'Setting up project',
|
|
93
|
+
},
|
|
94
|
+
], { concurrent: false });
|
|
95
|
+
try {
|
|
96
|
+
await task.run();
|
|
97
|
+
const myLogger = new ListrLogger({ useIcons: false });
|
|
98
|
+
myLogger.log(ListrLogLevels.COMPLETED, `Project ${args.project} cloned successfully`);
|
|
99
|
+
myLogger.log(ListrLogLevels.COMPLETED, `Project directory: ${targetDir}`);
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
this.error(`${error.message}\n\nSee ${getLogPath()} for more details`);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
import { getBackend } from '../../backend/index.js';
|
|
3
|
+
export default class List extends Command {
|
|
4
|
+
static description = 'List your projects.';
|
|
5
|
+
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
6
|
+
async run() {
|
|
7
|
+
try {
|
|
8
|
+
const backend = await getBackend();
|
|
9
|
+
if (!backend.listProjects) {
|
|
10
|
+
this.error('Listing projects requires cloud backend. Run `hereya login` first.');
|
|
11
|
+
}
|
|
12
|
+
const projects = await backend.listProjects();
|
|
13
|
+
if (projects.length === 0) {
|
|
14
|
+
this.log('No projects found.');
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const nameWidth = Math.max(4, ...projects.map(p => p.name.length));
|
|
18
|
+
const wsWidth = Math.max(17, ...projects.map(p => p.defaultWorkspace.length));
|
|
19
|
+
this.log(`${'Name'.padEnd(nameWidth)} ${'Default Workspace'.padEnd(wsWidth)}`);
|
|
20
|
+
this.log('-'.repeat(nameWidth + wsWidth + 2));
|
|
21
|
+
for (const project of projects) {
|
|
22
|
+
this.log(`${project.name.padEnd(nameWidth)} ${project.defaultWorkspace.padEnd(wsWidth)}`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
this.error(`Failed to list projects: ${error}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
package/oclif.manifest.json
CHANGED
|
@@ -102,6 +102,46 @@
|
|
|
102
102
|
"index.js"
|
|
103
103
|
]
|
|
104
104
|
},
|
|
105
|
+
"clone": {
|
|
106
|
+
"aliases": [],
|
|
107
|
+
"args": {
|
|
108
|
+
"project": {
|
|
109
|
+
"description": "project name",
|
|
110
|
+
"name": "project",
|
|
111
|
+
"required": true
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"description": "Clone an existing template-based project to the local machine.",
|
|
115
|
+
"examples": [
|
|
116
|
+
"<%= config.bin %> <%= command.id %> myProject",
|
|
117
|
+
"<%= config.bin %> <%= command.id %> myProject --chdir=./myProject"
|
|
118
|
+
],
|
|
119
|
+
"flags": {
|
|
120
|
+
"chdir": {
|
|
121
|
+
"description": "directory to clone into",
|
|
122
|
+
"name": "chdir",
|
|
123
|
+
"required": false,
|
|
124
|
+
"hasDynamicHelp": false,
|
|
125
|
+
"multiple": false,
|
|
126
|
+
"type": "option"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"hasDynamicHelp": false,
|
|
130
|
+
"hiddenAliases": [],
|
|
131
|
+
"id": "clone",
|
|
132
|
+
"pluginAlias": "hereya-cli",
|
|
133
|
+
"pluginName": "hereya-cli",
|
|
134
|
+
"pluginType": "core",
|
|
135
|
+
"strict": true,
|
|
136
|
+
"enableJsonFlag": false,
|
|
137
|
+
"isESM": true,
|
|
138
|
+
"relativePath": [
|
|
139
|
+
"dist",
|
|
140
|
+
"commands",
|
|
141
|
+
"clone",
|
|
142
|
+
"index.js"
|
|
143
|
+
]
|
|
144
|
+
},
|
|
105
145
|
"credential-helper": {
|
|
106
146
|
"aliases": [],
|
|
107
147
|
"args": {
|
|
@@ -130,12 +170,13 @@
|
|
|
130
170
|
"index.js"
|
|
131
171
|
]
|
|
132
172
|
},
|
|
133
|
-
"
|
|
173
|
+
"delete-state": {
|
|
134
174
|
"aliases": [],
|
|
135
175
|
"args": {},
|
|
136
|
-
"description": "
|
|
176
|
+
"description": "Delete the remote state of a project for a given workspace",
|
|
137
177
|
"examples": [
|
|
138
|
-
"<%= config.bin %> <%= command.id %>"
|
|
178
|
+
"<%= config.bin %> <%= command.id %> -w dev",
|
|
179
|
+
"<%= config.bin %> <%= command.id %> --workspace staging"
|
|
139
180
|
],
|
|
140
181
|
"flags": {
|
|
141
182
|
"chdir": {
|
|
@@ -146,21 +187,9 @@
|
|
|
146
187
|
"multiple": false,
|
|
147
188
|
"type": "option"
|
|
148
189
|
},
|
|
149
|
-
"debug": {
|
|
150
|
-
"description": "enable debug mode",
|
|
151
|
-
"name": "debug",
|
|
152
|
-
"allowNo": false,
|
|
153
|
-
"type": "boolean"
|
|
154
|
-
},
|
|
155
|
-
"local": {
|
|
156
|
-
"description": "force local execution (skip remote executor)",
|
|
157
|
-
"name": "local",
|
|
158
|
-
"allowNo": false,
|
|
159
|
-
"type": "boolean"
|
|
160
|
-
},
|
|
161
190
|
"workspace": {
|
|
162
191
|
"char": "w",
|
|
163
|
-
"description": "
|
|
192
|
+
"description": "workspace name",
|
|
164
193
|
"name": "workspace",
|
|
165
194
|
"required": true,
|
|
166
195
|
"hasDynamicHelp": false,
|
|
@@ -170,7 +199,7 @@
|
|
|
170
199
|
},
|
|
171
200
|
"hasDynamicHelp": false,
|
|
172
201
|
"hiddenAliases": [],
|
|
173
|
-
"id": "
|
|
202
|
+
"id": "delete-state",
|
|
174
203
|
"pluginAlias": "hereya-cli",
|
|
175
204
|
"pluginName": "hereya-cli",
|
|
176
205
|
"pluginType": "core",
|
|
@@ -180,17 +209,16 @@
|
|
|
180
209
|
"relativePath": [
|
|
181
210
|
"dist",
|
|
182
211
|
"commands",
|
|
183
|
-
"
|
|
212
|
+
"delete-state",
|
|
184
213
|
"index.js"
|
|
185
214
|
]
|
|
186
215
|
},
|
|
187
|
-
"
|
|
216
|
+
"deploy": {
|
|
188
217
|
"aliases": [],
|
|
189
218
|
"args": {},
|
|
190
|
-
"description": "
|
|
219
|
+
"description": "Deploy a hereya project using the project deployment package",
|
|
191
220
|
"examples": [
|
|
192
|
-
"<%= config.bin %> <%= command.id %>
|
|
193
|
-
"<%= config.bin %> <%= command.id %> --workspace staging"
|
|
221
|
+
"<%= config.bin %> <%= command.id %>"
|
|
194
222
|
],
|
|
195
223
|
"flags": {
|
|
196
224
|
"chdir": {
|
|
@@ -201,9 +229,21 @@
|
|
|
201
229
|
"multiple": false,
|
|
202
230
|
"type": "option"
|
|
203
231
|
},
|
|
232
|
+
"debug": {
|
|
233
|
+
"description": "enable debug mode",
|
|
234
|
+
"name": "debug",
|
|
235
|
+
"allowNo": false,
|
|
236
|
+
"type": "boolean"
|
|
237
|
+
},
|
|
238
|
+
"local": {
|
|
239
|
+
"description": "force local execution (skip remote executor)",
|
|
240
|
+
"name": "local",
|
|
241
|
+
"allowNo": false,
|
|
242
|
+
"type": "boolean"
|
|
243
|
+
},
|
|
204
244
|
"workspace": {
|
|
205
245
|
"char": "w",
|
|
206
|
-
"description": "workspace
|
|
246
|
+
"description": "name of the workspace to deploy the packages for",
|
|
207
247
|
"name": "workspace",
|
|
208
248
|
"required": true,
|
|
209
249
|
"hasDynamicHelp": false,
|
|
@@ -213,7 +253,7 @@
|
|
|
213
253
|
},
|
|
214
254
|
"hasDynamicHelp": false,
|
|
215
255
|
"hiddenAliases": [],
|
|
216
|
-
"id": "
|
|
256
|
+
"id": "deploy",
|
|
217
257
|
"pluginAlias": "hereya-cli",
|
|
218
258
|
"pluginName": "hereya-cli",
|
|
219
259
|
"pluginType": "core",
|
|
@@ -223,7 +263,7 @@
|
|
|
223
263
|
"relativePath": [
|
|
224
264
|
"dist",
|
|
225
265
|
"commands",
|
|
226
|
-
"
|
|
266
|
+
"deploy",
|
|
227
267
|
"index.js"
|
|
228
268
|
]
|
|
229
269
|
},
|
|
@@ -559,6 +599,30 @@
|
|
|
559
599
|
"index.js"
|
|
560
600
|
]
|
|
561
601
|
},
|
|
602
|
+
"list": {
|
|
603
|
+
"aliases": [],
|
|
604
|
+
"args": {},
|
|
605
|
+
"description": "List your projects.",
|
|
606
|
+
"examples": [
|
|
607
|
+
"<%= config.bin %> <%= command.id %>"
|
|
608
|
+
],
|
|
609
|
+
"flags": {},
|
|
610
|
+
"hasDynamicHelp": false,
|
|
611
|
+
"hiddenAliases": [],
|
|
612
|
+
"id": "list",
|
|
613
|
+
"pluginAlias": "hereya-cli",
|
|
614
|
+
"pluginName": "hereya-cli",
|
|
615
|
+
"pluginType": "core",
|
|
616
|
+
"strict": true,
|
|
617
|
+
"enableJsonFlag": false,
|
|
618
|
+
"isESM": true,
|
|
619
|
+
"relativePath": [
|
|
620
|
+
"dist",
|
|
621
|
+
"commands",
|
|
622
|
+
"list",
|
|
623
|
+
"index.js"
|
|
624
|
+
]
|
|
625
|
+
},
|
|
562
626
|
"login": {
|
|
563
627
|
"aliases": [],
|
|
564
628
|
"args": {
|
|
@@ -627,44 +691,27 @@
|
|
|
627
691
|
"index.js"
|
|
628
692
|
]
|
|
629
693
|
},
|
|
630
|
-
"
|
|
694
|
+
"publish": {
|
|
631
695
|
"aliases": [],
|
|
632
|
-
"args": {
|
|
633
|
-
|
|
634
|
-
"description": "Package name (e.g., hereya/postgres)",
|
|
635
|
-
"name": "package",
|
|
636
|
-
"required": true
|
|
637
|
-
}
|
|
638
|
-
},
|
|
639
|
-
"description": "Display the provisioning ID for a package",
|
|
696
|
+
"args": {},
|
|
697
|
+
"description": "Publish a package to the Hereya registry",
|
|
640
698
|
"examples": [
|
|
641
|
-
"
|
|
642
|
-
"
|
|
643
|
-
"<%= config.bin %> <%= command.id %> hereya/postgres --workspace staging"
|
|
699
|
+
"$ hereya publish",
|
|
700
|
+
"$ hereya publish --chdir=/path/to/package"
|
|
644
701
|
],
|
|
645
702
|
"flags": {
|
|
646
703
|
"chdir": {
|
|
647
|
-
"
|
|
648
|
-
"description": "Project root directory",
|
|
704
|
+
"description": "\n Directory where the command will be executed.\n If not specified, it defaults to the current working directory.\n ",
|
|
649
705
|
"name": "chdir",
|
|
650
706
|
"required": false,
|
|
651
707
|
"hasDynamicHelp": false,
|
|
652
708
|
"multiple": false,
|
|
653
709
|
"type": "option"
|
|
654
|
-
},
|
|
655
|
-
"workspace": {
|
|
656
|
-
"char": "w",
|
|
657
|
-
"description": "Name of the workspace",
|
|
658
|
-
"name": "workspace",
|
|
659
|
-
"required": false,
|
|
660
|
-
"hasDynamicHelp": false,
|
|
661
|
-
"multiple": false,
|
|
662
|
-
"type": "option"
|
|
663
710
|
}
|
|
664
711
|
},
|
|
665
712
|
"hasDynamicHelp": false,
|
|
666
713
|
"hiddenAliases": [],
|
|
667
|
-
"id": "
|
|
714
|
+
"id": "publish",
|
|
668
715
|
"pluginAlias": "hereya-cli",
|
|
669
716
|
"pluginName": "hereya-cli",
|
|
670
717
|
"pluginType": "core",
|
|
@@ -674,31 +721,48 @@
|
|
|
674
721
|
"relativePath": [
|
|
675
722
|
"dist",
|
|
676
723
|
"commands",
|
|
677
|
-
"
|
|
724
|
+
"publish",
|
|
678
725
|
"index.js"
|
|
679
726
|
]
|
|
680
727
|
},
|
|
681
|
-
"
|
|
728
|
+
"provid": {
|
|
682
729
|
"aliases": [],
|
|
683
|
-
"args": {
|
|
684
|
-
|
|
730
|
+
"args": {
|
|
731
|
+
"package": {
|
|
732
|
+
"description": "Package name (e.g., hereya/postgres)",
|
|
733
|
+
"name": "package",
|
|
734
|
+
"required": true
|
|
735
|
+
}
|
|
736
|
+
},
|
|
737
|
+
"description": "Display the provisioning ID for a package",
|
|
685
738
|
"examples": [
|
|
686
|
-
"
|
|
687
|
-
"
|
|
739
|
+
"<%= config.bin %> <%= command.id %> hereya/postgres",
|
|
740
|
+
"<%= config.bin %> <%= command.id %> hereya/postgres -w dev",
|
|
741
|
+
"<%= config.bin %> <%= command.id %> hereya/postgres --workspace staging"
|
|
688
742
|
],
|
|
689
743
|
"flags": {
|
|
690
744
|
"chdir": {
|
|
691
|
-
"
|
|
745
|
+
"char": "C",
|
|
746
|
+
"description": "Project root directory",
|
|
692
747
|
"name": "chdir",
|
|
693
748
|
"required": false,
|
|
694
749
|
"hasDynamicHelp": false,
|
|
695
750
|
"multiple": false,
|
|
696
751
|
"type": "option"
|
|
752
|
+
},
|
|
753
|
+
"workspace": {
|
|
754
|
+
"char": "w",
|
|
755
|
+
"description": "Name of the workspace",
|
|
756
|
+
"name": "workspace",
|
|
757
|
+
"required": false,
|
|
758
|
+
"hasDynamicHelp": false,
|
|
759
|
+
"multiple": false,
|
|
760
|
+
"type": "option"
|
|
697
761
|
}
|
|
698
762
|
},
|
|
699
763
|
"hasDynamicHelp": false,
|
|
700
764
|
"hiddenAliases": [],
|
|
701
|
-
"id": "
|
|
765
|
+
"id": "provid",
|
|
702
766
|
"pluginAlias": "hereya-cli",
|
|
703
767
|
"pluginName": "hereya-cli",
|
|
704
768
|
"pluginType": "core",
|
|
@@ -708,7 +772,7 @@
|
|
|
708
772
|
"relativePath": [
|
|
709
773
|
"dist",
|
|
710
774
|
"commands",
|
|
711
|
-
"
|
|
775
|
+
"provid",
|
|
712
776
|
"index.js"
|
|
713
777
|
]
|
|
714
778
|
},
|
|
@@ -2817,5 +2881,5 @@
|
|
|
2817
2881
|
]
|
|
2818
2882
|
}
|
|
2819
2883
|
},
|
|
2820
|
-
"version": "0.
|
|
2884
|
+
"version": "0.79.0"
|
|
2821
2885
|
}
|