hereya-cli 0.74.0 → 0.76.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 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.74.0 linux-x64 node-v24.14.0
24
+ hereya-cli/0.76.0 linux-x64 node-v24.14.0
25
25
  $ hereya --help [COMMAND]
26
26
  USAGE
27
27
  $ hereya COMMAND
@@ -72,6 +72,7 @@ USAGE
72
72
  * [`hereya undeploy`](#hereya-undeploy)
73
73
  * [`hereya uninit PROJECT`](#hereya-uninit-project)
74
74
  * [`hereya up`](#hereya-up)
75
+ * [`hereya update [VERSION]`](#hereya-update-version)
75
76
  * [`hereya workspace create NAME`](#hereya-workspace-create-name)
76
77
  * [`hereya workspace delete NAME`](#hereya-workspace-delete-name)
77
78
  * [`hereya workspace env [NAME]`](#hereya-workspace-env-name)
@@ -117,7 +118,7 @@ EXAMPLES
117
118
  $ hereya add cloudy/docker_postgres
118
119
  ```
119
120
 
120
- _See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/add/index.ts)_
121
+ _See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/add/index.ts)_
121
122
 
122
123
  ## `hereya bootstrap INFRASTRUCTURETYPE`
123
124
 
@@ -142,7 +143,7 @@ EXAMPLES
142
143
  $ hereya bootstrap local
143
144
  ```
144
145
 
145
- _See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/bootstrap/index.ts)_
146
+ _See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/bootstrap/index.ts)_
146
147
 
147
148
  ## `hereya config export-backend [FILE]`
148
149
 
@@ -164,7 +165,7 @@ EXAMPLES
164
165
  $ hereya config export-backend ./path/to/export.json
165
166
  ```
166
167
 
167
- _See code: [src/commands/config/export-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/config/export-backend/index.ts)_
168
+ _See code: [src/commands/config/export-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/config/export-backend/index.ts)_
168
169
 
169
170
  ## `hereya config get-backend`
170
171
 
@@ -181,7 +182,7 @@ EXAMPLES
181
182
  $ hereya config get-backend
182
183
  ```
183
184
 
184
- _See code: [src/commands/config/get-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/config/get-backend/index.ts)_
185
+ _See code: [src/commands/config/get-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/config/get-backend/index.ts)_
185
186
 
186
187
  ## `hereya config import-backend FILE`
187
188
 
@@ -201,7 +202,7 @@ EXAMPLES
201
202
  $ hereya config import-backend ./path/to/cloud-backend.json
202
203
  ```
203
204
 
204
- _See code: [src/commands/config/import-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/config/import-backend/index.ts)_
205
+ _See code: [src/commands/config/import-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/config/import-backend/index.ts)_
205
206
 
206
207
  ## `hereya config use-backend TYPE`
207
208
 
@@ -223,7 +224,7 @@ EXAMPLES
223
224
  $ hereya config use-backend local
224
225
  ```
225
226
 
226
- _See code: [src/commands/config/use-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/config/use-backend/index.ts)_
227
+ _See code: [src/commands/config/use-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/config/use-backend/index.ts)_
227
228
 
228
229
  ## `hereya delete-state`
229
230
 
@@ -249,7 +250,7 @@ EXAMPLES
249
250
  $ hereya delete-state --workspace staging
250
251
  ```
251
252
 
252
- _See code: [src/commands/delete-state/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/delete-state/index.ts)_
253
+ _See code: [src/commands/delete-state/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/delete-state/index.ts)_
253
254
 
254
255
  ## `hereya deploy`
255
256
 
@@ -257,7 +258,7 @@ Deploy a hereya project using the project deployment package
257
258
 
258
259
  ```
259
260
  USAGE
260
- $ hereya deploy -w <value> [--chdir <value>] [--debug]
261
+ $ hereya deploy -w <value> [--chdir <value>] [--debug] [--local]
261
262
 
262
263
  FLAGS
263
264
  -w, --workspace=<value> (required) name of the workspace to deploy the packages for
@@ -266,6 +267,7 @@ FLAGS
266
267
  Alternatively, you can define the project root by setting the HEREYA_PROJECT_ROOT_DIR
267
268
  environment variable.
268
269
  --debug enable debug mode
270
+ --local force local execution (skip remote executor)
269
271
 
270
272
  DESCRIPTION
271
273
  Deploy a hereya project using the project deployment package
@@ -274,7 +276,7 @@ EXAMPLES
274
276
  $ hereya deploy
275
277
  ```
276
278
 
277
- _See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/deploy/index.ts)_
279
+ _See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/deploy/index.ts)_
278
280
 
279
281
  ## `hereya devenv config`
280
282
 
@@ -294,7 +296,7 @@ EXAMPLES
294
296
  $ hereya devenv config -w my-workspace
295
297
  ```
296
298
 
297
- _See code: [src/commands/devenv/config/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/devenv/config/index.ts)_
299
+ _See code: [src/commands/devenv/config/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/devenv/config/index.ts)_
298
300
 
299
301
  ## `hereya devenv install`
300
302
 
@@ -319,7 +321,7 @@ EXAMPLES
319
321
  $ hereya devenv install -w my-workspace -p instanceType=t3.large
320
322
  ```
321
323
 
322
- _See code: [src/commands/devenv/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/devenv/install/index.ts)_
324
+ _See code: [src/commands/devenv/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/devenv/install/index.ts)_
323
325
 
324
326
  ## `hereya devenv project init PROJECT`
325
327
 
@@ -351,7 +353,7 @@ EXAMPLES
351
353
  $ hereya devenv project init my-app -w my-workspace -t acme/node-starter -p region=us-east-1
352
354
  ```
353
355
 
354
- _See code: [src/commands/devenv/project/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/devenv/project/init/index.ts)_
356
+ _See code: [src/commands/devenv/project/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/devenv/project/init/index.ts)_
355
357
 
356
358
  ## `hereya devenv project uninit PROJECT`
357
359
 
@@ -377,7 +379,7 @@ EXAMPLES
377
379
  $ hereya devenv project uninit my-app -w my-workspace --force
378
380
  ```
379
381
 
380
- _See code: [src/commands/devenv/project/uninit/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/devenv/project/uninit/index.ts)_
382
+ _See code: [src/commands/devenv/project/uninit/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/devenv/project/uninit/index.ts)_
381
383
 
382
384
  ## `hereya devenv ssh`
383
385
 
@@ -397,7 +399,7 @@ EXAMPLES
397
399
  $ hereya devenv ssh -w my-workspace
398
400
  ```
399
401
 
400
- _See code: [src/commands/devenv/ssh/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/devenv/ssh/index.ts)_
402
+ _See code: [src/commands/devenv/ssh/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/devenv/ssh/index.ts)_
401
403
 
402
404
  ## `hereya devenv uninstall`
403
405
 
@@ -418,7 +420,7 @@ EXAMPLES
418
420
  $ hereya devenv uninstall -w my-workspace
419
421
  ```
420
422
 
421
- _See code: [src/commands/devenv/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/devenv/uninstall/index.ts)_
423
+ _See code: [src/commands/devenv/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/devenv/uninstall/index.ts)_
422
424
 
423
425
  ## `hereya doc PACKAGE`
424
426
 
@@ -451,7 +453,7 @@ EXAMPLES
451
453
  $ hereya doc my-package --no-doc
452
454
  ```
453
455
 
454
- _See code: [src/commands/doc/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/doc/index.ts)_
456
+ _See code: [src/commands/doc/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/doc/index.ts)_
455
457
 
456
458
  ## `hereya docker run IMAGE`
457
459
 
@@ -482,7 +484,7 @@ EXAMPLES
482
484
  $ hereya docker run myapp:latest -- --rm -v ./data:/data
483
485
  ```
484
486
 
485
- _See code: [src/commands/docker/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/docker/run/index.ts)_
487
+ _See code: [src/commands/docker/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/docker/run/index.ts)_
486
488
 
487
489
  ## `hereya down`
488
490
 
@@ -509,7 +511,7 @@ EXAMPLES
509
511
  $ hereya down
510
512
  ```
511
513
 
512
- _See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/down/index.ts)_
514
+ _See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/down/index.ts)_
513
515
 
514
516
  ## `hereya env [NAME]`
515
517
 
@@ -540,7 +542,7 @@ EXAMPLES
540
542
  $ hereya env -w dev -l
541
543
  ```
542
544
 
543
- _See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/env/index.ts)_
545
+ _See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/env/index.ts)_
544
546
 
545
547
  ## `hereya env set [NAME]`
546
548
 
@@ -567,7 +569,7 @@ EXAMPLES
567
569
  $ hereya env set FOO -v bar -w dev
568
570
  ```
569
571
 
570
- _See code: [src/commands/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/env/set/index.ts)_
572
+ _See code: [src/commands/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/env/set/index.ts)_
571
573
 
572
574
  ## `hereya executor start`
573
575
 
@@ -600,7 +602,7 @@ EXAMPLES
600
602
  HEREYA_TOKEN=<token> HEREYA_CLOUD_URL=https://my-cloud.example.com hereya executor start -w my-workspace
601
603
  ```
602
604
 
603
- _See code: [src/commands/executor/start/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/executor/start/index.ts)_
605
+ _See code: [src/commands/executor/start/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/executor/start/index.ts)_
604
606
 
605
607
  ## `hereya flow add PACKAGE`
606
608
 
@@ -638,7 +640,7 @@ EXAMPLES
638
640
  $ hereya flow add cloudy/docker_postgres -p DB_NAME=mydb -p DB_USER=admin
639
641
  ```
640
642
 
641
- _See code: [src/commands/flow/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/flow/add/index.ts)_
643
+ _See code: [src/commands/flow/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/flow/add/index.ts)_
642
644
 
643
645
  ## `hereya flow docker run IMAGE`
644
646
 
@@ -668,7 +670,7 @@ EXAMPLES
668
670
  $ hereya flow docker run --pin myapp:latest -- --rm
669
671
  ```
670
672
 
671
- _See code: [src/commands/flow/docker/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/flow/docker/run/index.ts)_
673
+ _See code: [src/commands/flow/docker/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/flow/docker/run/index.ts)_
672
674
 
673
675
  ## `hereya flow down`
674
676
 
@@ -702,7 +704,7 @@ EXAMPLES
702
704
  $ hereya flow down --pin
703
705
  ```
704
706
 
705
- _See code: [src/commands/flow/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/flow/down/index.ts)_
707
+ _See code: [src/commands/flow/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/flow/down/index.ts)_
706
708
 
707
709
  ## `hereya flow env [NAME]`
708
710
 
@@ -736,7 +738,7 @@ EXAMPLES
736
738
  $ hereya flow env -l
737
739
  ```
738
740
 
739
- _See code: [src/commands/flow/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/flow/env/index.ts)_
741
+ _See code: [src/commands/flow/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/flow/env/index.ts)_
740
742
 
741
743
  ## `hereya flow provid PACKAGE`
742
744
 
@@ -765,7 +767,7 @@ EXAMPLES
765
767
  $ hereya flow provid hereya/postgres --pin
766
768
  ```
767
769
 
768
- _See code: [src/commands/flow/provid/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/flow/provid/index.ts)_
770
+ _See code: [src/commands/flow/provid/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/flow/provid/index.ts)_
769
771
 
770
772
  ## `hereya flow remove PACKAGE`
771
773
 
@@ -795,7 +797,7 @@ EXAMPLES
795
797
  $ hereya flow remove cloudy/docker_postgres --profile staging
796
798
  ```
797
799
 
798
- _See code: [src/commands/flow/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/flow/remove/index.ts)_
800
+ _See code: [src/commands/flow/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/flow/remove/index.ts)_
799
801
 
800
802
  ## `hereya flow run CMD`
801
803
 
@@ -824,7 +826,7 @@ EXAMPLES
824
826
  $ hereya flow run --pin -- npm test
825
827
  ```
826
828
 
827
- _See code: [src/commands/flow/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/flow/run/index.ts)_
829
+ _See code: [src/commands/flow/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/flow/run/index.ts)_
828
830
 
829
831
  ## `hereya flow up`
830
832
 
@@ -858,7 +860,7 @@ EXAMPLES
858
860
  $ hereya flow up --pin
859
861
  ```
860
862
 
861
- _See code: [src/commands/flow/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/flow/up/index.ts)_
863
+ _See code: [src/commands/flow/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/flow/up/index.ts)_
862
864
 
863
865
  ## `hereya help [COMMAND]`
864
866
 
@@ -915,7 +917,7 @@ EXAMPLES
915
917
  $ hereya import org/my-package -f state.tfstate -w my-workspace
916
918
  ```
917
919
 
918
- _See code: [src/commands/import/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/import/index.ts)_
920
+ _See code: [src/commands/import/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/import/index.ts)_
919
921
 
920
922
  ## `hereya init PROJECT`
921
923
 
@@ -949,7 +951,7 @@ EXAMPLES
949
951
  $ hereya init myProject -w=dev -t=acme/node-starter -d=prod -p region=us-east-1
950
952
  ```
951
953
 
952
- _See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/init/index.ts)_
954
+ _See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/init/index.ts)_
953
955
 
954
956
  ## `hereya login [URL]`
955
957
 
@@ -978,7 +980,7 @@ EXAMPLES
978
980
  $ hereya login --token=your-token https://cloud.hereya.dev
979
981
  ```
980
982
 
981
- _See code: [src/commands/login/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/login/index.ts)_
983
+ _See code: [src/commands/login/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/login/index.ts)_
982
984
 
983
985
  ## `hereya logout`
984
986
 
@@ -995,7 +997,7 @@ EXAMPLES
995
997
  $ hereya logout
996
998
  ```
997
999
 
998
- _See code: [src/commands/logout/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/logout/index.ts)_
1000
+ _See code: [src/commands/logout/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/logout/index.ts)_
999
1001
 
1000
1002
  ## `hereya provid PACKAGE`
1001
1003
 
@@ -1023,7 +1025,7 @@ EXAMPLES
1023
1025
  $ hereya provid hereya/postgres --workspace staging
1024
1026
  ```
1025
1027
 
1026
- _See code: [src/commands/provid/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/provid/index.ts)_
1028
+ _See code: [src/commands/provid/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/provid/index.ts)_
1027
1029
 
1028
1030
  ## `hereya publish`
1029
1031
 
@@ -1046,7 +1048,7 @@ EXAMPLES
1046
1048
  $ hereya publish --chdir=/path/to/package
1047
1049
  ```
1048
1050
 
1049
- _See code: [src/commands/publish/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/publish/index.ts)_
1051
+ _See code: [src/commands/publish/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/publish/index.ts)_
1050
1052
 
1051
1053
  ## `hereya remove PACKAGE`
1052
1054
 
@@ -1074,7 +1076,7 @@ EXAMPLES
1074
1076
  $ hereya remove cloudy/docker_postgres
1075
1077
  ```
1076
1078
 
1077
- _See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/remove/index.ts)_
1079
+ _See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/remove/index.ts)_
1078
1080
 
1079
1081
  ## `hereya run CMD`
1080
1082
 
@@ -1100,7 +1102,7 @@ EXAMPLES
1100
1102
  $ hereya run -w uat -- node index.js
1101
1103
  ```
1102
1104
 
1103
- _See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/run/index.ts)_
1105
+ _See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/run/index.ts)_
1104
1106
 
1105
1107
  ## `hereya search QUERY`
1106
1108
 
@@ -1131,7 +1133,7 @@ EXAMPLES
1131
1133
  $ hereya search database --json
1132
1134
  ```
1133
1135
 
1134
- _See code: [src/commands/search/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/search/index.ts)_
1136
+ _See code: [src/commands/search/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/search/index.ts)_
1135
1137
 
1136
1138
  ## `hereya unbootstrap INFRASTRUCTURETYPE`
1137
1139
 
@@ -1156,7 +1158,7 @@ EXAMPLES
1156
1158
  $ hereya unbootstrap local
1157
1159
  ```
1158
1160
 
1159
- _See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/unbootstrap/index.ts)_
1161
+ _See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/unbootstrap/index.ts)_
1160
1162
 
1161
1163
  ## `hereya undeploy`
1162
1164
 
@@ -1164,7 +1166,7 @@ Undeploy a hereya project by removing all resources.
1164
1166
 
1165
1167
  ```
1166
1168
  USAGE
1167
- $ hereya undeploy -w <value> [--chdir <value>] [--debug]
1169
+ $ hereya undeploy -w <value> [--chdir <value>] [--debug] [--local]
1168
1170
 
1169
1171
  FLAGS
1170
1172
  -w, --workspace=<value> (required) name of the workspace to undeploy the packages for
@@ -1173,6 +1175,7 @@ FLAGS
1173
1175
  Alternatively, you can define the project root by setting the HEREYA_PROJECT_ROOT_DIR
1174
1176
  environment variable.
1175
1177
  --debug enable debug mode
1178
+ --local force local execution (skip remote executor)
1176
1179
 
1177
1180
  DESCRIPTION
1178
1181
  Undeploy a hereya project by removing all resources.
@@ -1181,7 +1184,7 @@ EXAMPLES
1181
1184
  $ hereya undeploy
1182
1185
  ```
1183
1186
 
1184
- _See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/undeploy/index.ts)_
1187
+ _See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/undeploy/index.ts)_
1185
1188
 
1186
1189
  ## `hereya uninit PROJECT`
1187
1190
 
@@ -1209,7 +1212,7 @@ EXAMPLES
1209
1212
  $ hereya uninit myProject -w dev -p prodWorkspace=prod
1210
1213
  ```
1211
1214
 
1212
- _See code: [src/commands/uninit/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/uninit/index.ts)_
1215
+ _See code: [src/commands/uninit/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/uninit/index.ts)_
1213
1216
 
1214
1217
  ## `hereya up`
1215
1218
 
@@ -1236,7 +1239,29 @@ EXAMPLES
1236
1239
  $ hereya up
1237
1240
  ```
1238
1241
 
1239
- _See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/up/index.ts)_
1242
+ _See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/up/index.ts)_
1243
+
1244
+ ## `hereya update [VERSION]`
1245
+
1246
+ Update hereya CLI to the latest or a specific version.
1247
+
1248
+ ```
1249
+ USAGE
1250
+ $ hereya update [VERSION]
1251
+
1252
+ ARGUMENTS
1253
+ VERSION [default: latest] version to update to
1254
+
1255
+ DESCRIPTION
1256
+ Update hereya CLI to the latest or a specific version.
1257
+
1258
+ EXAMPLES
1259
+ $ hereya update
1260
+
1261
+ $ hereya update 0.75.0
1262
+ ```
1263
+
1264
+ _See code: [src/commands/update/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/update/index.ts)_
1240
1265
 
1241
1266
  ## `hereya workspace create NAME`
1242
1267
 
@@ -1261,7 +1286,7 @@ EXAMPLES
1261
1286
  $ hereya workspace create dev
1262
1287
  ```
1263
1288
 
1264
- _See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/workspace/create/index.ts)_
1289
+ _See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/workspace/create/index.ts)_
1265
1290
 
