hereya-cli 0.93.0 → 0.93.2

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.93.0 linux-x64 node-v24.14.1
24
+ hereya-cli/0.93.2 linux-x64 node-v24.14.1
25
25
  $ hereya --help [COMMAND]
26
26
  USAGE
27
27
  $ hereya COMMAND
@@ -129,7 +129,7 @@ EXAMPLES
129
129
  $ hereya add cloudy/docker_postgres
130
130
  ```
131
131
 
132
- _See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/add/index.ts)_
132
+ _See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/add/index.ts)_
133
133
 
134
134
  ## `hereya app deploy NAME`
135
135
 
@@ -163,7 +163,7 @@ EXAMPLES
163
163
  $ hereya app deploy my-org/my-app -w prod -p organizationId=org-123
164
164
  ```
165
165
 
166
- _See code: [src/commands/app/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/app/deploy/index.ts)_
166
+ _See code: [src/commands/app/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/app/deploy/index.ts)_
167
167
 
168
168
  ## `hereya app deployments NAME`
169
169
 
@@ -183,7 +183,7 @@ EXAMPLES
183
183
  $ hereya app deployments my-org/my-app
184
184
  ```
185
185
 
186
- _See code: [src/commands/app/deployments/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/app/deployments/index.ts)_
186
+ _See code: [src/commands/app/deployments/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/app/deployments/index.ts)_
187
187
 
188
188
  ## `hereya app destroy NAME`
189
189
 
@@ -212,7 +212,7 @@ EXAMPLES
212
212
  $ hereya app destroy my-org/my-app -w my-workspace
213
213
  ```
214
214
 
215
- _See code: [src/commands/app/destroy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/app/destroy/index.ts)_
215
+ _See code: [src/commands/app/destroy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/app/destroy/index.ts)_
216
216
 
217
217
  ## `hereya app env NAME [KEY]`
218
218
 
@@ -238,7 +238,7 @@ EXAMPLES
238
238
  $ hereya app env my-org/my-app -w my-workspace DATABASE_URL
239
239
  ```
240
240
 
241
- _See code: [src/commands/app/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/app/env/index.ts)_
241
+ _See code: [src/commands/app/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/app/env/index.ts)_
242
242
 
243
243
  ## `hereya app list`
244
244
 
@@ -255,7 +255,7 @@ EXAMPLES
255
255
  $ hereya app list
256
256
  ```
257
257
 
258
- _See code: [src/commands/app/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/app/list/index.ts)_
258
+ _See code: [src/commands/app/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/app/list/index.ts)_
259
259
 
260
260
  ## `hereya app new DIRNAME`
261
261
 
@@ -281,7 +281,7 @@ EXAMPLES
281
281
  $ hereya app new ./my-app -n my-org/my-app --description "An ai-app-builder app"
282
282
  ```
283
283
 
284
- _See code: [src/commands/app/new/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/app/new/index.ts)_
284
+ _See code: [src/commands/app/new/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/app/new/index.ts)_
285
285
 
286
286
  ## `hereya app status NAME`
287
287
 
@@ -304,7 +304,7 @@ EXAMPLES
304
304
  $ hereya app status my-org/my-app -w my-workspace
305
305
  ```
306
306
 
307
- _See code: [src/commands/app/status/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/app/status/index.ts)_
307
+ _See code: [src/commands/app/status/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/app/status/index.ts)_
308
308
 
309
309
  ## `hereya bootstrap INFRASTRUCTURETYPE`
310
310
 
@@ -329,7 +329,7 @@ EXAMPLES
329
329
  $ hereya bootstrap local
330
330
  ```
331
331
 
332
- _See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/bootstrap/index.ts)_
332
+ _See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/bootstrap/index.ts)_
333
333
 
334
334
  ## `hereya clone PROJECT`
335
335
 
@@ -354,7 +354,7 @@ EXAMPLES
354
354
  $ hereya clone myProject --chdir=./myProject
355
355
  ```
356
356
 
357
- _See code: [src/commands/clone/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/clone/index.ts)_
357
+ _See code: [src/commands/clone/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/clone/index.ts)_
358
358
 
359
359
  ## `hereya config export-backend [FILE]`
360
360
 
@@ -376,7 +376,7 @@ EXAMPLES
376
376
  $ hereya config export-backend ./path/to/export.json
377
377
  ```
378
378
 
379
- _See code: [src/commands/config/export-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/config/export-backend/index.ts)_
379
+ _See code: [src/commands/config/export-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/config/export-backend/index.ts)_
380
380
 
381
381
  ## `hereya config get-backend`
382
382
 
@@ -393,7 +393,7 @@ EXAMPLES
393
393
  $ hereya config get-backend
394
394
  ```
395
395
 
396
- _See code: [src/commands/config/get-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/config/get-backend/index.ts)_
396
+ _See code: [src/commands/config/get-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/config/get-backend/index.ts)_
397
397
 
398
398
  ## `hereya config import-backend FILE`
399
399
 
@@ -413,7 +413,7 @@ EXAMPLES
413
413
  $ hereya config import-backend ./path/to/cloud-backend.json
414
414
  ```
415
415
 
416
- _See code: [src/commands/config/import-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/config/import-backend/index.ts)_
416
+ _See code: [src/commands/config/import-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/config/import-backend/index.ts)_
417
417
 
418
418
  ## `hereya config use-backend TYPE`
419
419
 
@@ -435,7 +435,7 @@ EXAMPLES
435
435
  $ hereya config use-backend local
436
436
  ```
437
437
 
438
- _See code: [src/commands/config/use-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/config/use-backend/index.ts)_
438
+ _See code: [src/commands/config/use-backend/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/config/use-backend/index.ts)_
439
439
 
440
440
  ## `hereya delete-state`
441
441
 
@@ -461,7 +461,7 @@ EXAMPLES
461
461
  $ hereya delete-state --workspace staging
462
462
  ```
463
463
 
464
- _See code: [src/commands/delete-state/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/delete-state/index.ts)_
464
+ _See code: [src/commands/delete-state/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/delete-state/index.ts)_
465
465
 
466
466
  ## `hereya deploy`
467
467
 
@@ -487,7 +487,7 @@ EXAMPLES
487
487
  $ hereya deploy
488
488
  ```
