@quonfig/cli 0.0.30 → 0.0.32
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 +40 -40
- package/dist/commands/migrate.js +6 -6
- package/dist/commands/pull.d.ts +11 -0
- package/dist/commands/pull.js +27 -11
- package/dist/commands/push.js +1 -0
- package/dist/commands/whoami.js +28 -6
- package/dist/commands/workspace/create.js +9 -3
- package/dist/push/run-push.d.ts +8 -0
- package/dist/push/run-push.js +16 -7
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/oclif.manifest.json +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ $ npm install -g @quonfig/cli
|
|
|
14
14
|
$ qfg COMMAND
|
|
15
15
|
running command...
|
|
16
16
|
$ qfg (--version)
|
|
17
|
-
@quonfig/cli/0.0.
|
|
17
|
+
@quonfig/cli/0.0.32 linux-x64 node-v24.4.1
|
|
18
18
|
$ qfg --help [COMMAND]
|
|
19
19
|
USAGE
|
|
20
20
|
$ qfg COMMAND
|
|
@@ -91,7 +91,7 @@ EXAMPLES
|
|
|
91
91
|
$ qfg config-schema --json-schema # full JSON Schema document (copy into your editor)
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
-
_See code: [src/commands/config-schema.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
94
|
+
_See code: [src/commands/config-schema.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/config-schema.ts)_
|
|
95
95
|
|
|
96
96
|
## `qfg create NAME`
|
|
97
97
|
|
|
@@ -176,7 +176,7 @@ EXAMPLES
|
|
|
176
176
|
$ qfg set-rollout my.new.flag --environment production --true-percent 20
|
|
177
177
|
```
|
|
178
178
|
|
|
179
|
-
_See code: [src/commands/create.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
179
|
+
_See code: [src/commands/create.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/create.ts)_
|
|
180
180
|
|
|
181
181
|
## `qfg delete NAME`
|
|
182
182
|
|
|
@@ -222,7 +222,7 @@ EXAMPLES
|
|
|
222
222
|
$ qfg delete my.config --yes
|
|
223
223
|
```
|
|
224
224
|
|
|
225
|
-
_See code: [src/commands/delete.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
225
|
+
_See code: [src/commands/delete.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/delete.ts)_
|
|
226
226
|
|
|
227
227
|
## `qfg flag info [NAME]`
|
|
228
228
|
|
|
@@ -425,7 +425,7 @@ EXAMPLES
|
|
|
425
425
|
$ qfg generate --targets node-ts -o ./dist # combine with targets
|
|
426
426
|
```
|
|
427
427
|
|
|
428
|
-
_See code: [src/commands/generate.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
428
|
+
_See code: [src/commands/generate.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/generate.ts)_
|
|
429
429
|
|
|
430
430
|
## `qfg generate-new-hex-key`
|
|
431
431
|
|
|
@@ -448,7 +448,7 @@ EXAMPLES
|
|
|
448
448
|
$ qfg generate-new-hex-key
|
|
449
449
|
```
|
|
450
450
|
|
|
451
|
-
_See code: [src/commands/generate-new-hex-key.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
451
|
+
_See code: [src/commands/generate-new-hex-key.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/generate-new-hex-key.ts)_
|
|
452
452
|
|
|
453
453
|
## `qfg get [NAME]`
|
|
454
454
|
|
|
@@ -480,7 +480,7 @@ EXAMPLES
|
|
|
480
480
|
$ qfg get my.config.name --environment=production
|
|
481
481
|
```
|
|
482
482
|
|
|
483
|
-
_See code: [src/commands/get.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
483
|
+
_See code: [src/commands/get.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/get.ts)_
|
|
484
484
|
|
|
485
485
|
## `qfg info [NAME]`
|
|
486
486
|
|
|
@@ -528,7 +528,7 @@ EXAMPLES
|
|
|
528
528
|
$ qfg info my.config.name --exclude-evaluations # skip 24h stats
|
|
529
529
|
```
|
|
530
530
|
|
|
531
|
-
_See code: [src/commands/info.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
531
|
+
_See code: [src/commands/info.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/info.ts)_
|
|
532
532
|
|
|
533
533
|
## `qfg init [DIRECTORY]`
|
|
534
534
|
|
|
@@ -568,7 +568,7 @@ EXAMPLES
|
|
|
568
568
|
$ qfg init --dry-run
|
|
569
569
|
```
|
|
570
570
|
|
|
571
|
-
_See code: [src/commands/init.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
571
|
+
_See code: [src/commands/init.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/init.ts)_
|
|
572
572
|
|
|
573
573
|
## `qfg interactive`
|
|
574
574
|
|
|
@@ -598,7 +598,7 @@ EXAMPLES
|
|
|
598
598
|
$ qfg
|
|
599
599
|
```
|
|
600
600
|
|
|
601
|
-
_See code: [src/commands/interactive.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
601
|
+
_See code: [src/commands/interactive.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/interactive.ts)_
|
|
602
602
|
|
|
603
603
|
## `qfg list`
|
|
604
604
|
|
|
@@ -638,7 +638,7 @@ EXAMPLES
|
|
|
638
638
|
$ qfg list --feature-flags
|
|
639
639
|
```
|
|
640
640
|
|
|
641
|
-
_See code: [src/commands/list.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
641
|
+
_See code: [src/commands/list.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/list.ts)_
|
|
642
642
|
|
|
643
643
|
## `qfg log-level NAME`
|
|
644
644
|
|
|
@@ -703,7 +703,7 @@ EXAMPLES
|
|
|
703
703
|
$ qfg log-level log-level.my-app --target=Chatty --value=INFO --environment=production
|
|
704
704
|
```
|
|
705
705
|
|
|
706
|
-
_See code: [src/commands/log-level.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
706
|
+
_See code: [src/commands/log-level.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/log-level.ts)_
|
|
707
707
|
|
|
708
708
|
## `qfg login`
|
|
709
709
|
|
|
@@ -728,7 +728,7 @@ EXAMPLES
|
|
|
728
728
|
$ qfg login --profile myprofile
|
|
729
729
|
```
|
|
730
730
|
|
|
731
|
-
_See code: [src/commands/login.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
731
|
+
_See code: [src/commands/login.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/login.ts)_
|
|
732
732
|
|
|
733
733
|
## `qfg logout`
|
|
734
734
|
|
|
@@ -751,7 +751,7 @@ EXAMPLES
|
|
|
751
751
|
$ qfg logout
|
|
752
752
|
```
|
|
753
753
|
|
|
754
|
-
_See code: [src/commands/logout.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
754
|
+
_See code: [src/commands/logout.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/logout.ts)_
|
|
755
755
|
|
|
756
756
|
## `qfg migrate`
|
|
757
757
|
|
|
@@ -766,7 +766,7 @@ USAGE
|
|
|
766
766
|
FLAGS
|
|
767
767
|
--api-key=<value> API key for the legacy source (or set LAUNCH_API_KEY)
|
|
768
768
|
--dir=<value> Target local workspace directory. Defaults to cwd if it looks like a Quonfig workspace, otherwise
|
|
769
|
-
./quonfig-
|
|
769
|
+
./quonfig-repo.
|
|
770
770
|
--dry-run Fetch and summarize changes without writing anything
|
|
771
771
|
--from=<option> (required) Legacy source to migrate from
|
|
772
772
|
<options: launch|launchdarkly|flagsmith>
|
|
@@ -794,18 +794,18 @@ DESCRIPTION
|
|
|
794
794
|
and https://docs.quonfig.com/docs/migrating/troubleshooting when something goes sideways.
|
|
795
795
|
|
|
796
796
|
EXAMPLES
|
|
797
|
-
$ qfg migrate --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-
|
|
797
|
+
$ qfg migrate --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-repo
|
|
798
798
|
|
|
799
799
|
$ qfg migrate --from launch --api-key $LAUNCH_API_KEY --workspace acme-prod --push
|
|
800
800
|
|
|
801
|
-
$ qfg migrate --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-
|
|
801
|
+
$ qfg migrate --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-repo --reset
|
|
802
802
|
|
|
803
|
-
$ qfg migrate --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-
|
|
803
|
+
$ qfg migrate --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-repo --dry-run
|
|
804
804
|
|
|
805
|
-
$ qfg migrate --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-
|
|
805
|
+
$ qfg migrate --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-repo --staging
|
|
806
806
|
```
|
|
807
807
|
|
|
808
|
-
_See code: [src/commands/migrate.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
808
|
+
_See code: [src/commands/migrate.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/migrate.ts)_
|
|
809
809
|
|
|
810
810
|
## `qfg migrate doctor`
|
|
811
811
|
|
|
@@ -843,7 +843,7 @@ EXAMPLES
|
|
|
843
843
|
$ qfg migrate doctor --json
|
|
844
844
|
```
|
|
845
845
|
|
|
846
|
-
_See code: [src/commands/migrate/doctor.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
846
|
+
_See code: [src/commands/migrate/doctor.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/migrate/doctor.ts)_
|
|
847
847
|
|
|
848
848
|
## `qfg migrate my-code`
|
|
849
849
|
|
|
@@ -875,7 +875,7 @@ EXAMPLES
|
|
|
875
875
|
$ qfg migrate my-code --dry-run
|
|
876
876
|
```
|
|
877
877
|
|
|
878
|
-
_See code: [src/commands/migrate/my-code.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
878
|
+
_See code: [src/commands/migrate/my-code.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/migrate/my-code.ts)_
|
|
879
879
|
|
|
880
880
|
## `qfg migrate status`
|
|
881
881
|
|
|
@@ -906,7 +906,7 @@ EXAMPLES
|
|
|
906
906
|
$ qfg migrate status --json
|
|
907
907
|
```
|
|
908
908
|
|
|
909
|
-
_See code: [src/commands/migrate/status.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
909
|
+
_See code: [src/commands/migrate/status.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/migrate/status.ts)_
|
|
910
910
|
|
|
911
911
|
## `qfg override [NAME] [VALUE]`
|
|
912
912
|
|
|
@@ -961,7 +961,7 @@ EXAMPLES
|
|
|
961
961
|
$ qfg override my.flag true --env=staging
|
|
962
962
|
```
|
|
963
963
|
|
|
964
|
-
_See code: [src/commands/override.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
964
|
+
_See code: [src/commands/override.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/override.ts)_
|
|
965
965
|
|
|
966
966
|
## `qfg pull`
|
|
967
967
|
|
|
@@ -1005,7 +1005,7 @@ EXAMPLES
|
|
|
1005
1005
|
$ qfg pull # uses QUONFIG_DIR env var
|
|
1006
1006
|
```
|
|
1007
1007
|
|
|
1008
|
-
_See code: [src/commands/pull.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1008
|
+
_See code: [src/commands/pull.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/pull.ts)_
|
|
1009
1009
|
|
|
1010
1010
|
## `qfg push`
|
|
1011
1011
|
|
|
@@ -1053,7 +1053,7 @@ EXAMPLES
|
|
|
1053
1053
|
$ qfg push --dir ./our-config --yes
|
|
1054
1054
|
```
|
|
1055
1055
|
|
|
1056
|
-
_See code: [src/commands/push.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1056
|
+
_See code: [src/commands/push.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/push.ts)_
|
|
1057
1057
|
|
|
1058
1058
|
## `qfg schema NAME`
|
|
1059
1059
|
|
|
@@ -1091,7 +1091,7 @@ EXAMPLES
|
|
|
1091
1091
|
$ qfg schema my-schema --set-json-schema=@schemas/my-schema.json --protected
|
|
1092
1092
|
```
|
|
1093
1093
|
|
|
1094
|
-
_See code: [src/commands/schema.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1094
|
+
_See code: [src/commands/schema.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/schema.ts)_
|
|
1095
1095
|
|
|
1096
1096
|
## `qfg sdk-key`
|
|
1097
1097
|
|
|
@@ -1118,7 +1118,7 @@ EXAMPLES
|
|
|
1118
1118
|
$ qfg sdk-key revoke <key-id>
|
|
1119
1119
|
```
|
|
1120
1120
|
|
|
1121
|
-
_See code: [src/commands/sdk-key.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1121
|
+
_See code: [src/commands/sdk-key.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/sdk-key.ts)_
|
|
1122
1122
|
|
|
1123
1123
|
## `qfg sdk-key create`
|
|
1124
1124
|
|
|
@@ -1150,7 +1150,7 @@ EXAMPLES
|
|
|
1150
1150
|
$ qfg sdk-key create --environment staging --type browser
|
|
1151
1151
|
```
|
|
1152
1152
|
|
|
1153
|
-
_See code: [src/commands/sdk-key/create.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1153
|
+
_See code: [src/commands/sdk-key/create.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/sdk-key/create.ts)_
|
|
1154
1154
|
|
|
1155
1155
|
## `qfg sdk-key list`
|
|
1156
1156
|
|
|
@@ -1179,7 +1179,7 @@ EXAMPLES
|
|
|
1179
1179
|
$ qfg sdk-key list --environment production
|
|
1180
1180
|
```
|
|
1181
1181
|
|
|
1182
|
-
_See code: [src/commands/sdk-key/list.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1182
|
+
_See code: [src/commands/sdk-key/list.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/sdk-key/list.ts)_
|
|
1183
1183
|
|
|
1184
1184
|
## `qfg sdk-key revoke KEYID`
|
|
1185
1185
|
|
|
@@ -1206,7 +1206,7 @@ EXAMPLES
|
|
|
1206
1206
|
$ qfg sdk-key revoke a1b2c3d4-e5f6-7890-abcd-ef1234567890
|
|
1207
1207
|
```
|
|
1208
1208
|
|
|
1209
|
-
_See code: [src/commands/sdk-key/revoke.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1209
|
+
_See code: [src/commands/sdk-key/revoke.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/sdk-key/revoke.ts)_
|
|
1210
1210
|
|
|
1211
1211
|
## `qfg set-default [NAME]`
|
|
1212
1212
|
|
|
@@ -1277,7 +1277,7 @@ EXAMPLES
|
|
|
1277
1277
|
$ qfg pull && qfg config-schema
|
|
1278
1278
|
```
|
|
1279
1279
|
|
|
1280
|
-
_See code: [src/commands/set-default.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1280
|
+
_See code: [src/commands/set-default.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/set-default.ts)_
|
|
1281
1281
|
|
|
1282
1282
|
## `qfg set-rollout [NAME]`
|
|
1283
1283
|
|
|
@@ -1354,7 +1354,7 @@ EXAMPLES
|
|
|
1354
1354
|
$ qfg set-rollout my.variant.flag --environment production --weights "a:33,b:33,c:34" --hash-by user.id
|
|
1355
1355
|
```
|
|
1356
1356
|
|
|
1357
|
-
_See code: [src/commands/set-rollout.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1357
|
+
_See code: [src/commands/set-rollout.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/set-rollout.ts)_
|
|
1358
1358
|
|
|
1359
1359
|
## `qfg sync`
|
|
1360
1360
|
|
|
@@ -1386,7 +1386,7 @@ EXAMPLES
|
|
|
1386
1386
|
$ qfg sync --watch --dir ./our-config --interval 30
|
|
1387
1387
|
```
|
|
1388
1388
|
|
|
1389
|
-
_See code: [src/commands/sync.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1389
|
+
_See code: [src/commands/sync.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/sync.ts)_
|
|
1390
1390
|
|
|
1391
1391
|
## `qfg toggle [NAME]`
|
|
1392
1392
|
|
|
@@ -1488,7 +1488,7 @@ EXAMPLES
|
|
|
1488
1488
|
$ qfg verify --json
|
|
1489
1489
|
```
|
|
1490
1490
|
|
|
1491
|
-
_See code: [src/commands/verify.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1491
|
+
_See code: [src/commands/verify.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/verify.ts)_
|
|
1492
1492
|
|
|
1493
1493
|
## `qfg whoami`
|
|
1494
1494
|
|
|
@@ -1511,7 +1511,7 @@ EXAMPLES
|
|
|
1511
1511
|
$ qfg whoami
|
|
1512
1512
|
```
|
|
1513
1513
|
|
|
1514
|
-
_See code: [src/commands/whoami.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1514
|
+
_See code: [src/commands/whoami.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/whoami.ts)_
|
|
1515
1515
|
|
|
1516
1516
|
## `qfg workspace`
|
|
1517
1517
|
|
|
@@ -1534,7 +1534,7 @@ EXAMPLES
|
|
|
1534
1534
|
$ qfg workspace
|
|
1535
1535
|
```
|
|
1536
1536
|
|
|
1537
|
-
_See code: [src/commands/workspace.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1537
|
+
_See code: [src/commands/workspace.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/workspace.ts)_
|
|
1538
1538
|
|
|
1539
1539
|
## `qfg workspace bootstrap`
|
|
1540
1540
|
|
|
@@ -1567,7 +1567,7 @@ EXAMPLES
|
|
|
1567
1567
|
$ qfg workspace bootstrap --dir ./our-config --skip-validate
|
|
1568
1568
|
```
|
|
1569
1569
|
|
|
1570
|
-
_See code: [src/commands/workspace/bootstrap.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1570
|
+
_See code: [src/commands/workspace/bootstrap.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/workspace/bootstrap.ts)_
|
|
1571
1571
|
|
|
1572
1572
|
## `qfg workspace create SLUG`
|
|
1573
1573
|
|
|
@@ -1601,7 +1601,7 @@ EXAMPLES
|
|
|
1601
1601
|
$ qfg workspace create my-team --org 11111111-1111-1111-1111-111111111111
|
|
1602
1602
|
```
|
|
1603
1603
|
|
|
1604
|
-
_See code: [src/commands/workspace/create.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1604
|
+
_See code: [src/commands/workspace/create.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/workspace/create.ts)_
|
|
1605
1605
|
|
|
1606
1606
|
## `qfg workspace switch [SLUG]`
|
|
1607
1607
|
|
|
@@ -1629,7 +1629,7 @@ EXAMPLES
|
|
|
1629
1629
|
$ qfg workspace switch acme/production
|
|
1630
1630
|
```
|
|
1631
1631
|
|
|
1632
|
-
_See code: [src/commands/workspace/switch.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1632
|
+
_See code: [src/commands/workspace/switch.ts](https://github.com/quonfig/cli/blob/v0.0.32/src/commands/workspace/switch.ts)_
|
|
1633
1633
|
<!-- commandsstop -->
|
|
1634
1634
|
|
|
1635
1635
|
## Local Development
|
package/dist/commands/migrate.js
CHANGED
|
@@ -13,7 +13,7 @@ import { mintGiteaToken } from '../util/gitea-api.js';
|
|
|
13
13
|
import { displayUrl } from '../util/git-ops.js';
|
|
14
14
|
import { resolveWorkspaceUuid } from '../util/resolve-workspace.js';
|
|
15
15
|
import { loadAuthConfig } from '../util/token-storage.js';
|
|
16
|
-
const DEFAULT_DIR = 'quonfig-
|
|
16
|
+
const DEFAULT_DIR = 'quonfig-repo';
|
|
17
17
|
export default class Migrate extends BaseCommand {
|
|
18
18
|
static description = 'Migrate flags and configs from a legacy feature-flag system into a Quonfig workspace.\n\n' +
|
|
19
19
|
'Currently supported sources:\n' +
|
|
@@ -21,11 +21,11 @@ export default class Migrate extends BaseCommand {
|
|
|
21
21
|
'See https://docs.quonfig.com/docs/migrating/from-launch for the step-by-step guide,\n' +
|
|
22
22
|
'and https://docs.quonfig.com/docs/migrating/troubleshooting when something goes sideways.';
|
|
23
23
|
static examples = [
|
|
24
|
-
'<%= config.bin %> <%= command.id %> --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-
|
|
24
|
+
'<%= config.bin %> <%= command.id %> --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-repo',
|
|
25
25
|
'<%= config.bin %> <%= command.id %> --from launch --api-key $LAUNCH_API_KEY --workspace acme-prod --push',
|
|
26
|
-
'<%= config.bin %> <%= command.id %> --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-
|
|
27
|
-
'<%= config.bin %> <%= command.id %> --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-
|
|
28
|
-
'<%= config.bin %> <%= command.id %> --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-
|
|
26
|
+
'<%= config.bin %> <%= command.id %> --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-repo --reset',
|
|
27
|
+
'<%= config.bin %> <%= command.id %> --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-repo --dry-run',
|
|
28
|
+
'<%= config.bin %> <%= command.id %> --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-repo --staging',
|
|
29
29
|
];
|
|
30
30
|
static flags = {
|
|
31
31
|
'api-key': Flags.string({
|
|
@@ -33,7 +33,7 @@ export default class Migrate extends BaseCommand {
|
|
|
33
33
|
env: 'LAUNCH_API_KEY',
|
|
34
34
|
}),
|
|
35
35
|
dir: Flags.string({
|
|
36
|
-
description: 'Target local workspace directory. Defaults to cwd if it looks like a Quonfig workspace, otherwise ./quonfig-
|
|
36
|
+
description: 'Target local workspace directory. Defaults to cwd if it looks like a Quonfig workspace, otherwise ./quonfig-repo.',
|
|
37
37
|
}),
|
|
38
38
|
'dry-run': Flags.boolean({
|
|
39
39
|
default: false,
|
package/dist/commands/pull.d.ts
CHANGED
|
@@ -8,6 +8,17 @@ export default class Pull extends BaseCommand {
|
|
|
8
8
|
workspace: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
9
9
|
};
|
|
10
10
|
run(): Promise<JsonObj | void>;
|
|
11
|
+
/**
|
|
12
|
+
* Wraps `readWorkspaceSlug` so a legacy bare-slug value (`"workspace":
|
|
13
|
+
* "foo"` instead of `"workspace": "org/foo"`) reads as `undefined`
|
|
14
|
+
* rather than throwing. The caller then takes the "no pin set" branch
|
|
15
|
+
* and overwrites with the canonical form, completing the migration.
|
|
16
|
+
*
|
|
17
|
+
* Any other parse error still resolves to `undefined` here (and is
|
|
18
|
+
* verbose-logged) — backfill is non-fatal; the next push surfaces the
|
|
19
|
+
* real diagnosis.
|
|
20
|
+
*/
|
|
21
|
+
private readPinTolerant;
|
|
11
22
|
/**
|
|
12
23
|
* Local-only backfill of the `workspace` pin in `quonfig.json`.
|
|
13
24
|
*
|
package/dist/commands/pull.js
CHANGED
|
@@ -134,6 +134,25 @@ CLI shortcuts (no JSON editing needed for simple cases):
|
|
|
134
134
|
await this.backfillWorkspacePin(resolvedDir, tokenEntry, workspaceId, orgSlug);
|
|
135
135
|
return { dir: resolvedDir, workspaceId };
|
|
136
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* Wraps `readWorkspaceSlug` so a legacy bare-slug value (`"workspace":
|
|
139
|
+
* "foo"` instead of `"workspace": "org/foo"`) reads as `undefined`
|
|
140
|
+
* rather than throwing. The caller then takes the "no pin set" branch
|
|
141
|
+
* and overwrites with the canonical form, completing the migration.
|
|
142
|
+
*
|
|
143
|
+
* Any other parse error still resolves to `undefined` here (and is
|
|
144
|
+
* verbose-logged) — backfill is non-fatal; the next push surfaces the
|
|
145
|
+
* real diagnosis.
|
|
146
|
+
*/
|
|
147
|
+
async readPinTolerant(dir) {
|
|
148
|
+
try {
|
|
149
|
+
return await readWorkspaceSlug(dir);
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
this.verboseLog('Pull', `quonfig.json workspace pin needs migration: ${String(error)}`);
|
|
153
|
+
return undefined;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
137
156
|
/**
|
|
138
157
|
* Local-only backfill of the `workspace` pin in `quonfig.json`.
|
|
139
158
|
*
|
|
@@ -165,18 +184,15 @@ CLI shortcuts (no JSON editing needed for simple cases):
|
|
|
165
184
|
return;
|
|
166
185
|
}
|
|
167
186
|
// The pin is stored as `<org-slug>/<workspace-slug>`. The backend's
|
|
168
|
-
//
|
|
169
|
-
//
|
|
170
|
-
//
|
|
171
|
-
//
|
|
172
|
-
//
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
this.verboseLog('Pull', `Backend workspaceSlug "${backendSlug}" is not in <org>/<ws> form; skipping pin backfill.`);
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
187
|
+
// mint-token still returns the bare workspace component; we already
|
|
188
|
+
// resolved the org separately during workspace lookup, so combine the
|
|
189
|
+
// two halves locally. If the backend ever upgrades to returning slash
|
|
190
|
+
// form, tryParseWorkspacePin handles it; the explicit org overrides
|
|
191
|
+
// any mismatch in favor of the workspace we actually authenticated as.
|
|
192
|
+
const parsedBackend = tryParseWorkspacePin(backendSlug);
|
|
193
|
+
const backendPin = parsedBackend ?? { orgSlug, workspaceSlug: backendSlug };
|
|
178
194
|
try {
|
|
179
|
-
const existingPin = await
|
|
195
|
+
const existingPin = await this.readPinTolerant(dir);
|
|
180
196
|
if (!existingPin) {
|
|
181
197
|
await writeWorkspaceSlug(dir, backendPin);
|
|
182
198
|
const formatted = `${backendPin.orgSlug}/${backendPin.workspaceSlug}`;
|
package/dist/commands/push.js
CHANGED
package/dist/commands/whoami.js
CHANGED
|
@@ -26,12 +26,15 @@ export default class Whoami extends BaseCommand {
|
|
|
26
26
|
}
|
|
27
27
|
const activeOrgId = await this.resolveActiveOrgId(store.defaultOrgId);
|
|
28
28
|
const memberships = await this.fetchOrganizations();
|
|
29
|
-
const localOrgs = Object.entries(store.tokensByOrg).map(([orgId, t]) =>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
const localOrgs = Object.entries(store.tokensByOrg).map(([orgId, t]) => {
|
|
30
|
+
this.verboseLog('whoami: token expiry', { orgSlug: t.org_slug ?? orgId, ...describeExpiry(t) });
|
|
31
|
+
return {
|
|
32
|
+
workosOrgId: orgId,
|
|
33
|
+
slug: t.org_slug ?? orgId,
|
|
34
|
+
name: t.org_name ?? t.org_slug ?? orgId,
|
|
35
|
+
role: '—',
|
|
36
|
+
};
|
|
37
|
+
});
|
|
35
38
|
const merged = mergeMemberships(localOrgs, memberships);
|
|
36
39
|
this.log(`Logged in as: ${userEmail || 'Unknown'}`);
|
|
37
40
|
this.log('Orgs:');
|
|
@@ -143,6 +146,25 @@ function mergeMemberships(local, server) {
|
|
|
143
146
|
merged.set(o.workosOrgId, o);
|
|
144
147
|
return [...merged.values()].sort((a, b) => a.slug.localeCompare(b.slug));
|
|
145
148
|
}
|
|
149
|
+
/**
|
|
150
|
+
* Verbose-only diagnostic: reports the access token's remaining lifetime.
|
|
151
|
+
* Access tokens are short-lived (~5 min) and `getValidAccessToken` refreshes
|
|
152
|
+
* them transparently on next use, so this is informational, not actionable.
|
|
153
|
+
* The hot stuff — actual refresh failures — is logged from get-valid-token.
|
|
154
|
+
*/
|
|
155
|
+
function describeExpiry(tokens) {
|
|
156
|
+
let expMs = tokens.expires_at;
|
|
157
|
+
try {
|
|
158
|
+
const payload = decodeJWT(tokens.access_token);
|
|
159
|
+
if (typeof payload.exp === 'number')
|
|
160
|
+
expMs = payload.exp * 1000;
|
|
161
|
+
}
|
|
162
|
+
catch {
|
|
163
|
+
/* keep stored expires_at */
|
|
164
|
+
}
|
|
165
|
+
const delta = expMs - Date.now();
|
|
166
|
+
return { expired: delta <= 0, expiresAt: expMs, deltaMs: delta };
|
|
167
|
+
}
|
|
146
168
|
function pickAnyOrgId(store) {
|
|
147
169
|
if (store.defaultOrgId && store.tokensByOrg[store.defaultOrgId])
|
|
148
170
|
return store.defaultOrgId;
|
|
@@ -55,10 +55,16 @@ export default class WorkspaceCreate extends BaseCommand {
|
|
|
55
55
|
const { workosOrgId, orgSlug } = orgResolution;
|
|
56
56
|
let accessToken;
|
|
57
57
|
try {
|
|
58
|
-
accessToken = await getValidAccessToken(workosOrgId);
|
|
58
|
+
accessToken = await getValidAccessToken(workosOrgId, this.verboseLog);
|
|
59
59
|
}
|
|
60
|
-
catch {
|
|
61
|
-
|
|
60
|
+
catch (error) {
|
|
61
|
+
// Surface the underlying token error (e.g. "Token refresh failed for
|
|
62
|
+
// org X: invalid_grant — Refresh token already exchanged") so users
|
|
63
|
+
// and agents can distinguish "never logged in" from "session went
|
|
64
|
+
// stale and refresh was rejected" — both used to read "Not logged in".
|
|
65
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
66
|
+
const hint = detail.includes('qfg login') ? '' : ' Run `qfg login` to re-authenticate.';
|
|
67
|
+
return this.err(`${detail}${hint}`);
|
|
62
68
|
}
|
|
63
69
|
const apiUrl = getApiUrl();
|
|
64
70
|
// The server expects organizationSlug (it resolves to the local org
|
package/dist/push/run-push.d.ts
CHANGED
|
@@ -88,6 +88,14 @@ export interface RunPushInput {
|
|
|
88
88
|
message?: string;
|
|
89
89
|
/** `--no-pin-write` — do not offer to write the slug pin into quonfig.json. */
|
|
90
90
|
noPinWrite: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Caller's resolved org slug for this workspace. Used to construct the
|
|
93
|
+
* `<org>/<ws>` pin when the backend's mint-token returns just the bare
|
|
94
|
+
* workspace component (current backend behavior). Optional in tests; if
|
|
95
|
+
* omitted, pin backfill only runs when the backend already returns the
|
|
96
|
+
* slash form.
|
|
97
|
+
*/
|
|
98
|
+
orgSlug?: string;
|
|
91
99
|
/** `--workspace` flag, or the active profile's workspace UUID. Must be non-empty. */
|
|
92
100
|
requestedTarget: string;
|
|
93
101
|
/** `--skip-validate` — suppress the validate step. */
|
package/dist/push/run-push.js
CHANGED
|
@@ -72,7 +72,15 @@ export async function runPush(input, deps) {
|
|
|
72
72
|
// the backend's canonical identity) but we want the pin/origin up front.
|
|
73
73
|
// The pin is `<org>/<ws>`; identity-check still operates on the workspace
|
|
74
74
|
// component until backend responses carry the org slug too (qfg-kr7 epic).
|
|
75
|
-
|
|
75
|
+
// A legacy bare-slug pin is treated as "no pin set" so the post-push
|
|
76
|
+
// backfill can rewrite it to the canonical form.
|
|
77
|
+
let repoPin;
|
|
78
|
+
try {
|
|
79
|
+
repoPin = await readWorkspaceSlug(input.dir);
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
repoPin = undefined;
|
|
83
|
+
}
|
|
76
84
|
const repoPinSlug = repoPin?.workspaceSlug;
|
|
77
85
|
const hasGit = await deps.gitOps.isGitRepo(input.dir);
|
|
78
86
|
const remoteOriginUrl = hasGit ? await deps.gitOps.getRemoteOriginUrl(input.dir) : undefined;
|
|
@@ -200,12 +208,13 @@ export async function runPush(input, deps) {
|
|
|
200
208
|
throw new PushFatalError(`Push rejected by server: ${result.message}`, 'BAD_REQUEST');
|
|
201
209
|
}
|
|
202
210
|
if (unpinned && !input.noPinWrite) {
|
|
203
|
-
//
|
|
204
|
-
// it
|
|
205
|
-
//
|
|
206
|
-
//
|
|
207
|
-
//
|
|
208
|
-
const
|
|
211
|
+
// The backend's mint-token still returns the bare workspace component;
|
|
212
|
+
// combine it with the caller-supplied orgSlug locally. If the backend
|
|
213
|
+
// ever upgrades to slash form, tryParseWorkspacePin handles that case
|
|
214
|
+
// and we use its parts directly. Without either signal, skip — the
|
|
215
|
+
// pin is advisory and a partial slash form would be worse than absent.
|
|
216
|
+
const parsedBackend = tryParseWorkspacePin(backend.workspaceSlug);
|
|
217
|
+
const backendPin = parsedBackend ?? (input.orgSlug ? { orgSlug: input.orgSlug, workspaceSlug: backend.workspaceSlug } : undefined);
|
|
209
218
|
if (backendPin) {
|
|
210
219
|
try {
|
|
211
220
|
await writeWorkspaceSlug(input.dir, backendPin);
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "0.0.
|
|
1
|
+
declare const _default: "0.0.32";
|
|
2
2
|
export default _default;
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// AUTO-GENERATED from package.json by scripts/generate-version.mjs — do not edit.
|
|
2
|
-
export default '0.0.
|
|
2
|
+
export default '0.0.32';
|
package/oclif.manifest.json
CHANGED
|
@@ -1085,11 +1085,11 @@
|
|
|
1085
1085
|
"args": {},
|
|
1086
1086
|
"description": "Migrate flags and configs from a legacy feature-flag system into a Quonfig workspace.\n\nCurrently supported sources:\n launch — Reforge Launch (ported from launch-migrator)\n\nSee https://docs.quonfig.com/docs/migrating/from-launch for the step-by-step guide,\nand https://docs.quonfig.com/docs/migrating/troubleshooting when something goes sideways.",
|
|
1087
1087
|
"examples": [
|
|
1088
|
-
"<%= config.bin %> <%= command.id %> --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-
|
|
1088
|
+
"<%= config.bin %> <%= command.id %> --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-repo",
|
|
1089
1089
|
"<%= config.bin %> <%= command.id %> --from launch --api-key $LAUNCH_API_KEY --workspace acme-prod --push",
|
|
1090
|
-
"<%= config.bin %> <%= command.id %> --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-
|
|
1091
|
-
"<%= config.bin %> <%= command.id %> --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-
|
|
1092
|
-
"<%= config.bin %> <%= command.id %> --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-
|
|
1090
|
+
"<%= config.bin %> <%= command.id %> --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-repo --reset",
|
|
1091
|
+
"<%= config.bin %> <%= command.id %> --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-repo --dry-run",
|
|
1092
|
+
"<%= config.bin %> <%= command.id %> --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-repo --staging"
|
|
1093
1093
|
],
|
|
1094
1094
|
"flags": {
|
|
1095
1095
|
"json": {
|
|
@@ -1130,7 +1130,7 @@
|
|
|
1130
1130
|
"type": "option"
|
|
1131
1131
|
},
|
|
1132
1132
|
"dir": {
|
|
1133
|
-
"description": "Target local workspace directory. Defaults to cwd if it looks like a Quonfig workspace, otherwise ./quonfig-
|
|
1133
|
+
"description": "Target local workspace directory. Defaults to cwd if it looks like a Quonfig workspace, otherwise ./quonfig-repo.",
|
|
1134
1134
|
"name": "dir",
|
|
1135
1135
|
"hasDynamicHelp": false,
|
|
1136
1136
|
"multiple": false,
|
|
@@ -2910,5 +2910,5 @@
|
|
|
2910
2910
|
]
|
|
2911
2911
|
}
|
|
2912
2912
|
},
|
|
2913
|
-
"version": "0.0.
|
|
2913
|
+
"version": "0.0.32"
|
|
2914
2914
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"packageManager": "yarn@4.11.0+sha512.4e54aeace9141df2f0177c266b05ec50dc044638157dae128c471ba65994ac802122d7ab35bcd9e81641228b7dcf24867d28e750e0bcae8a05277d600008ad54",
|
|
3
3
|
"name": "@quonfig/cli",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.32",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/quonfig/cli/issues"
|
|
7
7
|
},
|