1266
1291
  ## `hereya workspace delete NAME`
1267
1292
 
@@ -1281,7 +1306,7 @@ EXAMPLES
1281
1306
  $ hereya workspace delete dev
1282
1307
  ```
1283
1308
 
1284
- _See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/workspace/delete/index.ts)_
1309
+ _See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/workspace/delete/index.ts)_
1285
1310
 
1286
1311
  ## `hereya workspace env [NAME]`
1287
1312
 
@@ -1307,7 +1332,7 @@ EXAMPLES
1307
1332
  $ hereya workspace env myEnv -w dev
1308
1333
  ```
1309
1334
 
1310
- _See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/workspace/env/index.ts)_
1335
+ _See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/workspace/env/index.ts)_
1311
1336
 
1312
1337
  ## `hereya workspace env set`
1313
1338
 
@@ -1331,7 +1356,7 @@ EXAMPLES
1331
1356
  $ hereya workspace env set -w my-workspace -n myVar -v my-value -i aws -s
1332
1357
  ```
1333
1358
 
1334
- _See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/workspace/env/set/index.ts)_
1359
+ _See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/workspace/env/set/index.ts)_
1335
1360
 
1336
1361
  ## `hereya workspace env unset`
1337
1362
 
@@ -1352,7 +1377,7 @@ EXAMPLES
1352
1377
  $ hereya workspace env unset -w my-workspace -n myVar
1353
1378
  ```