489
489
 
490
- _See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/deploy/index.ts)_
490
+ _See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/deploy/index.ts)_
491
491
 
492
492
  ## `hereya devenv config`
493
493
 
@@ -507,7 +507,7 @@ EXAMPLES
507
507
  $ hereya devenv config -w my-workspace
508
508
  ```
509
509
 
510
- _See code: [src/commands/devenv/config/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/devenv/config/index.ts)_
510
+ _See code: [src/commands/devenv/config/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/devenv/config/index.ts)_
511
511
 
512
512
  ## `hereya devenv install`
513
513
 
@@ -532,7 +532,7 @@ EXAMPLES
532
532
  $ hereya devenv install -w my-workspace -p instanceType=t3.large
533
533
  ```
534
534
 
535
- _See code: [src/commands/devenv/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/devenv/install/index.ts)_
535
+ _See code: [src/commands/devenv/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/devenv/install/index.ts)_
536
536
 
537
537
  ## `hereya devenv project init PROJECT`
538
538
 
@@ -564,7 +564,7 @@ EXAMPLES
564
564
  $ hereya devenv project init my-app -w my-workspace -t acme/node-starter -p region=us-east-1
565
565
  ```
566
566
 
567
- _See code: [src/commands/devenv/project/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/devenv/project/init/index.ts)_
567
+ _See code: [src/commands/devenv/project/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/devenv/project/init/index.ts)_
568
568
 
569
569
  ## `hereya devenv project uninit PROJECT`
570
570
 
@@ -590,7 +590,7 @@ EXAMPLES
590
590
  $ hereya devenv project uninit my-app -w my-workspace --force
591
591
  ```
592
592
 
593
- _See code: [src/commands/devenv/project/uninit/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/devenv/project/uninit/index.ts)_
593
+ _See code: [src/commands/devenv/project/uninit/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/devenv/project/uninit/index.ts)_
594
594
 
595
595
  ## `hereya devenv sleep`
596
596
 
@@ -611,7 +611,7 @@ EXAMPLES
611
611
  $ hereya devenv sleep -w my-workspace
612
612
  ```
613
613
 
614
- _See code: [src/commands/devenv/sleep/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/devenv/sleep/index.ts)_
614
+ _See code: [src/commands/devenv/sleep/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/devenv/sleep/index.ts)_
615
615
 
616
616
  ## `hereya devenv ssh`
617
617
 
@@ -631,7 +631,7 @@ EXAMPLES
631
631
  $ hereya devenv ssh -w my-workspace
632
632
  ```
633
633
 
634
- _See code: [src/commands/devenv/ssh/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/devenv/ssh/index.ts)_
634
+ _See code: [src/commands/devenv/ssh/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/devenv/ssh/index.ts)_
635
635
 
636
636
  ## `hereya devenv uninstall`
637
637
 
@@ -652,7 +652,7 @@ EXAMPLES
652
652
  $ hereya devenv uninstall -w my-workspace
653
653
  ```
654
654
 
655
- _See code: [src/commands/devenv/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/devenv/uninstall/index.ts)_
655
+ _See code: [src/commands/devenv/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/devenv/uninstall/index.ts)_
656
656
 
657
657
  ## `hereya doc PACKAGE`
658
658
 
@@ -685,7 +685,7 @@ EXAMPLES
685
685
  $ hereya doc my-package --no-doc
686
686
  ```
687
687
 
688
- _See code: [src/commands/doc/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/doc/index.ts)_
688
+ _See code: [src/commands/doc/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/doc/index.ts)_
689
689
 
690
690
  ## `hereya docker run IMAGE`
691
691
 
@@ -716,7 +716,7 @@ EXAMPLES
716
716
  $ hereya docker run myapp:latest -- --rm -v ./data:/data
717
717
  ```
718
718
 
719
- _See code: [src/commands/docker/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/docker/run/index.ts)_
719
+ _See code: [src/commands/docker/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/docker/run/index.ts)_
720
720
 
721
721
  ## `hereya down`
722
722
 
@@ -743,7 +743,7 @@ EXAMPLES
743
743
  $ hereya down
744
744
  ```
745
745
 
746
- _See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/down/index.ts)_
746
+ _See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/down/index.ts)_
747
747
 
748
748
  ## `hereya env [NAME]`
749
749
 
@@ -774,7 +774,7 @@ EXAMPLES
774
774
  $ hereya env -w dev -l
775
775
  ```
776
776
 
777
- _See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/env/index.ts)_
777
+ _See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/env/index.ts)_
778
778
 
779
779
  ## `hereya env set [NAME]`
780
780
 
@@ -801,7 +801,7 @@ EXAMPLES
801
801
  $ hereya env set FOO -v bar -w dev
802
802
  ```
803
803
 
804
- _See code: [src/commands/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/env/set/index.ts)_
804
+ _See code: [src/commands/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/env/set/index.ts)_
805
805
 
806
806
  ## `hereya executor start`
807
807
 
@@ -835,7 +835,7 @@ EXAMPLES
835
835
  HEREYA_TOKEN=<token> HEREYA_CLOUD_URL=https://my-cloud.example.com hereya executor start -w my-workspace
836
836
  ```
837
837
 
838
- _See code: [src/commands/executor/start/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/executor/start/index.ts)_
838
+ _See code: [src/commands/executor/start/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/executor/start/index.ts)_
839
839
 
840
840
  ## `hereya flow add PACKAGE`
841
841
 
@@ -873,7 +873,7 @@ EXAMPLES
873
873
  $ hereya flow add cloudy/docker_postgres -p DB_NAME=mydb -p DB_USER=admin
874
874
  ```
875
875
 
876
- _See code: [src/commands/flow/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/flow/add/index.ts)_
876
+ _See code: [src/commands/flow/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/flow/add/index.ts)_
877
877
 
878
878
  ## `hereya flow docker run IMAGE`
879
879
 
