@quonfig/cli 0.0.2 → 0.0.5
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 +306 -29
- package/bin/dev.js +5 -9
- package/bin/dev.mjs +6 -0
- package/dist/codegen/zod-introspection.js +13 -4
- package/dist/commands/config-schema.d.ts +10 -0
- package/dist/commands/config-schema.js +165 -0
- package/dist/commands/create.js +22 -1
- package/dist/commands/info.js +17 -2
- package/dist/commands/login.js +27 -6
- package/dist/commands/mcp.js +1 -1
- package/dist/commands/pull.d.ts +15 -0
- package/dist/commands/pull.js +191 -0
- package/dist/commands/serve.js +3 -1
- package/dist/commands/set-default.js +78 -15
- package/dist/commands/set-rollout.d.ts +19 -0
- package/dist/commands/set-rollout.js +260 -0
- package/dist/commands/sync.d.ts +18 -0
- package/dist/commands/sync.js +142 -0
- package/dist/commands/whoami.js +4 -1
- package/dist/commands/workspace/bootstrap.d.ts +13 -0
- package/dist/commands/workspace/bootstrap.js +155 -0
- package/dist/init/init-workspace.js +4 -4
- package/dist/init/templates.js +1 -1
- package/dist/util/coerce.js +2 -1
- package/dist/util/get-client.js +6 -44
- package/dist/util/get-valid-token.d.ts +5 -0
- package/dist/util/get-valid-token.js +44 -0
- package/dist/util/git-ops.d.ts +32 -0
- package/dist/util/git-ops.js +164 -0
- package/dist/util/gitea-api.d.ts +11 -0
- package/dist/util/gitea-api.js +45 -0
- package/dist/util/gitea-token-storage.d.ts +8 -0
- package/dist/util/gitea-token-storage.js +47 -0
- package/dist/util/token-storage.d.ts +1 -0
- package/dist/util/token-storage.js +24 -10
- package/dist/verify/validate.d.ts +1 -0
- package/dist/verify/validate.js +136 -6
- package/oclif.manifest.json +404 -9
- package/package.json +2 -2
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.5 linux-x64 node-v24.4.1
|
|
18
18
|
$ qfg --help [COMMAND]
|
|
19
19
|
USAGE
|
|
20
20
|
$ qfg COMMAND
|
|
@@ -25,6 +25,7 @@ USAGE
|
|
|
25
25
|
# Commands
|
|
26
26
|
|
|
27
27
|
<!-- commands -->
|
|
28
|
+
* [`qfg config-schema`](#qfg-config-schema)
|
|
28
29
|
* [`qfg create NAME`](#qfg-create-name)
|
|
29
30
|
* [`qfg download`](#qfg-download)
|
|
30
31
|
* [`qfg generate`](#qfg-generate)
|
|
@@ -39,16 +40,49 @@ USAGE
|
|
|
39
40
|
* [`qfg mcp`](#qfg-mcp)
|
|
40
41
|
* [`qfg override [NAME]`](#qfg-override-name)
|
|
41
42
|
* [`qfg profile`](#qfg-profile)
|
|
43
|
+
* [`qfg pull`](#qfg-pull)
|
|
42
44
|
* [`qfg schema NAME`](#qfg-schema-name)
|
|
43
45
|
* [`qfg serve DATA-FILE`](#qfg-serve-data-file)
|
|
44
46
|
* [`qfg set-default [NAME]`](#qfg-set-default-name)
|
|
47
|
+
* [`qfg set-rollout [NAME]`](#qfg-set-rollout-name)
|
|
48
|
+
* [`qfg sync`](#qfg-sync)
|
|
45
49
|
* [`qfg verify [PATH]`](#qfg-verify-path)
|
|
46
50
|
* [`qfg whoami`](#qfg-whoami)
|
|
47
51
|
* [`qfg workspace`](#qfg-workspace)
|
|
52
|
+
* [`qfg workspace bootstrap`](#qfg-workspace-bootstrap)
|
|
53
|
+
|
|
54
|
+
## `qfg config-schema`
|
|
55
|
+
|
|
56
|
+
Print the config file format reference: rules engine, operators, targeting criteria, segments, and weighted rollouts. Use --json-schema for the machine-readable JSON Schema document.
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
USAGE
|
|
60
|
+
$ qfg config-schema [--json] [--interactive] [--no-color] [--verbose] [--json-schema]
|
|
61
|
+
|
|
62
|
+
FLAGS
|
|
63
|
+
--json-schema Output the full JSON Schema document for config files instead of the human-readable reference
|
|
64
|
+
|
|
65
|
+
GLOBAL FLAGS
|
|
66
|
+
--[no-]interactive Force interactive mode
|
|
67
|
+
--json Format output as json.
|
|
68
|
+
--no-color Do not colorize output
|
|
69
|
+
--verbose Verbose output
|
|
70
|
+
|
|
71
|
+
DESCRIPTION
|
|
72
|
+
Print the config file format reference: rules engine, operators, targeting criteria, segments, and weighted rollouts.
|
|
73
|
+
Use --json-schema for the machine-readable JSON Schema document.
|
|
74
|
+
|
|
75
|
+
EXAMPLES
|
|
76
|
+
$ qfg config-schema # human-readable operator reference + examples
|
|
77
|
+
|
|
78
|
+
$ qfg config-schema --json-schema # full JSON Schema document (copy into your editor)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
_See code: [src/commands/config-schema.ts](https://github.com/quonfig/cli/blob/v0.0.5/src/commands/config-schema.ts)_
|
|
48
82
|
|
|
49
83
|
## `qfg create NAME`
|
|
50
84
|
|
|
51
|
-
Create a new
|
|
85
|
+
Create a new feature flag, config value, or other item.
|
|
52
86
|
|
|
53
87
|
```
|
|
54
88
|
USAGE
|
|
@@ -77,7 +111,26 @@ GLOBAL FLAGS
|
|
|
77
111
|
--verbose Verbose output
|
|
78
112
|
|
|
79
113
|
DESCRIPTION
|
|
80
|
-
Create a new
|
|
114
|
+
Create a new feature flag, config value, or other item.
|
|
115
|
+
|
|
116
|
+
Use --type to specify the kind of item:
|
|
117
|
+
boolean-flag On/off feature flag (sendToClientSdk defaults to true; best for gradual rollouts)
|
|
118
|
+
string A string configuration value
|
|
119
|
+
int An integer configuration value
|
|
120
|
+
double A floating-point configuration value
|
|
121
|
+
string-list A comma-separated list of strings
|
|
122
|
+
json An arbitrary JSON blob
|
|
123
|
+
boolean A plain boolean (not a feature flag)
|
|
124
|
+
|
|
125
|
+
This sets the global default value. Override per-environment with:
|
|
126
|
+
qfg set-default my.flag --environment production --value true
|
|
127
|
+
|
|
128
|
+
For a percentage rollout (gradual rollout / A/B test / canary deploy), use:
|
|
129
|
+
qfg set-rollout my.flag --environment production --true-percent 20
|
|
130
|
+
|
|
131
|
+
Or edit the JSON config file directly for complex targeting rules:
|
|
132
|
+
qfg config-schema # full operator reference + examples
|
|
133
|
+
qfg pull --dir ./config # clone workspace, then edit JSON and git push
|
|
81
134
|
|
|
82
135
|
EXAMPLES
|
|
83
136
|
$ qfg create my.new.flag --type boolean-flag
|
|
@@ -91,9 +144,13 @@ EXAMPLES
|
|
|
91
144
|
$ qfg create my.new.string --type string --env-var=MY_ENV_VAR_NAME
|
|
92
145
|
|
|
93
146
|
$ qfg create my.new.string --type json --value="{\"key\": \"value\"}"
|
|
147
|
+
|
|
148
|
+
# After creating a flag, set a 20% rollout in production:
|
|
149
|
+
|
|
150
|
+
$ qfg set-rollout my.new.flag --environment production --true-percent 20
|
|
94
151
|
```
|
|
95
152
|
|
|
96
|
-
_See code: [src/commands/create.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
153
|
+
_See code: [src/commands/create.ts](https://github.com/quonfig/cli/blob/v0.0.5/src/commands/create.ts)_
|
|
97
154
|
|
|
98
155
|
## `qfg download`
|
|
99
156
|
|
|
@@ -126,7 +183,7 @@ EXAMPLES
|
|
|
126
183
|
$ qfg download --environment=test --sdk-key=YOUR_SDK_KEY
|
|
127
184
|
```
|
|
128
185
|
|
|
129
|
-
_See code: [src/commands/download.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
186
|
+
_See code: [src/commands/download.ts](https://github.com/quonfig/cli/blob/v0.0.5/src/commands/download.ts)_
|
|
130
187
|
|
|
131
188
|
## `qfg generate`
|
|
132
189
|
|
|
@@ -196,7 +253,7 @@ EXAMPLES
|
|
|
196
253
|
$ qfg generate --targets node-ts -o ./dist # combine with targets
|
|
197
254
|
```
|
|
198
255
|
|
|
199
|
-
_See code: [src/commands/generate.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
256
|
+
_See code: [src/commands/generate.ts](https://github.com/quonfig/cli/blob/v0.0.5/src/commands/generate.ts)_
|
|
200
257
|
|
|
201
258
|
## `qfg generate-new-hex-key`
|
|
202
259
|
|
|
@@ -219,7 +276,7 @@ EXAMPLES
|
|
|
219
276
|
$ qfg generate-new-hex-key
|
|
220
277
|
```
|
|
221
278
|
|
|
222
|
-
_See code: [src/commands/generate-new-hex-key.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
279
|
+
_See code: [src/commands/generate-new-hex-key.ts](https://github.com/quonfig/cli/blob/v0.0.5/src/commands/generate-new-hex-key.ts)_
|
|
223
280
|
|
|
224
281
|
## `qfg get [NAME]`
|
|
225
282
|
|
|
@@ -251,11 +308,11 @@ EXAMPLES
|
|
|
251
308
|
$ qfg get my.config.name --environment=production
|
|
252
309
|
```
|
|
253
310
|
|
|
254
|
-
_See code: [src/commands/get.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
311
|
+
_See code: [src/commands/get.ts](https://github.com/quonfig/cli/blob/v0.0.5/src/commands/get.ts)_
|
|
255
312
|
|
|
256
313
|
## `qfg info [NAME]`
|
|
257
314
|
|
|
258
|
-
Show
|
|
315
|
+
Show current values, rules, and evaluation stats for a flag or config.
|
|
259
316
|
|
|
260
317
|
```
|
|
261
318
|
USAGE
|
|
@@ -275,13 +332,27 @@ GLOBAL FLAGS
|
|
|
275
332
|
--verbose Verbose output
|
|
276
333
|
|
|
277
334
|
DESCRIPTION
|
|
278
|
-
Show
|
|
335
|
+
Show current values, rules, and evaluation stats for a flag or config.
|
|
336
|
+
|
|
337
|
+
Output shows the value for each environment:
|
|
338
|
+
- A simple value (true / false / "hello") means a single unconditional rule.
|
|
339
|
+
- "[see rules]" means the environment has targeting rules or a percentage rollout.
|
|
340
|
+
- "[inherit]" means the environment falls back to the Default value.
|
|
341
|
+
|
|
342
|
+
Percentage rollouts are displayed as "20.0% true, 80.0% false".
|
|
343
|
+
Evaluation counts for the past 24 hours are included by default.
|
|
344
|
+
|
|
345
|
+
Related commands:
|
|
346
|
+
qfg set-default my.flag --environment production --value true # set a scalar fallback
|
|
347
|
+
qfg set-rollout my.flag --environment production --true-percent 20 # set a % rollout
|
|
279
348
|
|
|
280
349
|
EXAMPLES
|
|
281
350
|
$ qfg info my.config.name
|
|
351
|
+
|
|
352
|
+
$ qfg info my.config.name --exclude-evaluations # skip 24h stats
|
|
282
353
|
```
|
|
283
354
|
|
|
284
|
-
_See code: [src/commands/info.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
355
|
+
_See code: [src/commands/info.ts](https://github.com/quonfig/cli/blob/v0.0.5/src/commands/info.ts)_
|
|
285
356
|
|
|
286
357
|
## `qfg init [DIRECTORY]`
|
|
287
358
|
|
|
@@ -319,7 +390,7 @@ EXAMPLES
|
|
|
319
390
|
$ qfg init --dry-run
|
|
320
391
|
```
|
|
321
392
|
|
|
322
|
-
_See code: [src/commands/init.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
393
|
+
_See code: [src/commands/init.ts](https://github.com/quonfig/cli/blob/v0.0.5/src/commands/init.ts)_
|
|
323
394
|
|
|
324
395
|
## `qfg interactive`
|
|
325
396
|
|
|
@@ -337,7 +408,7 @@ EXAMPLES
|
|
|
337
408
|
$ qfg
|
|
338
409
|
```
|
|
339
410
|
|
|
340
|
-
_See code: [src/commands/interactive.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
411
|
+
_See code: [src/commands/interactive.ts](https://github.com/quonfig/cli/blob/v0.0.5/src/commands/interactive.ts)_
|
|
341
412
|
|
|
342
413
|
## `qfg list`
|
|
343
414
|
|
|
@@ -374,7 +445,7 @@ EXAMPLES
|
|
|
374
445
|
$ qfg list --feature-flags
|
|
375
446
|
```
|
|
376
447
|
|
|
377
|
-
_See code: [src/commands/list.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
448
|
+
_See code: [src/commands/list.ts](https://github.com/quonfig/cli/blob/v0.0.5/src/commands/list.ts)_
|
|
378
449
|
|
|
379
450
|
## `qfg login`
|
|
380
451
|
|
|
@@ -402,7 +473,7 @@ EXAMPLES
|
|
|
402
473
|
$ qfg login --profile myprofile
|
|
403
474
|
```
|
|
404
475
|
|
|
405
|
-
_See code: [src/commands/login.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
476
|
+
_See code: [src/commands/login.ts](https://github.com/quonfig/cli/blob/v0.0.5/src/commands/login.ts)_
|
|
406
477
|
|
|
407
478
|
## `qfg logout`
|
|
408
479
|
|
|
@@ -425,7 +496,7 @@ EXAMPLES
|
|
|
425
496
|
$ qfg logout
|
|
426
497
|
```
|
|
427
498
|
|
|
428
|
-
_See code: [src/commands/logout.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
499
|
+
_See code: [src/commands/logout.ts](https://github.com/quonfig/cli/blob/v0.0.5/src/commands/logout.ts)_
|
|
429
500
|
|
|
430
501
|
## `qfg mcp`
|
|
431
502
|
|
|
@@ -455,10 +526,10 @@ EXAMPLES
|
|
|
455
526
|
|
|
456
527
|
$ qfg mcp --editor cursor
|
|
457
528
|
|
|
458
|
-
$ qfg mcp --url http://local-app.
|
|
529
|
+
$ qfg mcp --url http://local-app.quonfig-staging.com:3003/api/v1/mcp
|
|
459
530
|
```
|
|
460
531
|
|
|
461
|
-
_See code: [src/commands/mcp.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
532
|
+
_See code: [src/commands/mcp.ts](https://github.com/quonfig/cli/blob/v0.0.5/src/commands/mcp.ts)_
|
|
462
533
|
|
|
463
534
|
## `qfg override [NAME]`
|
|
464
535
|
|
|
@@ -497,7 +568,7 @@ EXAMPLES
|
|
|
497
568
|
$ qfg override my.double.config --value=3.14159
|
|
498
569
|
```
|
|
499
570
|
|
|
500
|
-
_See code: [src/commands/override.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
571
|
+
_See code: [src/commands/override.ts](https://github.com/quonfig/cli/blob/v0.0.5/src/commands/override.ts)_
|
|
501
572
|
|
|
502
573
|
## `qfg profile`
|
|
503
574
|
|
|
@@ -520,7 +591,51 @@ EXAMPLES
|
|
|
520
591
|
$ qfg profile
|
|
521
592
|
```
|
|
522
593
|
|
|
523
|
-
_See code: [src/commands/profile.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
594
|
+
_See code: [src/commands/profile.ts](https://github.com/quonfig/cli/blob/v0.0.5/src/commands/profile.ts)_
|
|
595
|
+
|
|
596
|
+
## `qfg pull`
|
|
597
|
+
|
|
598
|
+
Clone or update a local copy of your workspace config files.
|
|
599
|
+
|
|
600
|
+
```
|
|
601
|
+
USAGE
|
|
602
|
+
$ qfg pull [--json] [--interactive] [--no-color] [--verbose] [--dir <value>] [--workspace <value>]
|
|
603
|
+
|
|
604
|
+
FLAGS
|
|
605
|
+
--dir=<value> Local directory to clone/update (defaults to QUONFIG_DIR env var)
|
|
606
|
+
--workspace=<value> Workspace ID (defaults to active profile)
|
|
607
|
+
|
|
608
|
+
GLOBAL FLAGS
|
|
609
|
+
--[no-]interactive Force interactive mode
|
|
610
|
+
--json Format output as json.
|
|
611
|
+
--no-color Do not colorize output
|
|
612
|
+
--verbose Verbose output
|
|
613
|
+
|
|
614
|
+
DESCRIPTION
|
|
615
|
+
Clone or update a local copy of your workspace config files.
|
|
616
|
+
|
|
617
|
+
Use this when you need to edit flag JSON directly — for complex targeting rules,
|
|
618
|
+
multi-rule configs, or anything beyond a single scalar value.
|
|
619
|
+
|
|
620
|
+
For the config file format, operator reference, and examples:
|
|
621
|
+
qfg config-schema # human-readable reference
|
|
622
|
+
qfg config-schema --json-schema # machine-readable JSON Schema
|
|
623
|
+
|
|
624
|
+
After editing files:
|
|
625
|
+
qfg verify <dir> # validate JSON before pushing
|
|
626
|
+
git -C <dir> add -A && git -C <dir> commit -m "feat: ..." && git -C <dir> push
|
|
627
|
+
|
|
628
|
+
CLI shortcuts (no JSON editing needed for simple cases):
|
|
629
|
+
qfg set-rollout my.flag --environment production --true-percent 20
|
|
630
|
+
qfg set-default my.flag --environment production --value true
|
|
631
|
+
|
|
632
|
+
EXAMPLES
|
|
633
|
+
$ qfg pull --dir ./our-config
|
|
634
|
+
|
|
635
|
+
$ qfg pull # uses QUONFIG_DIR env var
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
_See code: [src/commands/pull.ts](https://github.com/quonfig/cli/blob/v0.0.5/src/commands/pull.ts)_
|
|
524
639
|
|
|
525
640
|
## `qfg schema NAME`
|
|
526
641
|
|
|
@@ -558,7 +673,7 @@ EXAMPLES
|
|
|
558
673
|
$ qfg schema my-schema --set-json-schema=@schemas/my-schema.json --protected
|
|
559
674
|
```
|
|
560
675
|
|
|
561
|
-
_See code: [src/commands/schema.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
676
|
+
_See code: [src/commands/schema.ts](https://github.com/quonfig/cli/blob/v0.0.5/src/commands/schema.ts)_
|
|
562
677
|
|
|
563
678
|
## `qfg serve DATA-FILE`
|
|
564
679
|
|
|
@@ -594,11 +709,11 @@ EXAMPLES
|
|
|
594
709
|
$ qfg serve ./quonfig.test.588.config.json --port=3099
|
|
595
710
|
```
|
|
596
711
|
|
|
597
|
-
_See code: [src/commands/serve.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
712
|
+
_See code: [src/commands/serve.ts](https://github.com/quonfig/cli/blob/v0.0.5/src/commands/serve.ts)_
|
|
598
713
|
|
|
599
714
|
## `qfg set-default [NAME]`
|
|
600
715
|
|
|
601
|
-
Set
|
|
716
|
+
Set the unconditional fallback value for a flag or config in a specific environment.
|
|
602
717
|
|
|
603
718
|
```
|
|
604
719
|
USAGE
|
|
@@ -626,19 +741,148 @@ GLOBAL FLAGS
|
|
|
626
741
|
--verbose Verbose output
|
|
627
742
|
|
|
628
743
|
DESCRIPTION
|
|
629
|
-
Set
|
|
744
|
+
Set the unconditional fallback value for a flag or config in a specific environment.
|
|
745
|
+
|
|
746
|
+
This updates the catch-all rule — the value users receive when NO targeting rule matches.
|
|
747
|
+
Any targeting rules or percentage rollouts you have configured are NOT affected; they
|
|
748
|
+
continue to fire before this fallback is evaluated.
|
|
749
|
+
|
|
750
|
+
"Other rules still apply" means: if you have rules targeting specific users, segments,
|
|
751
|
+
or properties, those rules still take priority. This command only changes what everyone
|
|
752
|
+
else sees.
|
|
753
|
+
|
|
754
|
+
To set a percentage rollout (gradual rollout / A/B test / canary deploy) instead:
|
|
755
|
+
qfg set-rollout my.flag --environment production --true-percent 20
|
|
756
|
+
|
|
757
|
+
To see all current values and rules for a flag:
|
|
758
|
+
qfg info my.flag
|
|
630
759
|
|
|
631
760
|
EXAMPLES
|
|
632
|
-
$ qfg set-default my.flag.name
|
|
761
|
+
$ qfg set-default my.flag.name # prompts for value and env
|
|
633
762
|
|
|
634
763
|
$ qfg set-default my.flag.name --value=true --environment=staging
|
|
635
764
|
|
|
765
|
+
$ qfg set-default my.flag.name --value=false --environment=production # kill-switch: turn off for everyone
|
|
766
|
+
|
|
636
767
|
$ qfg set-default my.flag.name --value=true --secret
|
|
637
768
|
|
|
638
769
|
$ qfg set-default my.config.name --env-var=MY_ENV_VAR_NAME --environment=production
|
|
770
|
+
|
|
771
|
+
# For a percentage rollout, use set-rollout instead:
|
|
772
|
+
|
|
773
|
+
$ qfg set-rollout my.flag.name --environment production --true-percent 20
|
|
774
|
+
```
|
|
775
|
+
|
|
776
|
+
_See code: [src/commands/set-default.ts](https://github.com/quonfig/cli/blob/v0.0.5/src/commands/set-default.ts)_
|
|
777
|
+
|
|
778
|
+
## `qfg set-rollout [NAME]`
|
|
779
|
+
|
|
780
|
+
Configure a percentage rollout (gradual rollout / A/B test / canary deploy) for a flag.
|
|
781
|
+
|
|
782
|
+
```
|
|
783
|
+
USAGE
|
|
784
|
+
$ qfg set-rollout [NAME] [--json] [--interactive] [--no-color] [--verbose] [-p <value>] [--environment <value>]
|
|
785
|
+
[--hash-by <value>] [--true-percent <value>] [--weights <value>] [--confirm]
|
|
786
|
+
|
|
787
|
+
ARGUMENTS
|
|
788
|
+
NAME config/feature-flag/etc. name
|
|
789
|
+
|
|
790
|
+
FLAGS
|
|
791
|
+
--confirm skip the interactive confirmation prompt (useful for scripts and agents)
|
|
792
|
+
--environment=<value> environment to update (e.g. production, staging)
|
|
793
|
+
--hash-by=<value> [default: user.key] user property used to assign buckets (default: user.key)
|
|
794
|
+
--true-percent=<value> percentage of users that receive true (0–100). Remaining users receive false. Boolean flags
|
|
795
|
+
only.
|
|
796
|
+
--weights=<value> comma-separated "value:percent" pairs that must sum to 100 (e.g. "true:20,false:80" or
|
|
797
|
+
"red:33,green:33,blue:34")
|
|
798
|
+
|
|
799
|
+
GLOBAL FLAGS
|
|
800
|
+
-p, --profile=<value> Profile to use (defaults to ENV var QUONFIG_PROFILE or "default")
|
|
801
|
+
--[no-]interactive Force interactive mode
|
|
802
|
+
--json Format output as json.
|
|
803
|
+
--no-color Do not colorize output
|
|
804
|
+
--verbose Verbose output
|
|
805
|
+
|
|
806
|
+
DESCRIPTION
|
|
807
|
+
Configure a percentage rollout (gradual rollout / A/B test / canary deploy) for a flag.
|
|
808
|
+
|
|
809
|
+
The flag must already exist. Create it first if needed:
|
|
810
|
+
qfg create my.flag --type boolean-flag
|
|
811
|
+
|
|
812
|
+
Weights are specified as whole-number percentages (0–100). They must sum to 100.
|
|
813
|
+
|
|
814
|
+
For a boolean flag, use --true-percent to set the percentage of users that receive
|
|
815
|
+
true (the remainder automatically receive false):
|
|
816
|
+
qfg set-rollout my.flag --environment production --true-percent 20
|
|
817
|
+
→ 20% of users get true, 80% get false
|
|
818
|
+
|
|
819
|
+
For multi-value flags or custom splits, use --weights with a comma-separated list:
|
|
820
|
+
qfg set-rollout my.flag --environment production --weights "red:33,green:33,blue:34"
|
|
821
|
+
|
|
822
|
+
Hashing: users are bucketed by the value of hashByPropertyName (default: "user.key").
|
|
823
|
+
Use --hash-by to change which property drives the bucket assignment:
|
|
824
|
+
qfg set-rollout my.flag --environment production --true-percent 10 --hash-by user.id
|
|
825
|
+
|
|
826
|
+
For scripted / agent use, add --confirm to skip the interactive confirmation prompt.
|
|
827
|
+
|
|
828
|
+
To combine a rollout with segment targeting (e.g. beta ON, holdout OFF, everyone else 50/50),
|
|
829
|
+
you need to edit the JSON config file directly:
|
|
830
|
+
qfg config-schema # operator reference + worked multi-rule example
|
|
831
|
+
qfg pull --dir ./config # clone workspace to edit
|
|
832
|
+
|
|
833
|
+
To revert to a single value for everyone, use:
|
|
834
|
+
qfg set-default my.flag --environment production --value false
|
|
835
|
+
|
|
836
|
+
To inspect the current rollout:
|
|
837
|
+
qfg info my.flag
|
|
838
|
+
|
|
839
|
+
EXAMPLES
|
|
840
|
+
$ qfg set-rollout my.feature.flag --environment production --true-percent 20
|
|
841
|
+
|
|
842
|
+
$ qfg set-rollout my.feature.flag --environment staging --true-percent 50
|
|
843
|
+
|
|
844
|
+
$ qfg set-rollout my.feature.flag --environment production --true-percent 100 # full rollout
|
|
845
|
+
|
|
846
|
+
$ qfg set-rollout my.feature.flag --environment production --true-percent 0 # kill switch (all false)
|
|
847
|
+
|
|
848
|
+
$ qfg set-rollout my.variant.flag --environment production --weights "control:50,treatment:50"
|
|
849
|
+
|
|
850
|
+
$ qfg set-rollout my.variant.flag --environment production --weights "a:33,b:33,c:34" --hash-by user.id
|
|
851
|
+
```
|
|
852
|
+
|
|
853
|
+
_See code: [src/commands/set-rollout.ts](https://github.com/quonfig/cli/blob/v0.0.5/src/commands/set-rollout.ts)_
|
|
854
|
+
|
|
855
|
+
## `qfg sync`
|
|
856
|
+
|
|
857
|
+
Continuously poll for workspace config updates and apply them locally
|
|
858
|
+
|
|
859
|
+
```
|
|
860
|
+
USAGE
|
|
861
|
+
$ qfg sync --watch [--json] [--interactive] [--no-color] [--verbose] [--dir <value>] [--interval <value>]
|
|
862
|
+
|
|
863
|
+
FLAGS
|
|
864
|
+
--dir=<value> Local directory to sync (defaults to QUONFIG_DIR env var)
|
|
865
|
+
--interval=<value> [default: 60] Poll interval in seconds
|
|
866
|
+
--watch (required) Run as a continuous polling daemon (required)
|
|
867
|
+
|
|
868
|
+
GLOBAL FLAGS
|
|
869
|
+
--[no-]interactive Force interactive mode
|
|
870
|
+
--json Format output as json.
|
|
871
|
+
--no-color Do not colorize output
|
|
872
|
+
--verbose Verbose output
|
|
873
|
+
|
|
874
|
+
DESCRIPTION
|
|
875
|
+
Continuously poll for workspace config updates and apply them locally
|
|
876
|
+
|
|
877
|
+
EXAMPLES
|
|
878
|
+
$ qfg sync --watch
|
|
879
|
+
|
|
880
|
+
$ qfg sync --watch --interval 10
|
|
881
|
+
|
|
882
|
+
$ qfg sync --watch --dir ./our-config --interval 30
|
|
639
883
|
```
|
|
640
884
|
|
|
641
|
-
_See code: [src/commands/
|
|
885
|
+
_See code: [src/commands/sync.ts](https://github.com/quonfig/cli/blob/v0.0.5/src/commands/sync.ts)_
|
|
642
886
|
|
|
643
887
|
## `qfg verify [PATH]`
|
|
644
888
|
|
|
@@ -671,7 +915,7 @@ EXAMPLES
|
|
|
671
915
|
$ qfg verify --json
|
|
672
916
|
```
|
|
673
917
|
|
|
674
|
-
_See code: [src/commands/verify.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
918
|
+
_See code: [src/commands/verify.ts](https://github.com/quonfig/cli/blob/v0.0.5/src/commands/verify.ts)_
|
|
675
919
|
|
|
676
920
|
## `qfg whoami`
|
|
677
921
|
|
|
@@ -694,7 +938,7 @@ EXAMPLES
|
|
|
694
938
|
$ qfg whoami
|
|
695
939
|
```
|
|
696
940
|
|
|
697
|
-
_See code: [src/commands/whoami.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
941
|
+
_See code: [src/commands/whoami.ts](https://github.com/quonfig/cli/blob/v0.0.5/src/commands/whoami.ts)_
|
|
698
942
|
|
|
699
943
|
## `qfg workspace`
|
|
700
944
|
|
|
@@ -717,7 +961,40 @@ EXAMPLES
|
|
|
717
961
|
$ qfg workspace
|
|
718
962
|
```
|
|
719
963
|
|
|
720
|
-
_See code: [src/commands/workspace.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
964
|
+
_See code: [src/commands/workspace.ts](https://github.com/quonfig/cli/blob/v0.0.5/src/commands/workspace.ts)_
|
|
965
|
+
|
|
966
|
+
## `qfg workspace bootstrap`
|
|
967
|
+
|
|
968
|
+
Push a local git repo to Gitea as this workspace's config repository
|
|
969
|
+
|
|
970
|
+
```
|
|
971
|
+
USAGE
|
|
972
|
+
$ qfg workspace bootstrap [--json] [--interactive] [--no-color] [--verbose] [--dir <value>] [--force]
|
|
973
|
+
[--skip-validate]
|
|
974
|
+
|
|
975
|
+
FLAGS
|
|
976
|
+
--dir=<value> Local directory to push (defaults to current directory)
|
|
977
|
+
--force Force push even if remote already has commits
|
|
978
|
+
--skip-validate Skip config validation before pushing
|
|
979
|
+
|
|
980
|
+
GLOBAL FLAGS
|
|
981
|
+
--[no-]interactive Force interactive mode
|
|
982
|
+
--json Format output as json.
|
|
983
|
+
--no-color Do not colorize output
|
|
984
|
+
--verbose Verbose output
|
|
985
|
+
|
|
986
|
+
DESCRIPTION
|
|
987
|
+
Push a local git repo to Gitea as this workspace's config repository
|
|
988
|
+
|
|
989
|
+
EXAMPLES
|
|
990
|
+
$ qfg workspace bootstrap --dir ./our-config
|
|
991
|
+
|
|
992
|
+
$ qfg workspace bootstrap --dir ./launch-migrator/output
|
|
993
|
+
|
|
994
|
+
$ qfg workspace bootstrap --dir ./our-config --skip-validate
|
|
995
|
+
```
|
|
996
|
+
|
|
997
|
+
_See code: [src/commands/workspace/bootstrap.ts](https://github.com/quonfig/cli/blob/v0.0.5/src/commands/workspace/bootstrap.ts)_
|
|
721
998
|
<!-- commandsstop -->
|
|
722
999
|
|
|
723
1000
|
## Local Development
|
package/bin/dev.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
await execute({development: true, dir: import.meta.url})
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
await main()
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Run dev CLI from any directory — ensures ts-node resolves from cli's node_modules
|
|
3
|
+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
4
|
+
export TS_NODE_PROJECT="$DIR/tsconfig.json"
|
|
5
|
+
exec node --loader "$DIR/node_modules/ts-node/esm.mjs" --no-warnings=ExperimentalWarning "$DIR/bin/dev.mjs" "$@"
|
package/bin/dev.mjs
ADDED
|
@@ -183,18 +183,27 @@ export function getMetaDescription(schema) {
|
|
|
183
183
|
if (!meta || Object.keys(meta).length === 0) {
|
|
184
184
|
return undefined;
|
|
185
185
|
}
|
|
186
|
-
// If meta only has a description key, return just the description
|
|
187
186
|
const keys = Object.keys(meta);
|
|
188
|
-
|
|
189
|
-
|
|
187
|
+
const standardKeys = new Set(['title', 'description']);
|
|
188
|
+
const hasExtraKeys = keys.some((k) => !standardKeys.has(k));
|
|
189
|
+
// If meta has non-standard keys (e.g. id, required, deprecated),
|
|
190
|
+
// return JSON representation of the entire meta object so all metadata is preserved
|
|
191
|
+
if (hasExtraKeys) {
|
|
192
|
+
try {
|
|
193
|
+
return JSON.stringify(meta, null, 2);
|
|
194
|
+
}
|
|
195
|
+
catch {
|
|
196
|
+
// If JSON serialization fails, fall through
|
|
197
|
+
}
|
|
190
198
|
}
|
|
199
|
+
// For standard keys only (title, description), prefer description then title
|
|
191
200
|
if (typeof meta.description === 'string') {
|
|
192
201
|
return meta.description;
|
|
193
202
|
}
|
|
194
203
|
if (typeof meta.title === 'string') {
|
|
195
204
|
return meta.title;
|
|
196
205
|
}
|
|
197
|
-
//
|
|
206
|
+
// Fallback: return JSON representation of the entire meta object
|
|
198
207
|
try {
|
|
199
208
|
return JSON.stringify(meta, null, 2);
|
|
200
209
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseCommand } from '../index.js';
|
|
2
|
+
import { JsonObj } from '../result.js';
|
|
3
|
+
export default class ConfigSchema extends BaseCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
'json-schema': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<JsonObj | void>;
|
|
10
|
+
}
|