1354
1379
 
1355
- _See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/workspace/env/unset/index.ts)_
1380
+ _See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/workspace/env/unset/index.ts)_
1356
1381
 
1357
1382
  ## `hereya workspace executor install`
1358
1383
 
@@ -1371,7 +1396,7 @@ DESCRIPTION
1371
1396
  Install a remote executor into a workspace
1372
1397
  ```
1373
1398
 
1374
- _See code: [src/commands/workspace/executor/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/workspace/executor/install/index.ts)_
1399
+ _See code: [src/commands/workspace/executor/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/workspace/executor/install/index.ts)_
1375
1400
 
1376
1401
  ## `hereya workspace executor token`
1377
1402
 
@@ -1388,7 +1413,7 @@ DESCRIPTION
1388
1413
  Generate a workspace-scoped executor token for the remote executor
1389
1414
  ```
1390
1415
 
1391
- _See code: [src/commands/workspace/executor/token/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/workspace/executor/token/index.ts)_
1416
+ _See code: [src/commands/workspace/executor/token/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/workspace/executor/token/index.ts)_
1392
1417
 
1393
1418
  ## `hereya workspace executor uninstall`
1394
1419
 
@@ -1406,7 +1431,7 @@ DESCRIPTION
1406
1431
  Uninstall the remote executor from a workspace