@@ -903,7 +903,7 @@ EXAMPLES
903
903
  $ hereya flow docker run --pin myapp:latest -- --rm
904
904
  ```
905
905
 
906
- _See code: [src/commands/flow/docker/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/flow/docker/run/index.ts)_
906
+ _See code: [src/commands/flow/docker/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/flow/docker/run/index.ts)_
907
907
 
908
908
  ## `hereya flow down`
909
909
 
@@ -937,7 +937,7 @@ EXAMPLES
937
937
  $ hereya flow down --pin
938
938
  ```
939
939
 
940
- _See code: [src/commands/flow/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/flow/down/index.ts)_
940
+ _See code: [src/commands/flow/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/flow/down/index.ts)_
941
941
 
942
942
  ## `hereya flow env [NAME]`
943
943
 
@@ -971,7 +971,7 @@ EXAMPLES
971
971
  $ hereya flow env -l
972
972
  ```
973
973
 
974
- _See code: [src/commands/flow/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/flow/env/index.ts)_
974
+ _See code: [src/commands/flow/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/flow/env/index.ts)_
975
975
 
976
976
  ## `hereya flow provid PACKAGE`
977
977
 
@@ -1000,7 +1000,7 @@ EXAMPLES
1000
1000
  $ hereya flow provid hereya/postgres --pin
1001
1001
  ```
1002
1002
 
1003
- _See code: [src/commands/flow/provid/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/flow/provid/index.ts)_
1003
+ _See code: [src/commands/flow/provid/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/flow/provid/index.ts)_
1004
1004
 
1005
1005
  ## `hereya flow remove PACKAGE`
1006
1006
 
@@ -1030,7 +1030,7 @@ EXAMPLES
1030
1030
  $ hereya flow remove cloudy/docker_postgres --profile staging
1031
1031
  ```
1032
1032
 
1033
- _See code: [src/commands/flow/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/flow/remove/index.ts)_
1033
+ _See code: [src/commands/flow/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/flow/remove/index.ts)_
1034
1034
 
1035
1035
  ## `hereya flow run CMD`
1036
1036
 
@@ -1059,7 +1059,7 @@ EXAMPLES
1059
1059
  $ hereya flow run --pin -- npm test
1060
1060
  ```
1061
1061
 
1062
- _See code: [src/commands/flow/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/flow/run/index.ts)_
1062
+ _See code: [src/commands/flow/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/flow/run/index.ts)_
1063
1063
 
1064
1064
  ## `hereya flow up`
1065
1065
 
@@ -1093,7 +1093,7 @@ EXAMPLES
1093
1093
  $ hereya flow up --pin
1094
1094
  ```
1095
1095
 
1096
- _See code: [src/commands/flow/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/flow/up/index.ts)_
1096
+ _See code: [src/commands/flow/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/flow/up/index.ts)_
1097
1097
 
1098
1098
  ## `hereya help [COMMAND]`
1099
1099
 
@@ -1150,7 +1150,7 @@ EXAMPLES
1150
1150
  $ hereya import org/my-package -f state.tfstate -w my-workspace
1151
1151
  ```
1152
1152
 
1153
- _See code: [src/commands/import/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/import/index.ts)_
1153
+ _See code: [src/commands/import/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/import/index.ts)_
1154
1154
 
1155
1155
  ## `hereya import-repo PROJECT`
1156
1156
 
@@ -1180,7 +1180,7 @@ EXAMPLES
1180
1180
  $ hereya import-repo myProject -w=dev -r=https://github.com/acme/api --clone --chdir=./api
1181
1181
  ```
1182
1182
 
1183
- _See code: [src/commands/import-repo/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/import-repo/index.ts)_
1183
+ _See code: [src/commands/import-repo/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/import-repo/index.ts)_
1184
1184
 
1185
1185
  ## `hereya init PROJECT`
1186
1186
 
@@ -1214,7 +1214,7 @@ EXAMPLES
1214
1214
  $ hereya init myProject -w=dev -t=acme/node-starter -d=prod -p region=us-east-1
1215
1215
  ```
1216
1216
 
1217
- _See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/init/index.ts)_
1217
+ _See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/init/index.ts)_
1218
1218
 
1219
1219
  ## `hereya list`
1220
1220
 
@@ -1231,7 +1231,7 @@ EXAMPLES
1231
1231
  $ hereya list
1232
1232
  ```
1233
1233
 
1234
- _See code: [src/commands/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/list/index.ts)_
1234
+ _See code: [src/commands/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/list/index.ts)_
1235
1235
 
1236
1236
  ## `hereya login [URL]`
1237
1237
 
@@ -1260,7 +1260,7 @@ EXAMPLES
1260
1260
  $ hereya login --token=your-token https://cloud.hereya.dev
1261
1261
  ```
1262
1262
 
1263
- _See code: [src/commands/login/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/login/index.ts)_
1263
+ _See code: [src/commands/login/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/login/index.ts)_
1264
1264
 
1265
1265
  ## `hereya logout`
1266
1266
 
@@ -1277,7 +1277,7 @@ EXAMPLES
1277
1277
  $ hereya logout
1278
1278
  ```
1279
1279
 
1280
- _See code: [src/commands/logout/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/logout/index.ts)_
1280
+ _See code: [src/commands/logout/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/logout/index.ts)_
1281
1281
 
1282
1282
  ## `hereya provid PACKAGE`
1283
1283
 
@@ -1305,7 +1305,7 @@ EXAMPLES
1305
1305
  $ hereya provid hereya/postgres --workspace staging
1306
1306
  ```
1307
1307
 
1308
- _See code: [src/commands/provid/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/provid/index.ts)_
1308
+ _See code: [src/commands/provid/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/provid/index.ts)_
1309
1309
 
1310
1310
  ## `hereya publish`
1311
1311
 
@@ -1328,7 +1328,7 @@ EXAMPLES
1328
1328
  $ hereya publish --chdir=/path/to/package
