@quonfig/cli 0.0.21 → 0.0.23
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 +82 -35
- package/dist/commands/delete.d.ts +13 -0
- package/dist/commands/delete.js +114 -0
- package/dist/commands/pull.js +2 -2
- package/dist/commands/push.d.ts +6 -14
- package/dist/commands/push.js +54 -99
- package/dist/init/schema.js +4 -2
- package/dist/push/bare-path-diff.js +19 -17
- package/dist/push/config-push-client.d.ts +18 -0
- package/dist/push/config-push-client.js +82 -0
- package/dist/push/diff-summary.d.ts +11 -0
- package/dist/push/diff-summary.js +1 -8
- package/dist/push/run-push.d.ts +53 -13
- package/dist/push/run-push.js +44 -132
- package/dist/quonfig.js +2 -1
- package/dist/util/domain-urls.d.ts +1 -0
- package/dist/util/domain-urls.js +7 -0
- package/dist/util/gitea-token-storage.js +2 -2
- package/dist/util/quonfig-home.d.ts +6 -0
- package/dist/util/quonfig-home.js +8 -0
- package/dist/util/token-storage.js +2 -2
- package/dist/verify/validate.js +2 -2
- package/oclif.manifest.json +88 -1
- 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.23 linux-x64 node-v24.4.1
|
|
18
18
|
$ qfg --help [COMMAND]
|
|
19
19
|
USAGE
|
|
20
20
|
$ qfg COMMAND
|
|
@@ -27,6 +27,7 @@ USAGE
|
|
|
27
27
|
<!-- commands -->
|
|
28
28
|
* [`qfg config-schema`](#qfg-config-schema)
|
|
29
29
|
* [`qfg create NAME`](#qfg-create-name)
|
|
30
|
+
* [`qfg delete NAME`](#qfg-delete-name)
|
|
30
31
|
* [`qfg flag info [NAME]`](#qfg-flag-info-name)
|
|
31
32
|
* [`qfg flag list`](#qfg-flag-list)
|
|
32
33
|
* [`qfg flag show [NAME]`](#qfg-flag-show-name)
|
|
@@ -91,7 +92,7 @@ EXAMPLES
|
|
|
91
92
|
$ qfg config-schema --json-schema # full JSON Schema document (copy into your editor)
|
|
92
93
|
```
|
|
93
94
|
|
|
94
|
-
_See code: [src/commands/config-schema.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
95
|
+
_See code: [src/commands/config-schema.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/config-schema.ts)_
|
|
95
96
|
|
|
96
97
|
## `qfg create NAME`
|
|
97
98
|
|
|
@@ -176,7 +177,53 @@ EXAMPLES
|
|
|
176
177
|
$ qfg set-rollout my.new.flag --environment production --true-percent 20
|
|
177
178
|
```
|
|
178
179
|
|
|
179
|
-
_See code: [src/commands/create.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
180
|
+
_See code: [src/commands/create.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/create.ts)_
|
|
181
|
+
|
|
182
|
+
## `qfg delete NAME`
|
|
183
|
+
|
|
184
|
+
Delete a flag, config, or log-level from the workspace.
|
|
185
|
+
|
|
186
|
+
```
|
|
187
|
+
USAGE
|
|
188
|
+
$ qfg delete NAME [--json] [--interactive] [--no-color] [--verbose] [-w <value>] [--yes]
|
|
189
|
+
|
|
190
|
+
ARGUMENTS
|
|
191
|
+
NAME flag/config/log-level key to delete
|
|
192
|
+
|
|
193
|
+
FLAGS
|
|
194
|
+
--yes skip confirmation prompt
|
|
195
|
+
|
|
196
|
+
GLOBAL FLAGS
|
|
197
|
+
-w, --workspace=<value> Workspace slug to use (overrides QUONFIG_WORKSPACE env var and saved default)
|
|
198
|
+
--[no-]interactive Force interactive mode
|
|
199
|
+
--json Format output as json.
|
|
200
|
+
--no-color Do not colorize output
|
|
201
|
+
--verbose Verbose output
|
|
202
|
+
|
|
203
|
+
DESCRIPTION
|
|
204
|
+
Delete a flag, config, or log-level from the workspace.
|
|
205
|
+
|
|
206
|
+
DESTRUCTIVE — removes the underlying JSON file from the workspace git repo
|
|
207
|
+
and commits with the actor's identity. The commit history preserves the
|
|
208
|
+
prior content; this is a hard-delete on the file but a soft-delete on
|
|
209
|
+
history.
|
|
210
|
+
|
|
211
|
+
Confirmation is required:
|
|
212
|
+
--yes skip the prompt (for scripts and CI)
|
|
213
|
+
interactive (default) you'll be asked to type the key name back
|
|
214
|
+
|
|
215
|
+
Examples
|
|
216
|
+
qfg delete my.flag --yes
|
|
217
|
+
qfg delete my.flag # interactive: type the key back to confirm
|
|
218
|
+
qfg delete my.config --yes
|
|
219
|
+
|
|
220
|
+
EXAMPLES
|
|
221
|
+
$ qfg delete my.flag --yes
|
|
222
|
+
|
|
223
|
+
$ qfg delete my.config --yes
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
_See code: [src/commands/delete.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/delete.ts)_
|
|
180
227
|
|
|
181
228
|
## `qfg flag info [NAME]`
|
|
182
229
|
|
|
@@ -379,7 +426,7 @@ EXAMPLES
|
|
|
379
426
|
$ qfg generate --targets node-ts -o ./dist # combine with targets
|
|
380
427
|
```
|
|
381
428
|
|
|
382
|
-
_See code: [src/commands/generate.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
429
|
+
_See code: [src/commands/generate.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/generate.ts)_
|
|
383
430
|
|
|
384
431
|
## `qfg generate-new-hex-key`
|
|
385
432
|
|
|
@@ -402,7 +449,7 @@ EXAMPLES
|
|
|
402
449
|
$ qfg generate-new-hex-key
|
|
403
450
|
```
|
|
404
451
|
|
|
405
|
-
_See code: [src/commands/generate-new-hex-key.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
452
|
+
_See code: [src/commands/generate-new-hex-key.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/generate-new-hex-key.ts)_
|
|
406
453
|
|
|
407
454
|
## `qfg get [NAME]`
|
|
408
455
|
|
|
@@ -434,7 +481,7 @@ EXAMPLES
|
|
|
434
481
|
$ qfg get my.config.name --environment=production
|
|
435
482
|
```
|
|
436
483
|
|
|
437
|
-
_See code: [src/commands/get.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
484
|
+
_See code: [src/commands/get.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/get.ts)_
|
|
438
485
|
|
|
439
486
|
## `qfg info [NAME]`
|
|
440
487
|
|
|
@@ -482,7 +529,7 @@ EXAMPLES
|
|
|
482
529
|
$ qfg info my.config.name --exclude-evaluations # skip 24h stats
|
|
483
530
|
```
|
|
484
531
|
|
|
485
|
-
_See code: [src/commands/info.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
532
|
+
_See code: [src/commands/info.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/info.ts)_
|
|
486
533
|
|
|
487
534
|
## `qfg init [DIRECTORY]`
|
|
488
535
|
|
|
@@ -522,7 +569,7 @@ EXAMPLES
|
|
|
522
569
|
$ qfg init --dry-run
|
|
523
570
|
```
|
|
524
571
|
|
|
525
|
-
_See code: [src/commands/init.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
572
|
+
_See code: [src/commands/init.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/init.ts)_
|
|
526
573
|
|
|
527
574
|
## `qfg interactive`
|
|
528
575
|
|
|
@@ -552,7 +599,7 @@ EXAMPLES
|
|
|
552
599
|
$ qfg
|
|
553
600
|
```
|
|
554
601
|
|
|
555
|
-
_See code: [src/commands/interactive.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
602
|
+
_See code: [src/commands/interactive.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/interactive.ts)_
|
|
556
603
|
|
|
557
604
|
## `qfg list`
|
|
558
605
|
|
|
@@ -592,7 +639,7 @@ EXAMPLES
|
|
|
592
639
|
$ qfg list --feature-flags
|
|
593
640
|
```
|
|
594
641
|
|
|
595
|
-
_See code: [src/commands/list.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
642
|
+
_See code: [src/commands/list.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/list.ts)_
|
|
596
643
|
|
|
597
644
|
## `qfg log-level NAME`
|
|
598
645
|
|
|
@@ -657,7 +704,7 @@ EXAMPLES
|
|
|
657
704
|
$ qfg log-level log-level.my-app --target=Chatty --value=INFO --environment=production
|
|
658
705
|
```
|
|
659
706
|
|
|
660
|
-
_See code: [src/commands/log-level.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
707
|
+
_See code: [src/commands/log-level.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/log-level.ts)_
|
|
661
708
|
|
|
662
709
|
## `qfg login`
|
|
663
710
|
|
|
@@ -682,7 +729,7 @@ EXAMPLES
|
|
|
682
729
|
$ qfg login --profile myprofile
|
|
683
730
|
```
|
|
684
731
|
|
|
685
|
-
_See code: [src/commands/login.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
732
|
+
_See code: [src/commands/login.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/login.ts)_
|
|
686
733
|
|
|
687
734
|
## `qfg logout`
|
|
688
735
|
|
|
@@ -705,7 +752,7 @@ EXAMPLES
|
|
|
705
752
|
$ qfg logout
|
|
706
753
|
```
|
|
707
754
|
|
|
708
|
-
_See code: [src/commands/logout.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
755
|
+
_See code: [src/commands/logout.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/logout.ts)_
|
|
709
756
|
|
|
710
757
|
## `qfg mcp`
|
|
711
758
|
|
|
@@ -738,7 +785,7 @@ EXAMPLES
|
|
|
738
785
|
$ qfg mcp --url http://local-app.quonfig-staging.com:3003/api/v1/mcp
|
|
739
786
|
```
|
|
740
787
|
|
|
741
|
-
_See code: [src/commands/mcp.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
788
|
+
_See code: [src/commands/mcp.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/mcp.ts)_
|
|
742
789
|
|
|
743
790
|
## `qfg migrate`
|
|
744
791
|
|
|
@@ -792,7 +839,7 @@ EXAMPLES
|
|
|
792
839
|
$ qfg migrate --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-config --staging
|
|
793
840
|
```
|
|
794
841
|
|
|
795
|
-
_See code: [src/commands/migrate.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
842
|
+
_See code: [src/commands/migrate.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/migrate.ts)_
|
|
796
843
|
|
|
797
844
|
## `qfg migrate doctor`
|
|
798
845
|
|
|
@@ -830,7 +877,7 @@ EXAMPLES
|
|
|
830
877
|
$ qfg migrate doctor --json
|
|
831
878
|
```
|
|
832
879
|
|
|
833
|
-
_See code: [src/commands/migrate/doctor.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
880
|
+
_See code: [src/commands/migrate/doctor.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/migrate/doctor.ts)_
|
|
834
881
|
|
|
835
882
|
## `qfg migrate my-code`
|
|
836
883
|
|
|
@@ -862,7 +909,7 @@ EXAMPLES
|
|
|
862
909
|
$ qfg migrate my-code --dry-run
|
|
863
910
|
```
|
|
864
911
|
|
|
865
|
-
_See code: [src/commands/migrate/my-code.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
912
|
+
_See code: [src/commands/migrate/my-code.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/migrate/my-code.ts)_
|
|
866
913
|
|
|
867
914
|
## `qfg migrate status`
|
|
868
915
|
|
|
@@ -893,7 +940,7 @@ EXAMPLES
|
|
|
893
940
|
$ qfg migrate status --json
|
|
894
941
|
```
|
|
895
942
|
|
|
896
|
-
_See code: [src/commands/migrate/status.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
943
|
+
_See code: [src/commands/migrate/status.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/migrate/status.ts)_
|
|
897
944
|
|
|
898
945
|
## `qfg override [NAME] [VALUE]`
|
|
899
946
|
|
|
@@ -948,7 +995,7 @@ EXAMPLES
|
|
|
948
995
|
$ qfg override my.flag true --env=staging
|
|
949
996
|
```
|
|
950
997
|
|
|
951
|
-
_See code: [src/commands/override.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
998
|
+
_See code: [src/commands/override.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/override.ts)_
|
|
952
999
|
|
|
953
1000
|
## `qfg pull`
|
|
954
1001
|
|
|
@@ -992,7 +1039,7 @@ EXAMPLES
|
|
|
992
1039
|
$ qfg pull # uses QUONFIG_DIR env var
|
|
993
1040
|
```
|
|
994
1041
|
|
|
995
|
-
_See code: [src/commands/pull.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1042
|
+
_See code: [src/commands/pull.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/pull.ts)_
|
|
996
1043
|
|
|
997
1044
|
## `qfg push`
|
|
998
1045
|
|
|
@@ -1040,7 +1087,7 @@ EXAMPLES
|
|
|
1040
1087
|
$ qfg push --dir ./our-config --yes
|
|
1041
1088
|
```
|
|
1042
1089
|
|
|
1043
|
-
_See code: [src/commands/push.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1090
|
+
_See code: [src/commands/push.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/push.ts)_
|
|
1044
1091
|
|
|
1045
1092
|
## `qfg schema NAME`
|
|
1046
1093
|
|
|
@@ -1078,7 +1125,7 @@ EXAMPLES
|
|
|
1078
1125
|
$ qfg schema my-schema --set-json-schema=@schemas/my-schema.json --protected
|
|
1079
1126
|
```
|
|
1080
1127
|
|
|
1081
|
-
_See code: [src/commands/schema.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1128
|
+
_See code: [src/commands/schema.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/schema.ts)_
|
|
1082
1129
|
|
|
1083
1130
|
## `qfg sdk-key`
|
|
1084
1131
|
|
|
@@ -1105,7 +1152,7 @@ EXAMPLES
|
|
|
1105
1152
|
$ qfg sdk-key revoke <key-id>
|
|
1106
1153
|
```
|
|
1107
1154
|
|
|
1108
|
-
_See code: [src/commands/sdk-key.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1155
|
+
_See code: [src/commands/sdk-key.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/sdk-key.ts)_
|
|
1109
1156
|
|
|
1110
1157
|
## `qfg sdk-key create`
|
|
1111
1158
|
|
|
@@ -1137,7 +1184,7 @@ EXAMPLES
|
|
|
1137
1184
|
$ qfg sdk-key create --environment staging --type browser
|
|
1138
1185
|
```
|
|
1139
1186
|
|
|
1140
|
-
_See code: [src/commands/sdk-key/create.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1187
|
+
_See code: [src/commands/sdk-key/create.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/sdk-key/create.ts)_
|
|
1141
1188
|
|
|
1142
1189
|
## `qfg sdk-key list`
|
|
1143
1190
|
|
|
@@ -1166,7 +1213,7 @@ EXAMPLES
|
|
|
1166
1213
|
$ qfg sdk-key list --environment production
|
|
1167
1214
|
```
|
|
1168
1215
|
|
|
1169
|
-
_See code: [src/commands/sdk-key/list.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1216
|
+
_See code: [src/commands/sdk-key/list.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/sdk-key/list.ts)_
|
|
1170
1217
|
|
|
1171
1218
|
## `qfg sdk-key revoke KEYID`
|
|
1172
1219
|
|
|
@@ -1193,7 +1240,7 @@ EXAMPLES
|
|
|
1193
1240
|
$ qfg sdk-key revoke a1b2c3d4-e5f6-7890-abcd-ef1234567890
|
|
1194
1241
|
```
|
|
1195
1242
|
|
|
1196
|
-
_See code: [src/commands/sdk-key/revoke.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1243
|
+
_See code: [src/commands/sdk-key/revoke.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/sdk-key/revoke.ts)_
|
|
1197
1244
|
|
|
1198
1245
|
## `qfg set-default [NAME]`
|
|
1199
1246
|
|
|
@@ -1264,7 +1311,7 @@ EXAMPLES
|
|
|
1264
1311
|
$ qfg pull && qfg config-schema
|
|
1265
1312
|
```
|
|
1266
1313
|
|
|
1267
|
-
_See code: [src/commands/set-default.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1314
|
+
_See code: [src/commands/set-default.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/set-default.ts)_
|
|
1268
1315
|
|
|
1269
1316
|
## `qfg set-rollout [NAME]`
|
|
1270
1317
|
|
|
@@ -1341,7 +1388,7 @@ EXAMPLES
|
|
|
1341
1388
|
$ qfg set-rollout my.variant.flag --environment production --weights "a:33,b:33,c:34" --hash-by user.id
|
|
1342
1389
|
```
|
|
1343
1390
|
|
|
1344
|
-
_See code: [src/commands/set-rollout.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1391
|
+
_See code: [src/commands/set-rollout.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/set-rollout.ts)_
|
|
1345
1392
|
|
|
1346
1393
|
## `qfg sync`
|
|
1347
1394
|
|
|
@@ -1373,7 +1420,7 @@ EXAMPLES
|
|
|
1373
1420
|
$ qfg sync --watch --dir ./our-config --interval 30
|
|
1374
1421
|
```
|
|
1375
1422
|
|
|
1376
|
-
_See code: [src/commands/sync.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1423
|
+
_See code: [src/commands/sync.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/sync.ts)_
|
|
1377
1424
|
|
|
1378
1425
|
## `qfg toggle [NAME]`
|
|
1379
1426
|
|
|
@@ -1475,7 +1522,7 @@ EXAMPLES
|
|
|
1475
1522
|
$ qfg verify --json
|
|
1476
1523
|
```
|
|
1477
1524
|
|
|
1478
|
-
_See code: [src/commands/verify.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1525
|
+
_See code: [src/commands/verify.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/verify.ts)_
|
|
1479
1526
|
|
|
1480
1527
|
## `qfg whoami`
|
|
1481
1528
|
|
|
@@ -1498,7 +1545,7 @@ EXAMPLES
|
|
|
1498
1545
|
$ qfg whoami
|
|
1499
1546
|
```
|
|
1500
1547
|
|
|
1501
|
-
_See code: [src/commands/whoami.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1548
|
+
_See code: [src/commands/whoami.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/whoami.ts)_
|
|
1502
1549
|
|
|
1503
1550
|
## `qfg workspace`
|
|
1504
1551
|
|
|
@@ -1521,7 +1568,7 @@ EXAMPLES
|
|
|
1521
1568
|
$ qfg workspace
|
|
1522
1569
|
```
|
|
1523
1570
|
|
|
1524
|
-
_See code: [src/commands/workspace.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1571
|
+
_See code: [src/commands/workspace.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/workspace.ts)_
|
|
1525
1572
|
|
|
1526
1573
|
## `qfg workspace bootstrap`
|
|
1527
1574
|
|
|
@@ -1554,7 +1601,7 @@ EXAMPLES
|
|
|
1554
1601
|
$ qfg workspace bootstrap --dir ./our-config --skip-validate
|
|
1555
1602
|
```
|
|
1556
1603
|
|
|
1557
|
-
_See code: [src/commands/workspace/bootstrap.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1604
|
+
_See code: [src/commands/workspace/bootstrap.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/workspace/bootstrap.ts)_
|
|
1558
1605
|
|
|
1559
1606
|
## `qfg workspace create SLUG`
|
|
1560
1607
|
|
|
@@ -1588,7 +1635,7 @@ EXAMPLES
|
|
|
1588
1635
|
$ qfg workspace create my-team --org 11111111-1111-1111-1111-111111111111
|
|
1589
1636
|
```
|
|
1590
1637
|
|
|
1591
|
-
_See code: [src/commands/workspace/create.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1638
|
+
_See code: [src/commands/workspace/create.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/workspace/create.ts)_
|
|
1592
1639
|
|
|
1593
1640
|
## `qfg workspace switch [SLUG]`
|
|
1594
1641
|
|
|
@@ -1616,7 +1663,7 @@ EXAMPLES
|
|
|
1616
1663
|
$ qfg workspace switch my-workspace-slug
|
|
1617
1664
|
```
|
|
1618
1665
|
|
|
1619
|
-
_See code: [src/commands/workspace/switch.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1666
|
+
_See code: [src/commands/workspace/switch.ts](https://github.com/quonfig/cli/blob/v0.0.23/src/commands/workspace/switch.ts)_
|
|
1620
1667
|
<!-- commandsstop -->
|
|
1621
1668
|
|
|
1622
1669
|
## Local Development
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { APICommand } from '../index.js';
|
|
2
|
+
import type { JsonObj } from '../result.js';
|
|
3
|
+
export default class Delete extends APICommand {
|
|
4
|
+
static args: {
|
|
5
|
+
name: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: string[];
|
|
9
|
+
static flags: {
|
|
10
|
+
yes: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<JsonObj | void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { APICommand } from '../index.js';
|
|
3
|
+
import { confirmTypedSlug } from '../push/confirm.js';
|
|
4
|
+
import isInteractive from '../util/is-interactive.js';
|
|
5
|
+
import { checkmark } from '../util/color.js';
|
|
6
|
+
import { loadTokens } from '../util/token-storage.js';
|
|
7
|
+
const DELETE_ROUTES = {
|
|
8
|
+
config: { endpoint: '/api/v1/configs/delete', keyField: 'configKey' },
|
|
9
|
+
feature_flag: { endpoint: '/api/v1/flags/delete', keyField: 'flagKey' },
|
|
10
|
+
log_level: { endpoint: '/api/v1/logLevels/delete', keyField: 'logLevelKey' },
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Parse the fresh SHA out of a 409 conflict message of the form
|
|
14
|
+
* "<path> was modified (expected <oldSha>, got <newSha>)"
|
|
15
|
+
*/
|
|
16
|
+
function parseFreshShaFromConflict(message) {
|
|
17
|
+
if (!message)
|
|
18
|
+
return undefined;
|
|
19
|
+
const match = message.match(/got\s+([\w.-]+)\)/);
|
|
20
|
+
return match?.[1];
|
|
21
|
+
}
|
|
22
|
+
export default class Delete extends APICommand {
|
|
23
|
+
static args = {
|
|
24
|
+
name: Args.string({ description: 'flag/config/log-level key to delete', required: true }),
|
|
25
|
+
};
|
|
26
|
+
static description = `Delete a flag, config, or log-level from the workspace.
|
|
27
|
+
|
|
28
|
+
DESTRUCTIVE — removes the underlying JSON file from the workspace git repo
|
|
29
|
+
and commits with the actor's identity. The commit history preserves the
|
|
30
|
+
prior content; this is a hard-delete on the file but a soft-delete on
|
|
31
|
+
history.
|
|
32
|
+
|
|
33
|
+
Confirmation is required:
|
|
34
|
+
--yes skip the prompt (for scripts and CI)
|
|
35
|
+
interactive (default) you'll be asked to type the key name back
|
|
36
|
+
|
|
37
|
+
Examples
|
|
38
|
+
qfg delete my.flag --yes
|
|
39
|
+
qfg delete my.flag # interactive: type the key back to confirm
|
|
40
|
+
qfg delete my.config --yes`;
|
|
41
|
+
static examples = [
|
|
42
|
+
'<%= config.bin %> <%= command.id %> my.flag --yes',
|
|
43
|
+
'<%= config.bin %> <%= command.id %> my.config --yes',
|
|
44
|
+
];
|
|
45
|
+
static flags = {
|
|
46
|
+
yes: Flags.boolean({ default: false, description: 'skip confirmation prompt' }),
|
|
47
|
+
};
|
|
48
|
+
async run() {
|
|
49
|
+
const { args, flags } = await this.parse(Delete);
|
|
50
|
+
const tokens = await loadTokens();
|
|
51
|
+
if (!tokens?.accessToken) {
|
|
52
|
+
return this.err('Not logged in. Run `qfg login` first.');
|
|
53
|
+
}
|
|
54
|
+
const key = args.name;
|
|
55
|
+
const metaRes = await this.apiClient.post('/api/v1/metadata/list', { workspaceId: this.workspaceId });
|
|
56
|
+
if (!metaRes.ok) {
|
|
57
|
+
return this.err(`Failed to look up ${key}: ${metaRes.status} ${JSON.stringify(metaRes.error)}`);
|
|
58
|
+
}
|
|
59
|
+
const items = metaRes.json?.configs ?? [];
|
|
60
|
+
const item = items.find((i) => i.key === key);
|
|
61
|
+
if (!item) {
|
|
62
|
+
return this.err(`${key} not found in this workspace.`);
|
|
63
|
+
}
|
|
64
|
+
const route = DELETE_ROUTES[item.type];
|
|
65
|
+
if (!route) {
|
|
66
|
+
return this.err(`Cannot delete ${key}: unsupported type "${item.type}". Supported: flag, config, log-level.`);
|
|
67
|
+
}
|
|
68
|
+
if (!flags.yes) {
|
|
69
|
+
if (!isInteractive(flags)) {
|
|
70
|
+
return this.err(`Refusing to delete ${key} without confirmation. Pass --yes or run interactively.`);
|
|
71
|
+
}
|
|
72
|
+
this.log(`About to delete ${item.type.replaceAll('_', ' ')}: ${key}`);
|
|
73
|
+
this.log('This rewrites the workspace repo and is destructive.');
|
|
74
|
+
const confirmed = await confirmTypedSlug(key, `Type "${key}" to confirm: `);
|
|
75
|
+
if (!confirmed) {
|
|
76
|
+
return this.err(`Aborted: ${key} was not typed back exactly. No changes made.`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
let expectedCommitSha = item.version;
|
|
80
|
+
let attempt = 0;
|
|
81
|
+
while (attempt < 2) {
|
|
82
|
+
attempt += 1;
|
|
83
|
+
const payload = {
|
|
84
|
+
workspaceId: this.workspaceId,
|
|
85
|
+
[route.keyField]: key,
|
|
86
|
+
...(expectedCommitSha ? { expectedCommitSha } : {}),
|
|
87
|
+
};
|
|
88
|
+
this.verboseLog(`RPC ${route.endpoint}`, payload);
|
|
89
|
+
// eslint-disable-next-line no-await-in-loop
|
|
90
|
+
const res = await this.apiClient.post(route.endpoint, payload);
|
|
91
|
+
if (res.ok) {
|
|
92
|
+
const commitSha = res.json?.commitSha;
|
|
93
|
+
const shaSuffix = commitSha ? ` (commit ${commitSha})` : '';
|
|
94
|
+
return this.ok(`${checkmark} Deleted ${item.type.replaceAll('_', ' ')}: ${key}${shaSuffix}`, {
|
|
95
|
+
key,
|
|
96
|
+
type: item.type,
|
|
97
|
+
...(commitSha ? { commitSha } : {}),
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
if (res.status === 404) {
|
|
101
|
+
return this.err(`${key} not found on the server (it may have been deleted by someone else).`);
|
|
102
|
+
}
|
|
103
|
+
if (res.status === 409 && attempt === 1) {
|
|
104
|
+
const fresh = parseFreshShaFromConflict(res.error?.message);
|
|
105
|
+
if (fresh) {
|
|
106
|
+
this.verboseLog(`Stale SHA — retrying delete with fresh SHA ${fresh}`);
|
|
107
|
+
expectedCommitSha = fresh;
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return this.err(`Failed to delete ${key}: ${res.status} ${JSON.stringify(res.error)}`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
package/dist/commands/pull.js
CHANGED
|
@@ -186,9 +186,9 @@ CLI shortcuts (no JSON editing needed for simple cases):
|
|
|
186
186
|
async maybeWriteQuonfigDir(dir) {
|
|
187
187
|
if (process.env.QUONFIG_DIR)
|
|
188
188
|
return; // already set via env
|
|
189
|
-
const os = await import('node:os');
|
|
190
189
|
const pathMod = await import('node:path');
|
|
191
|
-
const
|
|
190
|
+
const { getQuonfigConfigHome } = await import('../util/quonfig-home.js');
|
|
191
|
+
const configFilePath = pathMod.join(getQuonfigConfigHome(), 'config');
|
|
192
192
|
try {
|
|
193
193
|
const existing = await fs.promises.readFile(configFilePath, 'utf8').catch(() => '');
|
|
194
194
|
if (existing.includes('QUONFIG_DIR') || existing.includes('quonfig_dir'))
|
package/dist/commands/push.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { JsonObj } from '../result.js';
|
|
2
2
|
import { BaseCommand } from '../index.js';
|
|
3
3
|
import { GiteaTokenResponse } from '../util/gitea-api.js';
|
|
4
|
-
import type
|
|
5
|
-
import { runPush } from '../push/run-push.js';
|
|
4
|
+
import { runPush, type GiteaTokenMintResult } from '../push/run-push.js';
|
|
6
5
|
export default class Push extends BaseCommand {
|
|
7
6
|
static description: string;
|
|
8
7
|
static examples: string[];
|
|
@@ -34,20 +33,13 @@ export declare function giteaResponseToMintResult(resp: GiteaTokenResponse): Git
|
|
|
34
33
|
*
|
|
35
34
|
* Returns a `{deps, cleanup}` pair. The caller MUST call `cleanup()` in a
|
|
36
35
|
* finally block so the bare-path probe clone is removed even on errors.
|
|
36
|
+
*
|
|
37
|
+
* As of qfg-azk.13 the push code path no longer mints a write-scoped Gitea
|
|
38
|
+
* token; the actual commit is performed server-side by the `configs.push`
|
|
39
|
+
* oRPC procedure. We still mint a READ token to authenticate the bare-path
|
|
40
|
+
* probe-clone and the clone-path `git fetch`.
|
|
37
41
|
*/
|
|
38
42
|
export declare function buildRealDeps(cmd: Push): {
|
|
39
43
|
deps: Parameters<typeof runPush>[1];
|
|
40
44
|
cleanup: () => Promise<void>;
|
|
41
45
|
};
|
|
42
|
-
/**
|
|
43
|
-
* Copy the contents of `sourceDir` into `destDir`, skipping `.git/` and any
|
|
44
|
-
* temp push-clone scratch directories. Used as the `applyDelta` callback for
|
|
45
|
-
* bare-path pushes — we mirror local files into a fresh clone so that
|
|
46
|
-
* `cloneAndStackPush`'s `git add --all` + diff will reflect the union of
|
|
47
|
-
* (deletes, modifies, adds) we intend.
|
|
48
|
-
*
|
|
49
|
-
* IMPORTANT: this deletes files in destDir that are not in sourceDir so that
|
|
50
|
-
* deletions make it into the push. Without this the clone-and-stack produces
|
|
51
|
-
* an "adds-only" delta and destructive heuristics would never fire in the UI.
|
|
52
|
-
*/
|
|
53
|
-
export declare function copyDirMirror(sourceDir: string, destDir: string): Promise<void>;
|