1407
1432
  ```
1408
1433
 
1409
- _See code: [src/commands/workspace/executor/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/workspace/executor/uninstall/index.ts)_
1434
+ _See code: [src/commands/workspace/executor/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/workspace/executor/uninstall/index.ts)_
1410
1435
 
1411
1436
  ## `hereya workspace install PACKAGE`
1412
1437
 
@@ -1433,7 +1458,7 @@ EXAMPLES
1433
1458
  $ hereya workspace install hereya/aws-cognito
1434
1459
  ```
1435
1460
 
1436
- _See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/workspace/install/index.ts)_
1461
+ _See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/workspace/install/index.ts)_
1437
1462
 
1438
1463
  ## `hereya workspace list`
1439
1464
 
@@ -1457,7 +1482,7 @@ EXAMPLES
1457
1482
  $ hereya workspace list --org personal
1458
1483
  ```
1459
1484
 
1460
- _See code: [src/commands/workspace/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/workspace/list/index.ts)_
1485
+ _See code: [src/commands/workspace/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/workspace/list/index.ts)_
1461
1486
 
1462
1487
  ## `hereya workspace set-profile PROFILE`
1463
1488
 
@@ -1481,7 +1506,7 @@ EXAMPLES
1481
1506
  $ hereya workspace set-profile prod-profile -w production
1482
1507
  ```
1483
1508
 
1484
- _See code: [src/commands/workspace/set-profile/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/workspace/set-profile/index.ts)_
1509
+ _See code: [src/commands/workspace/set-profile/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/workspace/set-profile/index.ts)_
1485
1510
 
1486
1511
  ## `hereya workspace uninstall PACKAGE`
1487
1512
 
@@ -1508,5 +1533,5 @@ EXAMPLES
1508
1533
  $ hereya workspace uninstall hereya/aws-cognito
1509
1534
  ```
1510
1535
 
1511
- _See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.74.0/src/commands/workspace/uninstall/index.ts)_
1536
+ _See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.76.0/src/commands/workspace/uninstall/index.ts)_
1512
1537
  <!-- commandsstop -->
@@ -84,7 +84,7 @@ export declare class CloudBackend implements Backend {
84
84
  setEnvVar(input: SetEnvVarInput): Promise<SetEnvVarOutput>;
85
85
  submitExecutorJob(input: {
86
86
  payload: object;
87
- type: 'destroy' | 'provision' | 'resolve-env';
87
+ type: 'deploy' | 'destroy' | 'provision' | 'resolve-env' | 'undeploy';
88
88
  workspace: string;
89
89
  }): Promise<{
90
90
  jobId: string;
@@ -5,7 +5,9 @@ export default class Deploy extends Command {
5
5
  static flags: {
6
6
  chdir: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
7
  debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
+ local: import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
9
  workspace: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
10
  };
10
11
  run(): Promise<void>;
12
+ private deployRemotely;
11
13
  }
@@ -1,14 +1,19 @@
1
1
  import { Command, Flags } from '@oclif/core';
2
2
  import { getRendererClass, Listr, ListrLogger, ListrLogLevels } from 'listr2';
3
3
  import path from 'node:path';
4
+ import { CloudBackend } from '../../backend/cloud/cloud-backend.js';
5
+ import { getCloudCredentials, loadBackendConfig } from '../../backend/config.js';
4
6
  import { getBackend } from '../../backend/index.js';
5
7
  import { getExecutor } from '../../executor/index.js';
6
8
  import { getConfigManager } from '../../lib/config/index.js';
7
9
  import { getEnvManager } from '../../lib/env/index.js';
10
+ import { gitUtils } from '../../lib/git-utils.js';
8
11
  import { getLogger, getLogPath, isDebug, setDebug } from '../../lib/log.js';
9
12
  import { getParameterManager } from '../../lib/parameter/index.js';
10
13
  import { getProfileFromWorkspace } from '../../lib/profile-utils.js';
11
- import { delay } from '../../lib/shell.js';
14
+ import { pollExecutorJob } from '../../lib/remote-job-utils.js';
15
+ import { delay, runShell } from '../../lib/shell.js';
16
+ import { resolveWorkspaceName } from '../../lib/workspace-utils.js';
12
17
  import { validateDeploymentWorkspace } from '../../lib/workspace-validation.js';
13
18
  export default class Deploy extends Command {
14
19
  static description = 'Deploy a hereya project using the project deployment package';
@@ -26,6 +31,10 @@ export default class Deploy extends Command {
26
31
  default: false,
27
32
  description: 'enable debug mode',
28
33
  }),
34
+ local: Flags.boolean({
35
+ default: false,
36
+ description: 'force local execution (skip remote executor)',
37
+ }),
29
38
  workspace: Flags.string({
30
39
  char: 'w',
31
40
  description: 'name of the workspace to deploy the packages for',
@@ -48,6 +57,24 @@ export default class Deploy extends Command {
48
57
  if (!validation.isValid) {
49
58
  this.error(validation.message);
50
59
  }
60
+ const forceLocal = flags.local || process.env.HEREYA_LOCAL_EXECUTION === 'true';
61
+ if (!forceLocal) {
62
+ // Check remote deployment conditions
63
+ const resolvedWorkspaceName = resolveWorkspaceName(flags.workspace, loadConfigOutput.config.project);
64
+ const workspace$ = await backend.getWorkspace(resolvedWorkspaceName);
65
+ const metadata$ = await backend.getProjectMetadata?.({ project: loadConfigOutput.config.project });
66
+ const hasRemoteGit = metadata$?.found && metadata$.metadata.env?.hereyaGitRemoteUrl;
67
+ const hasRemoteExecutor = workspace$.found && !workspace$.hasError && workspace$.workspace.hasExecutor;
68
+ if (hasRemoteExecutor && hasRemoteGit) {
69
+ await this.deployRemotely({
70
+ gitBranch: await gitUtils.getCurrentGitBranch(projectRootDir),
71
+ project: loadConfigOutput.config.project,
72
+ projectRootDir,
73
+ workspace: flags.workspace,
74
+ });
75
+ return;
76
+ }
77
+ }
51
78
  const myLogger = new ListrLogger({ useIcons: false });
52
79
  const task = new Listr([
53
80
  {
@@ -73,6 +100,14 @@ export default class Deploy extends Command {
73
100
  },
74
101
  title: 'Loading project config',
75
102
  },
103
+ {
104
+ skip: (ctx) => !ctx.configOutput.config.preDeployCommand,
105
+ async task(ctx) {
106
+ const command = ctx.configOutput.config.preDeployCommand;
107
+ await runShell('sh', ['-c', command], { directory: projectRootDir });
108
+ },
109
+ title: 'Running pre-deploy command',
110
+ },
76
111
  {
77
112
  async task(ctx) {
78
113
  const backend = await getBackend();
@@ -415,4 +450,58 @@ export default class Deploy extends Command {
415
450
  See ${getLogPath()} for more details`);