1329
1329
  ```
1330
1330
 
1331
- _See code: [src/commands/publish/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/publish/index.ts)_
1331
+ _See code: [src/commands/publish/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/publish/index.ts)_
1332
1332
 
1333
1333
  ## `hereya remove PACKAGE`
1334
1334
 
@@ -1356,7 +1356,7 @@ EXAMPLES
1356
1356
  $ hereya remove cloudy/docker_postgres
1357
1357
  ```
1358
1358
 
1359
- _See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/remove/index.ts)_
1359
+ _See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/remove/index.ts)_
1360
1360
 
1361
1361
  ## `hereya run CMD`
1362
1362
 
@@ -1382,7 +1382,7 @@ EXAMPLES
1382
1382
  $ hereya run -w uat -- node index.js
1383
1383
  ```
1384
1384
 
1385
- _See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/run/index.ts)_
1385
+ _See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/run/index.ts)_
1386
1386
 
1387
1387
  ## `hereya search QUERY`
1388
1388
 
@@ -1413,7 +1413,7 @@ EXAMPLES
1413
1413
  $ hereya search database --json
1414
1414
  ```
1415
1415
 
1416
- _See code: [src/commands/search/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/search/index.ts)_
1416
+ _See code: [src/commands/search/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/search/index.ts)_
1417
1417
 
1418
1418
  ## `hereya unbootstrap INFRASTRUCTURETYPE`
1419
1419
 
@@ -1438,7 +1438,7 @@ EXAMPLES
1438
1438
  $ hereya unbootstrap local
1439
1439
  ```
1440
1440
 
1441
- _See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/unbootstrap/index.ts)_
1441
+ _See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/unbootstrap/index.ts)_
1442
1442
 
1443
1443
  ## `hereya undeploy`
1444
1444
 
@@ -1464,7 +1464,7 @@ EXAMPLES
1464
1464
  $ hereya undeploy
1465
1465
  ```
1466
1466
 
1467
- _See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/undeploy/index.ts)_
1467
+ _See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/undeploy/index.ts)_
1468
1468
 
1469
1469
  ## `hereya uninit PROJECT`
1470
1470
 
@@ -1492,7 +1492,7 @@ EXAMPLES
1492
1492
  $ hereya uninit myProject -w dev -p prodWorkspace=prod
1493
1493
  ```
1494
1494
 
1495
- _See code: [src/commands/uninit/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/uninit/index.ts)_
1495
+ _See code: [src/commands/uninit/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/uninit/index.ts)_
1496
1496
 
1497
1497
  ## `hereya up`
1498
1498
 
@@ -1519,7 +1519,7 @@ EXAMPLES
1519
1519
  $ hereya up
1520
1520
  ```
1521
1521
 
1522
- _See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/up/index.ts)_
1522
+ _See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/up/index.ts)_
1523
1523
 
1524
1524
  ## `hereya update [VERSION]`
1525
1525
 
@@ -1541,7 +1541,7 @@ EXAMPLES
1541
1541
  $ hereya update 0.75.0
1542
1542
  ```
1543
1543
 
1544
- _See code: [src/commands/update/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/update/index.ts)_
1544
+ _See code: [src/commands/update/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/update/index.ts)_
1545
1545
 
1546
1546
  ## `hereya workspace create NAME`
1547
1547
 
@@ -1566,7 +1566,7 @@ EXAMPLES
1566
1566
  $ hereya workspace create dev
1567
1567
  ```
1568
1568
 
1569
- _See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/workspace/create/index.ts)_
1569
+ _See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/workspace/create/index.ts)_
1570
1570
 
1571
1571
  ## `hereya workspace delete NAME`
1572
1572
 
@@ -1586,7 +1586,7 @@ EXAMPLES
1586
1586
  $ hereya workspace delete dev
1587
1587
  ```
1588
1588
 
1589
- _See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/workspace/delete/index.ts)_
1589
+ _See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/workspace/delete/index.ts)_
1590
1590
 
1591
1591
  ## `hereya workspace env [NAME]`
1592
1592
 
@@ -1612,7 +1612,7 @@ EXAMPLES
1612
1612
  $ hereya workspace env myEnv -w dev
1613
1613
  ```
1614
1614
 
1615
- _See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/workspace/env/index.ts)_
1615
+ _See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/workspace/env/index.ts)_
1616
1616
 
1617
1617
  ## `hereya workspace env set`
1618
1618
 
@@ -1636,7 +1636,7 @@ EXAMPLES
1636
1636
  $ hereya workspace env set -w my-workspace -n myVar -v my-value -i aws -s
1637
1637
  ```
1638
1638
 
1639
- _See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/workspace/env/set/index.ts)_
1639
+ _See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/workspace/env/set/index.ts)_
1640
1640
 
1641
1641
  ## `hereya workspace env unset`
1642
1642
 
@@ -1657,7 +1657,7 @@ EXAMPLES
1657
1657
  $ hereya workspace env unset -w my-workspace -n myVar
1658
1658
  ```
1659
1659
 
1660
- _See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/workspace/env/unset/index.ts)_
1660
+ _See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/workspace/env/unset/index.ts)_
1661
1661
 
1662
1662
  ## `hereya workspace executor install`
1663
1663
 
@@ -1684,7 +1684,7 @@ DESCRIPTION
1684
1684
  - ephemeral: ASG scaled to 0 with a broker Lambda + OIDC for on-demand wake.
1685
1685
  ```
1686
1686
 
1687
- _See code: [src/commands/workspace/executor/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/workspace/executor/install/index.ts)_
1687
+ _See code: [src/commands/workspace/executor/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/workspace/executor/install/index.ts)_
1688
1688
 
1689
1689
  ## `hereya workspace executor token`
1690
1690
 
@@ -1701,7 +1701,7 @@ DESCRIPTION
1701
1701
  Generate a workspace-scoped executor token for the remote executor
1702
1702
  ```
1703
1703
 
1704
- _See code: [src/commands/workspace/executor/token/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/workspace/executor/token/index.ts)_
1704
+ _See code: [src/commands/workspace/executor/token/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/workspace/executor/token/index.ts)_
1705
1705
 
1706
1706
  ## `hereya workspace executor uninstall`
1707
1707
 
@@ -1725,7 +1725,7 @@ DESCRIPTION
1725
1725
  controls log output.
1726
1726
  ```
1727
1727
 
1728
- _See code: [src/commands/workspace/executor/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/workspace/executor/uninstall/index.ts)_
1728
+ _See code: [src/commands/workspace/executor/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/workspace/executor/uninstall/index.ts)_
1729
1729
 
1730
1730
  ## `hereya workspace install PACKAGE`
1731
1731
 
@@ -1752,7 +1752,7 @@ EXAMPLES
1752
1752
  $ hereya workspace install hereya/aws-cognito
1753
1753
  ```
1754
1754
 
1755
- _See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/workspace/install/index.ts)_
1755
+ _See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/workspace/install/index.ts)_
1756
1756
 
1757
1757
  ## `hereya workspace list`
1758
1758
 
@@ -1776,7 +1776,7 @@ EXAMPLES
1776
1776
  $ hereya workspace list --org personal
1777
1777
  ```
1778
1778
 
1779
- _See code: [src/commands/workspace/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/workspace/list/index.ts)_
1779
+ _See code: [src/commands/workspace/list/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/workspace/list/index.ts)_
1780
1780
 
1781
1781
  ## `hereya workspace set-profile PROFILE`
1782
1782
 
@@ -1800,7 +1800,7 @@ EXAMPLES
1800
1800
  $ hereya workspace set-profile prod-profile -w production
1801
1801
  ```
1802
1802
 
1803
- _See code: [src/commands/workspace/set-profile/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/workspace/set-profile/index.ts)_
1803
+ _See code: [src/commands/workspace/set-profile/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/workspace/set-profile/index.ts)_
1804
1804
 
1805
1805
  ## `hereya workspace uninstall PACKAGE`
1806
1806
 
@@ -1827,5 +1827,5 @@ EXAMPLES
1827
1827
  $ hereya workspace uninstall hereya/aws-cognito