416
451
  }
417
452
  }
453
+ async deployRemotely(input) {
454
+ const myLogger = new ListrLogger({ useIcons: false });
455
+ // 1. Ensure clean working tree
456
+ const cleanCheck = await gitUtils.ensureCleanAndPushed({ cwd: input.projectRootDir });
457
+ if (!cleanCheck.clean) {
458
+ this.error(cleanCheck.reason);
459
+ }
460
+ myLogger.log(ListrLogLevels.STARTED, `Deploying to ${input.workspace} via remote executor (branch: ${input.gitBranch})`);
461
+ // 2. Get cloud backend for job submission
462
+ const backendConfig = await loadBackendConfig();
463
+ if (!backendConfig.cloud) {
464
+ this.error('Remote deployment requires cloud backend. Run `hereya login` first.');
465
+ }
466
+ const credentials = await getCloudCredentials(backendConfig.cloud.clientId);
467
+ if (!credentials) {
468
+ this.error('Cloud credentials not found. Run `hereya login` first.');
469
+ }
470
+ const resolvedWorkspaceName = resolveWorkspaceName(input.workspace, input.project);
471
+ const cloudBackend = new CloudBackend({
472
+ accessToken: credentials.accessToken,
473
+ clientId: backendConfig.cloud.clientId,
474
+ refreshToken: credentials.refreshToken,
475
+ url: backendConfig.cloud.url,
476
+ });
477
+ // 3. Submit deploy job
478
+ const submitResult = await cloudBackend.submitExecutorJob({
479
+ payload: {
480
+ gitBranch: input.gitBranch,
481
+ project: input.project,
482
+ workspace: input.workspace,
483
+ },
484
+ type: 'deploy',
485
+ workspace: resolvedWorkspaceName,
486
+ });
487
+ if (!submitResult.success) {
488
+ this.error(`Failed to submit remote deploy job: ${submitResult.reason}`);
489
+ }
490
+ // 4. Poll for results
491
+ const logger = {
492
+ debug: (msg) => myLogger.log(ListrLogLevels.OUTPUT, msg),
493
+ error: (msg) => myLogger.log(ListrLogLevels.OUTPUT, msg),
494
+ info: (msg) => myLogger.log(ListrLogLevels.OUTPUT, msg),
495
+ };
496
+ const pollResult = await pollExecutorJob({
497
+ cloudBackend,
498
+ jobId: submitResult.jobId,
499
+ logger,
500
+ workspace: resolvedWorkspaceName,
501
+ });
502
+ if (!pollResult.success) {
503
+ this.error(pollResult.reason);
504
+ }
505
+ myLogger.log(ListrLogLevels.COMPLETED, 'Remote deployment completed successfully');
506
+ }
418
507
  }
@@ -5,7 +5,9 @@ export default class Undeploy extends Command {
5
5
  static flags: {
6
6
  chdir: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
7
  debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
+ local: import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
9
  workspace: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
10
  };
10
11
  run(): Promise<void>;
12
+ private undeployRemotely;
11
13
  }
@@ -1,14 +1,19 @@
1
1
  import { Command, Flags } from '@oclif/core';
2
2
  import { getRendererClass, Listr, ListrLogger, ListrLogLevels } from 'listr2';
3
3
  import path from 'node:path';
4
+ import { CloudBackend } from '../../backend/cloud/cloud-backend.js';
5
+ import { getCloudCredentials, loadBackendConfig } from '../../backend/config.js';
4
6
  import { getBackend } from '../../backend/index.js';
5
7
  import { getExecutor } from '../../executor/index.js';
6
8
  import { getConfigManager } from '../../lib/config/index.js';
7
9
  import { getEnvManager } from '../../lib/env/index.js';
10
+ import { gitUtils } from '../../lib/git-utils.js';
8
11
  import { getLogger, getLogPath, isDebug, setDebug } from '../../lib/log.js';
9
12
  import { getParameterManager } from '../../lib/parameter/index.js';
10
13
  import { getProfileFromWorkspace } from '../../lib/profile-utils.js';
14
+ import { pollExecutorJob } from '../../lib/remote-job-utils.js';
11
15
  import { delay } from '../../lib/shell.js';
16
+ import { resolveWorkspaceName } from '../../lib/workspace-utils.js';
12
17
  import { validateDeploymentWorkspace } from '../../lib/workspace-validation.js';