1828
1828
  ```
1829
1829
 
1830
- _See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.0/src/commands/workspace/uninstall/index.ts)_
1830
+ _See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.93.2/src/commands/workspace/uninstall/index.ts)_
1831
1831
  <!-- commandsstop -->
@@ -6,6 +6,8 @@ import os from 'node:os';
6
6
  import path from 'node:path';
7
7
  import { getBackend } from '../../../../backend/index.js';
8
8
  import { getExecutorForWorkspace } from '../../../../executor/context.js';
9
+ import { resolveDevenvSshHost } from '../../../../lib/devenv-wake.js';
10
+ import { getLogPath } from '../../../../lib/log.js';
9
11
  import { setKeyFilePermissions } from '../../../../lib/ssh-utils.js';
10
12
  export default class DevenvProjectInit extends Command {
11
13
  static args = {
@@ -69,14 +71,19 @@ export default class DevenvProjectInit extends Command {
69
71
  }
70
72
  const { executor } = executor$;
71
73
  env = await executor.resolveEnvValues({ env });
72
- const sshHost = env.devEnvSshHost;
73
74
  const sshPrivateKey = env.devEnvSshPrivateKey;
74
75
  const sshUser = env.devEnvSshUser;
75
- const sshHostDns = env.devEnvSshHostDns;
76
- if (!sshHost || !sshPrivateKey || !sshUser) {
77
- this.error('devEnvSshHost, devEnvSshPrivateKey, and devEnvSshUser must be set in the workspace environment');
76
+ if (!sshPrivateKey || !sshUser) {
77
+ this.error('devEnvSshPrivateKey and devEnvSshUser must be set in the workspace environment');
78
+ }
79
+ let host;
80
+ try {
81
+ host = await resolveDevenvSshHost(env);
82
+ }
83
+ catch (error) {
84
+ const message = error instanceof Error ? error.message : String(error);
85
+ this.error(`Failed to wake dev environment: ${message}. See ${getLogPath()} for details.`);
78
86
  }
79
- const host = sshHostDns || sshHost;
80
87
  const tempKeyPath = path.join(os.tmpdir(), `hereya-ssh-${randomUUID()}`);
81
88
  try {
82
89
  await fs.writeFile(tempKeyPath, sshPrivateKey);
@@ -6,6 +6,8 @@ import os from 'node:os';
6
6
  import path from 'node:path';
7
7
  import { getBackend } from '../../../../backend/index.js';
8
8
  import { getExecutorForWorkspace } from '../../../../executor/context.js';
9
+ import { resolveDevenvSshHost } from '../../../../lib/devenv-wake.js';
10
+ import { getLogPath } from '../../../../lib/log.js';
9
11
  import { setKeyFilePermissions } from '../../../../lib/ssh-utils.js';
10
12
  export default class DevenvProjectUninit extends Command {
11
13
  static args = {
@@ -47,14 +49,19 @@ export default class DevenvProjectUninit extends Command {
47
49
  }
48
50
  const { executor } = executor$;
49
51
  env = await executor.resolveEnvValues({ env });
50
- const sshHost = env.devEnvSshHost;
51
52
  const sshPrivateKey = env.devEnvSshPrivateKey;
52
53
  const sshUser = env.devEnvSshUser;
53
- const sshHostDns = env.devEnvSshHostDns;
54
- if (!sshHost || !sshPrivateKey || !sshUser) {
55
- this.error('devEnvSshHost, devEnvSshPrivateKey, and devEnvSshUser must be set in the workspace environment');
54
+ if (!sshPrivateKey || !sshUser) {
55
+ this.error('devEnvSshPrivateKey and devEnvSshUser must be set in the workspace environment');
56
+ }
57
+ let host;
58
+ try {
59
+ host = await resolveDevenvSshHost(env);
60
+ }
61
+ catch (error) {
62
+ const message = error instanceof Error ? error.message : String(error);
63
+ this.error(`Failed to wake dev environment: ${message}. See ${getLogPath()} for details.`);
56
64
  }
57
- const host = sshHostDns || sshHost;
58
65
  const tempKeyPath = path.join(os.tmpdir(), `hereya-ssh-${randomUUID()}`);
59
66
  try {
60
67
  await fs.writeFile(tempKeyPath, sshPrivateKey);
@@ -7,7 +7,4 @@ export default class DevenvSsh extends Command {
7
7
  };
8
8
  run(): Promise<void>;
9
9
  protected spawnSsh(args: string[]): Promise<void>;
10
- private fetchStatus;
11
- private postWake;
12
- private wakeAndPoll;
13
10
  }
@@ -1,5 +1,4 @@
1
1
  import { Command, Flags } from '@oclif/core';
2
- import { Listr } from 'listr2';
3
2
  import { spawnSync } from 'node:child_process';
4
3
  import { randomUUID } from 'node:crypto';
5
4
  import fs from 'node:fs/promises';
@@ -7,21 +6,9 @@ import os from 'node:os';
7
6
  import path from 'node:path';
8
7
  import { getBackend } from '../../../backend/index.js';
9
8
  import { getExecutorForWorkspace } from '../../../executor/context.js';
9
+ import { resolveDevenvSshHost } from '../../../lib/devenv-wake.js';
10
10
  import { getLogPath } from '../../../lib/log.js';
11
11
  import { setKeyFilePermissions } from '../../../lib/ssh-utils.js';
12
- // Polling cadence and overall timeout for the wake broker. Overridable via env
13
- // vars purely to keep tests fast — the defaults are the production values.
14
- function getWakePollIntervalMs() {
15
- return Number(process.env.HEREYA_WAKE_POLL_INTERVAL_MS) || 4000;
16
- }
17
- function getWakeTimeoutMs() {
18
- return Number(process.env.HEREYA_WAKE_TIMEOUT_MS) || 90_000;
19
- }
20
- function sleep(ms) {
21
- return new Promise((resolve) => {
22
- setTimeout(resolve, ms);
23
- });
24
- }
25
12
  export default class DevenvSsh extends Command {
26
13
  static description = 'SSH into a dev environment instance.';
27
14
  static examples = [
@@ -49,27 +36,19 @@ export default class DevenvSsh extends Command {
49
36
  }
50
37
  const { executor } = executor$;
51
38
  env = await executor.resolveEnvValues({ env });
52
- let sshHost = env.devEnvSshHost;
53
39
  const sshPrivateKey = env.devEnvSshPrivateKey;
54
40
  const sshUser = env.devEnvSshUser;
55
- const sshHostDns = env.devEnvSshHostDns;
56
- const wakeUrl = env.devEnvWakeUrl;
57
- const wakeToken = env.devEnvWakeToken;
58
- if (!sshHost || !sshPrivateKey || !sshUser) {
59
- this.error('devEnvSshHost, devEnvSshPrivateKey, and devEnvSshUser must be set in the workspace environment');
41
+ if (!sshPrivateKey || !sshUser) {
42
+ this.error('devEnvSshPrivateKey and devEnvSshUser must be set in the workspace environment');
60
43
  }
61
- if (wakeUrl && wakeToken) {
62
- try {
63
- const wakeResult = await this.wakeAndPoll(wakeUrl, wakeToken);
64
- // Override sshHost with the freshly-resolved IP from the broker
65
- sshHost = wakeResult.host;
66
- }
67
- catch (error) {
68
- const message = error instanceof Error ? error.message : String(error);
69
- this.error(`Failed to wake dev environment: ${message}. See ${getLogPath()} for details.`);
70
- }
44
+ let host;
45
+ try {
46
+ host = await resolveDevenvSshHost(env);
47
+ }
48
+ catch (error) {
49
+ const message = error instanceof Error ? error.message : String(error);
50
+ this.error(`Failed to wake dev environment: ${message}. See ${getLogPath()} for details.`);
71
51
  }
72
- const host = sshHostDns || sshHost;
73
52
  const tempKeyPath = path.join(os.tmpdir(), `hereya-ssh-${randomUUID()}`);
74
53
  try {
75
54
  await fs.writeFile(tempKeyPath, sshPrivateKey);
@@ -98,64 +77,4 @@ export default class DevenvSsh extends Command {
98
77
  }
99
78
  return Promise.resolve();
100
79
  }
101
- async fetchStatus(wakeUrl, wakeToken) {
102
- const response = await fetch(`${wakeUrl}/status`, {
103
- headers: { Authorization: `Bearer ${wakeToken}` },
104
- method: 'GET',
105
- });
106
- if (!response.ok) {
107
- const body = await response.text().catch(() => '');
108
- throw new Error(`broker /status returned ${response.status}: ${body}`);
109
- }
110
- return response.json();
111
- }
112
- async postWake(wakeUrl, wakeToken) {
113
- const response = await fetch(`${wakeUrl}/wake`, {
114
- headers: { Authorization: `Bearer ${wakeToken}` },
115
- method: 'POST',
116
- });
117
- if (!response.ok) {
118
- const body = await response.text().catch(() => '');
119
- throw new Error(`broker /wake returned ${response.status}: ${body}`);
120
- }
121
- return response.json();
122
- }
123
- async wakeAndPoll(wakeUrl, wakeToken) {
124
- let resultHost = '';
125
- const pollIntervalMs = getWakePollIntervalMs();
126
- const timeoutMs = getWakeTimeoutMs();
127
- const task = new Listr([
128
- {
129
- task: async () => {
130
- const initial = await this.fetchStatus(wakeUrl, wakeToken);
131
- if (initial.state === 'running' && initial.host) {
132
- resultHost = initial.host;
133
- return;
134
- }
135
- await this.postWake(wakeUrl, wakeToken);
136
- const start = Date.now();
137
- let done = false;
138
- while (!done) {
139
- if (Date.now() - start >= timeoutMs) {
140
- throw new Error(`timed out waiting for dev environment to start after ${timeoutMs / 1000}s`);
141
- }
142
- // eslint-disable-next-line no-await-in-loop
143
- await sleep(pollIntervalMs);
144
- // eslint-disable-next-line no-await-in-loop
145
- const status = await this.fetchStatus(wakeUrl, wakeToken);
146
- if (status.state === 'running' && status.host) {
147
- resultHost = status.host;
148
- done = true;
149
- }
150
- }
151
- },
152
- title: 'Waking dev environment',
153
- },
154
- ], { concurrent: false });
155
- await task.run();
156
- if (!resultHost) {
157
- throw new Error('broker did not return a host after wake');
158
- }
159
- return { host: resultHost };
160
- }
161
80
  }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Resolve the SSH host to use for a devenv workspace.
3
+ *
4
+ * - On-demand devenvs (devEnvWakeUrl + devEnvWakeToken set): wake the instance
5
+ * if it's not already running, poll the broker until it reports a public IP,
6
+ * probe TCP :22 until sshd accepts connections, then return the fresh IP.
7
+ * - Always-on devenvs (no wake URL): return the cached devEnvSshHostDns or
8
+ * devEnvSshHost from workspace env unchanged. No wake, no probe.
9
+ *
10
+ * The Listr UI ("Waking dev environment", "Waiting for SSH to accept
11
+ * connections") only renders on the on-demand path.
12
+ */
13
+ export declare function resolveDevenvSshHost(env: Record<string, string>): Promise<string>;
@@ -0,0 +1,153 @@
1
+ import { Listr } from 'listr2';
2
+ import { Socket } from 'node:net';
3
+ // Polling cadence and overall timeout for the wake broker. Overridable via env
4
+ // vars purely to keep tests fast — the defaults are the production values.
5
+ function getWakePollIntervalMs() {
6
+ return Number(process.env.HEREYA_WAKE_POLL_INTERVAL_MS) || 4000;
7
+ }
8
+ function getWakeTimeoutMs() {
9
+ return Number(process.env.HEREYA_WAKE_TIMEOUT_MS) || 90_000;
10
+ }
11
+ // Probe budget for waiting on sshd after the EC2 instance reports running.
12
+ // EC2 returns state=running before sshd starts accepting connections; without
13
+ // this probe, the immediate ssh spawn races and gets ECONNREFUSED.
14
+ // Set HEREYA_SSH_READY_TIMEOUT_MS=0 to disable the probe entirely (tests).
15
+ function getSshReadyTimeoutMs() {
16
+ const raw = process.env.HEREYA_SSH_READY_TIMEOUT_MS;
17
+ if (raw === undefined)
18
+ return 60_000;
19
+ return Number(raw);
20
+ }
21
+ function getSshReadyAttemptIntervalMs() {
22
+ return Number(process.env.HEREYA_SSH_READY_ATTEMPT_INTERVAL_MS) || 2000;
23
+ }
24
+ function sleep(ms) {
25
+ return new Promise((resolve) => {
26
+ setTimeout(resolve, ms);
27
+ });
28
+ }
29
+ function probeTcp(host, port, timeoutMs) {
30
+ return new Promise((resolve) => {
31
+ const socket = new Socket();
32
+ let done = false;
33
+ const finish = (ok) => {
34
+ if (done)
35
+ return;
36
+ done = true;
37
+ socket.destroy();
38
+ resolve(ok);
39
+ };
40
+ socket.setTimeout(timeoutMs);
41
+ socket.once('connect', () => finish(true));
42
+ socket.once('timeout', () => finish(false));
43
+ socket.once('error', () => finish(false));
44
+ socket.connect(port, host);
45
+ });
46
+ }
47
+ async function waitForSshReady(host, port, totalTimeoutMs, attemptIntervalMs) {
48
+ const start = Date.now();
49
+ while (Date.now() - start < totalTimeoutMs) {
50
+ // eslint-disable-next-line no-await-in-loop
51
+ const ok = await probeTcp(host, port, Math.min(2000, attemptIntervalMs));
52
+ if (ok)
53
+ return;
54
+ if (Date.now() - start + attemptIntervalMs >= totalTimeoutMs)
55
+ break;
56
+ // eslint-disable-next-line no-await-in-loop
57
+ await sleep(attemptIntervalMs);
58
+ }
59
+ throw new Error(`SSH at ${host}:${port} did not accept connections within ${totalTimeoutMs / 1000}s`);
60
+ }
61
+ async function fetchStatus(wakeUrl, wakeToken) {
62
+ const response = await fetch(`${wakeUrl}/status`, {
63
+ headers: { Authorization: `Bearer ${wakeToken}` },
64
+ method: 'GET',
65
+ });
66
+ if (!response.ok) {
67
+ const body = await response.text().catch(() => '');
68
+ throw new Error(`broker /status returned ${response.status}: ${body}`);
69
+ }
70
+ return response.json();
71
+ }
72
+ async function postWake(wakeUrl, wakeToken) {
73
+ const response = await fetch(`${wakeUrl}/wake`, {
74
+ headers: { Authorization: `Bearer ${wakeToken}` },
75
+ method: 'POST',
76
+ });
77
+ if (!response.ok) {
78
+ const body = await response.text().catch(() => '');
79
+ throw new Error(`broker /wake returned ${response.status}: ${body}`);
80
+ }
81
+ return response.json();
82
+ }
83
+ async function wakeAndProbe(wakeUrl, wakeToken) {
84
+ const pollIntervalMs = getWakePollIntervalMs();
85
+ const timeoutMs = getWakeTimeoutMs();
86
+ const sshReadyTimeoutMs = getSshReadyTimeoutMs();
87
+ const sshReadyAttemptIntervalMs = getSshReadyAttemptIntervalMs();
88
+ const task = new Listr([
89
+ {
90
+ async task(ctx) {
91
+ const initial = await fetchStatus(wakeUrl, wakeToken);
92
+ if (initial.state === 'running' && initial.host) {
93
+ ctx.host = initial.host;
94
+ return;
95
+ }
96
+ await postWake(wakeUrl, wakeToken);
97
+ const start = Date.now();
98
+ let done = false;
99
+ while (!done) {
100
+ if (Date.now() - start >= timeoutMs) {
101
+ throw new Error(`timed out waiting for dev environment to start after ${timeoutMs / 1000}s`);
102
+ }
103
+ // eslint-disable-next-line no-await-in-loop
104
+ await sleep(pollIntervalMs);
105
+ // eslint-disable-next-line no-await-in-loop
106
+ const status = await fetchStatus(wakeUrl, wakeToken);
107
+ if (status.state === 'running' && status.host) {
108
+ ctx.host = status.host;
109
+ done = true;
110
+ }
111
+ }
112
+ },
113
+ title: 'Waking dev environment',
114
+ },
115
+ {
116
+ enabled: () => sshReadyTimeoutMs > 0,
117
+ async task(ctx) {
118
+ await waitForSshReady(ctx.host, 22, sshReadyTimeoutMs, sshReadyAttemptIntervalMs);
119
+ },
120
+ title: 'Waiting for SSH to accept connections',
121
+ },
122
+ ], { concurrent: false, ctx: { host: '' } });
123
+ const result = await task.run();
124
+ if (!result.host) {
125
+ throw new Error('broker did not return a host after wake');
126
+ }
127
+ return result.host;
128
+ }
129
+ /**
130
+ * Resolve the SSH host to use for a devenv workspace.
131
+ *
132
+ * - On-demand devenvs (devEnvWakeUrl + devEnvWakeToken set): wake the instance
133
+ * if it's not already running, poll the broker until it reports a public IP,
134
+ * probe TCP :22 until sshd accepts connections, then return the fresh IP.
135
+ * - Always-on devenvs (no wake URL): return the cached devEnvSshHostDns or
136
+ * devEnvSshHost from workspace env unchanged. No wake, no probe.
137
+ *
138
+ * The Listr UI ("Waking dev environment", "Waiting for SSH to accept
139
+ * connections") only renders on the on-demand path.
140
+ */
141
+ export async function resolveDevenvSshHost(env) {
142
+ const wakeUrl = env.devEnvWakeUrl;
143
+ const wakeToken = env.devEnvWakeToken;
144
+ if (wakeUrl && wakeToken) {
145
+ return wakeAndProbe(wakeUrl, wakeToken);
146
+ }
147
+ const cachedDns = env.devEnvSshHostDns;
148
+ const cachedHost = env.devEnvSshHost;
149
+ if (!cachedHost) {
150
+ throw new Error('devEnvSshHost must be set in the workspace environment');
151
+ }
152
+ return cachedDns || cachedHost;
153
+ }
@@ -170,12 +170,13 @@
170
170
  "index.js"
171
171
  ]
172
172
  },
173
- "deploy": {
173
+ "delete-state": {
174
174
  "aliases": [],
175
175
  "args": {},
176
- "description": "Deploy a hereya project using the project deployment package",
176
+ "description": "Delete the remote state of a project for a given workspace",
177
177
  "examples": [
178
- "<%= config.bin %> <%= command.id %>"
178
+ "<%= config.bin %> <%= command.id %> -w dev",
179
+ "<%= config.bin %> <%= command.id %> --workspace staging"
179
180
  ],
180
181
  "flags": {
181
182
  "chdir": {
@@ -186,21 +187,9 @@
186
187
  "multiple": false,
187
188
  "type": "option"
188
189
  },
189
- "debug": {
190
- "description": "enable debug mode",
191
- "name": "debug",
192
- "allowNo": false,
193
- "type": "boolean"
194
- },
195
- "local": {
196
- "description": "force local execution (skip remote executor)",
197
- "name": "local",
198
- "allowNo": false,
199
- "type": "boolean"
200
- },
201
190
  "workspace": {
202
191
  "char": "w",
203
- "description": "name of the workspace to deploy the packages for",
192
+ "description": "workspace name",
204
193
  "name": "workspace",
205
194
  "required": true,
206
195
  "hasDynamicHelp": false,
@@ -210,7 +199,7 @@
210
199
  },
211
200
  "hasDynamicHelp": false,
212
201
  "hiddenAliases": [],
213
- "id": "deploy",
202
+ "id": "delete-state",
214
203
  "pluginAlias": "hereya-cli",
215
204
  "pluginName": "hereya-cli",
216
205
  "pluginType": "core",
@@ -220,17 +209,16 @@
220
209
  "relativePath": [
221
210
  "dist",
222
211
  "commands",
223
- "deploy",
212
+ "delete-state",
224
213
  "index.js"
225
214
  ]
226
215
  },
227
- "delete-state": {
216
+ "deploy": {
228
217
  "aliases": [],
229
218
  "args": {},
230
- "description": "Delete the remote state of a project for a given workspace",
219
+ "description": "Deploy a hereya project using the project deployment package",
231
220
  "examples": [
232
- "<%= config.bin %> <%= command.id %> -w dev",
233
- "<%= config.bin %> <%= command.id %> --workspace staging"
221
+ "<%= config.bin %> <%= command.id %>"
234
222
  ],
235
223
  "flags": {
236
224
  "chdir": {
@@ -241,9 +229,21 @@
241
229
  "multiple": false,
242
230
  "type": "option"
243
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
+ },
244
244
  "workspace": {
245
245
  "char": "w",
246
- "description": "workspace name",
246
+ "description": "name of the workspace to deploy the packages for",
247
247
  "name": "workspace",
248
248
  "required": true,
249
249
  "hasDynamicHelp": false,
@@ -253,7 +253,7 @@
253
253
  },
254
254
  "hasDynamicHelp": false,
255
255
  "hiddenAliases": [],
256
- "id": "delete-state",
256
+ "id": "deploy",
257
257
  "pluginAlias": "hereya-cli",
258
258
  "pluginName": "hereya-cli",
259
259
  "pluginType": "core",
@@ -263,7 +263,7 @@
263
263
  "relativePath": [
264
264
  "dist",
265
265
  "commands",
266
- "delete-state",
266
+ "deploy",
267
267
  "index.js"
268
268
  ]
269
269
  },
@@ -3361,5 +3361,5 @@
3361
3361
  ]
3362
3362
  }
3363
3363
  },
3364
- "version": "0.93.0"
3364
+ "version": "0.93.2"
3365
3365
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hereya-cli",
3
3
  "description": "Infrastructure as Package",
4
- "version": "0.93.0",
4
+ "version": "0.93.2",
5
5
  "author": "Hereya Developers",
6
6
  "bin": {
7
7
  "hereya": "./bin/run.js"