13
18
  export default class Undeploy extends Command {
14
19
  static description = 'Undeploy a hereya project by removing all resources.';
@@ -26,6 +31,10 @@ export default class Undeploy extends Command {
26
31
  default: false,
27
32
  description: 'enable debug mode',
28
33
  }),
34
+ local: Flags.boolean({
35
+ default: false,
36
+ description: 'force local execution (skip remote executor)',
37
+ }),
29
38
  workspace: Flags.string({
30
39
  char: 'w',
31
40
  description: 'name of the workspace to undeploy the packages for',
@@ -48,6 +57,24 @@ export default class Undeploy extends Command {
48
57
  if (!validation.isValid) {
49
58
  this.error(validation.message);
50
59
  }
60
+ const forceLocal = flags.local || process.env.HEREYA_LOCAL_EXECUTION === 'true';
61
+ if (!forceLocal) {
62
+ // Check remote undeployment conditions
63
+ const resolvedWorkspaceName = resolveWorkspaceName(flags.workspace, loadConfigOutput.config.project);
64
+ const workspace$ = await backend.getWorkspace(resolvedWorkspaceName);
65
+ const metadata$ = await backend.getProjectMetadata?.({ project: loadConfigOutput.config.project });
66
+ const hasRemoteGit = metadata$?.found && metadata$.metadata.env?.hereyaGitRemoteUrl;
67
+ const hasRemoteExecutor = workspace$.found && !workspace$.hasError && workspace$.workspace.hasExecutor;
68
+ if (hasRemoteExecutor && hasRemoteGit) {
69
+ await this.undeployRemotely({
70
+ gitBranch: await gitUtils.getCurrentGitBranch(projectRootDir),
71
+ project: loadConfigOutput.config.project,
72
+ projectRootDir,
73
+ workspace: flags.workspace,
74
+ });
75
+ return;
76
+ }
77
+ }
51
78
  const myLogger = new ListrLogger({ useIcons: false });
52
79
  const task = new Listr([
53
80
  {
@@ -277,4 +304,58 @@ export default class Undeploy extends Command {
277
304
  See ${getLogPath()} for more details`);
278
305
  }
279
306
  }
307
+ async undeployRemotely(input) {
308
+ const myLogger = new ListrLogger({ useIcons: false });
309
+ // 1. Ensure clean working tree
310
+ const cleanCheck = await gitUtils.ensureCleanAndPushed({ cwd: input.projectRootDir });
311
+ if (!cleanCheck.clean) {
312
+ this.error(cleanCheck.reason);
313
+ }
314
+ myLogger.log(ListrLogLevels.STARTED, `Undeploying ${input.workspace} via remote executor (branch: ${input.gitBranch})`);
315
+ // 2. Get cloud backend for job submission
316
+ const backendConfig = await loadBackendConfig();
317
+ if (!backendConfig.cloud) {
318
+ this.error('Remote undeployment requires cloud backend. Run `hereya login` first.');
319
+ }
320
+ const credentials = await getCloudCredentials(backendConfig.cloud.clientId);
321
+ if (!credentials) {
322
+ this.error('Cloud credentials not found. Run `hereya login` first.');
323
+ }
324
+ const resolvedWorkspaceName = resolveWorkspaceName(input.workspace, input.project);
325
+ const cloudBackend = new CloudBackend({
326
+ accessToken: credentials.accessToken,
327
+ clientId: backendConfig.cloud.clientId,
328
+ refreshToken: credentials.refreshToken,
329
+ url: backendConfig.cloud.url,
330
+ });
331
+ // 3. Submit undeploy job
332
+ const submitResult = await cloudBackend.submitExecutorJob({
333
+ payload: {
334
+ gitBranch: input.gitBranch,
335
+ project: input.project,
336
+ workspace: input.workspace,
337
+ },
338
+ type: 'undeploy',
339
+ workspace: resolvedWorkspaceName,
340
+ });
341
+ if (!submitResult.success) {
342
+ this.error(`Failed to submit remote undeploy job: ${submitResult.reason}`);
343
+ }
344
+ // 4. Poll for results
345
+ const logger = {
346
+ debug: (msg) => myLogger.log(ListrLogLevels.OUTPUT, msg),
347
+ error: (msg) => myLogger.log(ListrLogLevels.OUTPUT, msg),
348
+ info: (msg) => myLogger.log(ListrLogLevels.OUTPUT, msg),
349
+ };
350
+ const pollResult = await pollExecutorJob({
351
+ cloudBackend,
352
+ jobId: submitResult.jobId,
353
+ logger,
354
+ workspace: resolvedWorkspaceName,
355
+ });
356
+ if (!pollResult.success) {
357
+ this.error(pollResult.reason);
358
+ }
359
+ myLogger.log(ListrLogLevels.COMPLETED, 'Remote undeployment completed successfully');
360
+ }
280
361
  }
@@ -0,0 +1,9 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class Update extends Command {
3
+ static args: {
4
+ version: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ run(): Promise<void>;
9
+ }
@@ -0,0 +1,38 @@
1
+ import { Args, Command } from '@oclif/core';
2
+ import { shellUtils } from '../../lib/shell.js';
3
+ export default class Update extends Command {
4
+ static args = {
5
+ version: Args.string({
6
+ default: 'latest',
7
+ description: 'version to update to',
8
+ required: false,
9
+ }),
10
+ };
11
+ static description = 'Update hereya CLI to the latest or a specific version.';
12
+ static examples = [
13
+ '<%= config.bin %> <%= command.id %>',
14
+ '<%= config.bin %> <%= command.id %> 0.75.0',
15
+ ];
16
+ async run() {
17
+ const { args } = await this.parse(Update);
18
+ const target = args.version;
19
+ const currentVersion = this.config.version;
20
+ this.log(`Current version: ${currentVersion}`);
21
+ this.log(`Updating to ${target}...`);
22
+ try {
23
+ await shellUtils.runShell('npm', ['install', '-g', `hereya-cli@${target}`]);
24
+ // Get the new version after install
25
+ const { stdout } = await shellUtils.runShell('hereya', ['--version']);
26
+ const newVersion = stdout.trim();
27
+ if (newVersion === currentVersion && target === 'latest') {
28
+ this.log(`Already at the latest version (${currentVersion}).`);
29
+ }
30
+ else {
31
+ this.log(`Updated to ${newVersion}.`);
32
+ }
33
+ }
34
+ catch (error) {
35
+ this.error(`Failed to update: ${error.message}`);
36
+ }
37
+ }
38
+ }
@@ -1,3 +1,4 @@
1
+ import { pollExecutorJob } from '../lib/remote-job-utils.js';
1
2
  import { LocalExecutor } from './local.js';
2
3
  export class RemoteExecutor {
3
4
  cloudBackend;
@@ -70,51 +71,16 @@ export class RemoteExecutor {
70
71
  return { reason: `Failed to submit remote executor job: ${submitResult.reason}`, success: false };
71
72
  }
72
73
  const { jobId } = submitResult;
73
- input.logger?.info?.(`Remote executor job submitted (${jobId}). Waiting for result...`);
74
- // Poll for result
75
- const timeout = 10 * 60 * 1000; // 10 minutes
76
- const startTime = Date.now();
77
- let lastLogLength = 0;
78
- let lastStatus = 'pending';
79
- while (Date.now() - startTime < timeout) {
80
- // eslint-disable-next-line no-await-in-loop
81
- const statusResult = await this.cloudBackend.getExecutorJobStatus({
82
- jobId,
83
- lastStatus,
84
- poll: true,
85
- workspace: this.workspace,
86
- });
87
- if (!statusResult.success) {
88
- return { reason: `Failed to get job status: ${statusResult.reason}`, success: false };
89
- }
90
- const { job } = statusResult;
91
- lastStatus = job.status;
92
- // Forward new logs
93
- if (job.logs && job.logs.length > lastLogLength) {
94
- const newLogs = job.logs.slice(lastLogLength);
95
- if (newLogs.trim()) {
96
- input.logger?.info?.(newLogs);
97
- }
98
- lastLogLength = job.logs.length;
99
- }
100
- // Check if job is done
101
- if (job.status === 'completed') {
102
- if (job.result) {
103
- return job.result;
104
- }
105
- return { reason: 'Job completed but no result returned', success: false };
106
- }
107
- if (job.status === 'failed') {
108
- const reason = job.result?.reason || 'Remote executor job failed';
109
- return { reason, success: false };
110
- }
111
- // Small delay between polls (server-side long polling handles most of the wait)
112
- // eslint-disable-next-line no-await-in-loop
113
- await new Promise(resolve => {
114
- setTimeout(resolve, 1000);
115
- });
74
+ const pollResult = await pollExecutorJob({
75
+ cloudBackend: this.cloudBackend,
76
+ jobId,
77
+ logger: input.logger,
78
+ workspace: this.workspace,
79
+ });
80
+ if (!pollResult.success) {
81
+ return { reason: pollResult.reason, success: false };
116
82
  }
117
- return { reason: 'Remote executor job timed out after 10 minutes', success: false };
83
+ return pollResult.result;
118
84
  }
119
85
  async resolveEnvRemotely(env, markSecret) {
120
86
  const submitResult = await this.cloudBackend.submitExecutorJob({
@@ -35,6 +35,7 @@ export interface Config {
35
35
  version: string;
36
36
  };
37
37
  };
38
+ preDeployCommand?: string;
38
39
  project: string;
39
40
  workspace: string;
40
41
  }
@@ -3,6 +3,18 @@ export declare const gitUtils: {
3
3
  * Clones a git repository using the hereya credential helper.
4
4
  */
5
5
  cloneWithCredentialHelper(input: CloneWithCredentialHelperInput): Promise<CloneOutput>;
6
+ /**
7
+ * Checks that the working tree is clean and all commits are pushed.
8
+ * Returns { clean: true } if ready, or { clean: false, reason } with an explanation.
9
+ */
10
+ ensureCleanAndPushed(input: {
11
+ cwd?: string;
12
+ }): Promise<{
13
+ clean: false;
14
+ reason: string;
15
+ } | {
16
+ clean: true;
17
+ }>;
6
18
  /**
7
19
  * Gets the current git branch name.
8
20
  * @param cwd The working directory to execute git command in
@@ -7,6 +7,33 @@ export const gitUtils = {
7
7
  async cloneWithCredentialHelper(input) {
8
8
  return cloneWithCredentialHelper(input);
9
9
  },
10
+ /**
11
+ * Checks that the working tree is clean and all commits are pushed.
12
+ * Returns { clean: true } if ready, or { clean: false, reason } with an explanation.
13
+ */
14
+ async ensureCleanAndPushed(input) {
15
+ // Check for uncommitted/unstaged changes
16
+ try {
17
+ const { stdout: status } = await runShell('git', ['status', '--porcelain'], { directory: input.cwd });
18
+ if (status.trim()) {
19
+ return { clean: false, reason: 'Uncommitted changes detected. Commit and push before deploying.' };
20
+ }
21
+ }
22
+ catch (error) {
23
+ return { clean: false, reason: `Failed to check git status: ${error.message}` };
24
+ }
25
+ // Check for unpushed commits
26
+ try {
27
+ const { stdout: unpushed } = await runShell('git', ['log', '@{u}..', '--oneline'], { directory: input.cwd });
28
+ if (unpushed.trim()) {
29
+ return { clean: false, reason: 'Unpushed commits detected. Push before deploying.' };
30
+ }
31
+ }
32
+ catch {
33
+ // If no upstream is set, we can't check — that's fine for local-only repos
34
+ }
35
+ return { clean: true };
36
+ },
10
37
  /**
11
38
  * Gets the current git branch name.
12
39
  * @param cwd The working directory to execute git command in
@@ -0,0 +1,16 @@
1
+ import { CloudBackend } from '../backend/cloud/cloud-backend.js';
2
+ import { Logger } from './log.js';
3
+ export type PollJobResult = {
4
+ reason: string;
5
+ success: false;
6
+ } | {
7
+ result: any;
8
+ success: true;
9
+ };
10
+ export declare function pollExecutorJob(input: {
11
+ cloudBackend: CloudBackend;
12
+ jobId: string;
13
+ logger?: Logger;
14
+ timeoutMs?: number;
15
+ workspace: string;
16
+ }): Promise<PollJobResult>;
@@ -0,0 +1,45 @@
1
+ export async function pollExecutorJob(input) {
2
+ const { cloudBackend, jobId, logger, workspace } = input;
3
+ const timeout = input.timeoutMs ?? 10 * 60 * 1000;
4
+ logger?.info?.(`Remote executor job submitted (${jobId}). Waiting for result...`);
5
+ const startTime = Date.now();
6
+ let lastLogLength = 0;
7
+ let lastStatus = 'pending';
8
+ while (Date.now() - startTime < timeout) {
9
+ // eslint-disable-next-line no-await-in-loop
10
+ const statusResult = await cloudBackend.getExecutorJobStatus({
11
+ jobId,
12
+ lastStatus,
13
+ poll: true,
14
+ workspace,
15
+ });
16
+ if (!statusResult.success) {
17
+ return { reason: `Failed to get job status: ${statusResult.reason}`, success: false };
18
+ }
19
+ const { job } = statusResult;
20
+ lastStatus = job.status;
21
+ if (job.logs && job.logs.length > lastLogLength) {
22
+ const newLogs = job.logs.slice(lastLogLength);
23
+ if (newLogs.trim()) {
24
+ logger?.info?.(newLogs);
25
+ }
26
+ lastLogLength = job.logs.length;
27
+ }
28
+ if (job.status === 'completed') {
29
+ if (job.result) {
30
+ return { result: job.result, success: true };
31
+ }
32
+ return { reason: 'Job completed but no result returned', success: false };
33
+ }
34
+ if (job.status === 'failed') {
35
+ const reason = job.result?.reason || 'Remote executor job failed';
36
+ return { reason, success: false };
37
+ }
38
+ // Small delay between polls (server-side long polling handles most of the wait)
39
+ // eslint-disable-next-line no-await-in-loop
40
+ await new Promise(resolve => {
41
+ setTimeout(resolve, 1000);
42
+ });
43
+ }
44
+ return { reason: `Remote executor job timed out after ${Math.round(timeout / 60_000)} minutes`, success: false };
45
+ }
@@ -13,4 +13,7 @@ export declare function runShell(cmd: string, args: string[], options?: RunShell
13
13
  stderr: string;
14
14
  stdout: string;
15
15
  }>;
16
+ export declare const shellUtils: {
17
+ runShell: typeof runShell;
18
+ };
16
19
  export declare function delay(ms: number): Promise<unknown> | undefined;
package/dist/lib/shell.js CHANGED
@@ -57,6 +57,10 @@ export async function runShell(cmd, args, options = {}) {
57
57
  });
58
58
  });
59
59
  }
60
+ // Stubbable wrapper around runShell for use in tests.
61
+ export const shellUtils = {
62
+ runShell,
63
+ };
60
64
  export function delay(ms) {
61
65
  if (process.env.NODE_ENV === 'test') {
62
66
  return;
@@ -102,34 +102,6 @@
102
102
  "index.js"
103
103
  ]
104
104
  },
105
- "credential-helper": {
106
- "aliases": [],
107
- "args": {
108
- "operation": {
109
- "description": "Git credential operation (get, store, erase)",
110
- "name": "operation",
111
- "required": true
112
- }
113
- },
114
- "description": "Git credential helper for hereya-managed repositories",
115
- "flags": {},
116
- "hasDynamicHelp": false,
117
- "hidden": true,
118
- "hiddenAliases": [],
119
- "id": "credential-helper",
120
- "pluginAlias": "hereya-cli",
121
- "pluginName": "hereya-cli",
122
- "pluginType": "core",
123
- "strict": true,
124
- "enableJsonFlag": false,
125
- "isESM": true,
126
- "relativePath": [
127
- "dist",
128
- "commands",
129
- "credential-helper",
130
- "index.js"
131
- ]
132
- },
133
105
  "delete-state": {
134
106
  "aliases": [],
135
107
  "args": {},
@@ -173,6 +145,34 @@
173
145
  "index.js"
174
146
  ]
175
147
  },
148
+ "credential-helper": {
149
+ "aliases": [],
150
+ "args": {
151
+ "operation": {
152
+ "description": "Git credential operation (get, store, erase)",
153
+ "name": "operation",
154
+ "required": true
155
+ }
156
+ },
157
+ "description": "Git credential helper for hereya-managed repositories",
158
+ "flags": {},
159
+ "hasDynamicHelp": false,
160
+ "hidden": true,
161
+ "hiddenAliases": [],
162
+ "id": "credential-helper",
163
+ "pluginAlias": "hereya-cli",
164
+ "pluginName": "hereya-cli",
165
+ "pluginType": "core",
166
+ "strict": true,
167
+ "enableJsonFlag": false,
168
+ "isESM": true,
169
+ "relativePath": [
170
+ "dist",
171
+ "commands",
172
+ "credential-helper",
173
+ "index.js"
174
+ ]
175
+ },
176
176
  "deploy": {
177
177
  "aliases": [],
178
178
  "args": {},
@@ -195,6 +195,12 @@
195
195
  "allowNo": false,
196
196
  "type": "boolean"
197
197
  },
198
+ "local": {
199
+ "description": "force local execution (skip remote executor)",
200
+ "name": "local",
201
+ "allowNo": false,
202
+ "type": "boolean"
203
+ },
198
204
  "workspace": {
199
205
  "char": "w",
200
206
  "description": "name of the workspace to deploy the packages for",
@@ -929,6 +935,12 @@
929
935
  "allowNo": false,
930
936
  "type": "boolean"
931
937
  },
938
+ "local": {
939
+ "description": "force local execution (skip remote executor)",
940
+ "name": "local",
941
+ "allowNo": false,
942
+ "type": "boolean"
943
+ },
932
944
  "workspace": {
933
945
  "char": "w",
934
946
  "description": "name of the workspace to undeploy the packages for",
@@ -1077,6 +1089,38 @@
1077
1089
  "index.js"
1078
1090
  ]
1079
1091
  },
1092
+ "update": {
1093
+ "aliases": [],
1094
+ "args": {
1095
+ "version": {
1096
+ "default": "latest",
1097
+ "description": "version to update to",
1098
+ "name": "version",
1099
+ "required": false
1100
+ }
1101
+ },
1102
+ "description": "Update hereya CLI to the latest or a specific version.",
1103
+ "examples": [
1104
+ "<%= config.bin %> <%= command.id %>",
1105
+ "<%= config.bin %> <%= command.id %> 0.75.0"
1106
+ ],
1107
+ "flags": {},
1108
+ "hasDynamicHelp": false,
1109
+ "hiddenAliases": [],
1110
+ "id": "update",
1111
+ "pluginAlias": "hereya-cli",
1112
+ "pluginName": "hereya-cli",
1113
+ "pluginType": "core",
1114
+ "strict": true,
1115
+ "enableJsonFlag": false,
1116
+ "isESM": true,
1117
+ "relativePath": [
1118
+ "dist",
1119
+ "commands",
1120
+ "update",
1121
+ "index.js"
1122
+ ]
1123
+ },
1080
1124
  "config:export-backend": {
1081
1125
  "aliases": [],
1082
1126
  "args": {
@@ -2773,5 +2817,5 @@
2773
2817
  ]
2774
2818
  }
2775
2819
  },
2776
- "version": "0.74.0"
2820
+ "version": "0.76.0"
2777
2821
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hereya-cli",
3
3
  "description": "Infrastructure as Package",
4
- "version": "0.74.0",
4
+ "version": "0.76.0",
5
5
  "author": "Hereya Developers",
6
6
  "bin": {
7
7
  "hereya": "./bin/run.js"