@quonfig/cli 0.0.5 → 0.0.6
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 +119 -119
- package/dist/commands/login.js +19 -15
- package/dist/commands/profile.d.ts +1 -0
- package/dist/commands/profile.js +6 -42
- package/dist/commands/whoami.js +8 -8
- package/dist/commands/workspace/switch.d.ts +7 -0
- package/dist/commands/workspace/switch.js +90 -0
- package/dist/commands/workspace.js +14 -23
- package/dist/index.d.ts +1 -0
- package/dist/index.js +9 -2
- package/dist/util/get-client.js +34 -11
- package/dist/util/token-storage.d.ts +6 -0
- package/dist/util/token-storage.js +17 -0
- package/oclif.manifest.json +181 -15
- 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.6 linux-x64 node-v24.4.1
|
|
18
18
|
$ qfg --help [COMMAND]
|
|
19
19
|
USAGE
|
|
20
20
|
$ qfg COMMAND
|
|
@@ -39,7 +39,6 @@ USAGE
|
|
|
39
39
|
* [`qfg logout`](#qfg-logout)
|
|
40
40
|
* [`qfg mcp`](#qfg-mcp)
|
|
41
41
|
* [`qfg override [NAME]`](#qfg-override-name)
|
|
42
|
-
* [`qfg profile`](#qfg-profile)
|
|
43
42
|
* [`qfg pull`](#qfg-pull)
|
|
44
43
|
* [`qfg schema NAME`](#qfg-schema-name)
|
|
45
44
|
* [`qfg serve DATA-FILE`](#qfg-serve-data-file)
|
|
@@ -50,6 +49,7 @@ USAGE
|
|
|
50
49
|
* [`qfg whoami`](#qfg-whoami)
|
|
51
50
|
* [`qfg workspace`](#qfg-workspace)
|
|
52
51
|
* [`qfg workspace bootstrap`](#qfg-workspace-bootstrap)
|
|
52
|
+
* [`qfg workspace switch`](#qfg-workspace-switch)
|
|
53
53
|
|
|
54
54
|
## `qfg config-schema`
|
|
55
55
|
|
|
@@ -78,7 +78,7 @@ EXAMPLES
|
|
|
78
78
|
$ qfg config-schema --json-schema # full JSON Schema document (copy into your editor)
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
_See code: [src/commands/config-schema.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
81
|
+
_See code: [src/commands/config-schema.ts](https://github.com/quonfig/cli/blob/v0.0.6/src/commands/config-schema.ts)_
|
|
82
82
|
|
|
83
83
|
## `qfg create NAME`
|
|
84
84
|
|
|
@@ -87,7 +87,7 @@ Create a new feature flag, config value, or other item.
|
|
|
87
87
|
```
|
|
88
88
|
USAGE
|
|
89
89
|
$ qfg create NAME --type boolean-flag|boolean|string|double|int|string-list|json [--json] [--interactive]
|
|
90
|
-
[--no-color] [--verbose] [-
|
|
90
|
+
[--no-color] [--verbose] [-w <value>] [--confidential] [--env-var <value>] [--value <value>] [--secret]
|
|
91
91
|
[--secret-key-name <value>]
|
|
92
92
|
|
|
93
93
|
ARGUMENTS
|
|
@@ -104,11 +104,11 @@ FLAGS
|
|
|
104
104
|
--value=<value> default value for your new item
|
|
105
105
|
|
|
106
106
|
GLOBAL FLAGS
|
|
107
|
-
-
|
|
108
|
-
--[no-]interactive
|
|
109
|
-
--json
|
|
110
|
-
--no-color
|
|
111
|
-
--verbose
|
|
107
|
+
-w, --workspace=<value> Workspace slug to use (overrides QUONFIG_WORKSPACE env var and saved default)
|
|
108
|
+
--[no-]interactive Force interactive mode
|
|
109
|
+
--json Format output as json.
|
|
110
|
+
--no-color Do not colorize output
|
|
111
|
+
--verbose Verbose output
|
|
112
112
|
|
|
113
113
|
DESCRIPTION
|
|
114
114
|
Create a new feature flag, config value, or other item.
|
|
@@ -150,7 +150,7 @@ EXAMPLES
|
|
|
150
150
|
$ qfg set-rollout my.new.flag --environment production --true-percent 20
|
|
151
151
|
```
|
|
152
152
|
|
|
153
|
-
_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.6/src/commands/create.ts)_
|
|
154
154
|
|
|
155
155
|
## `qfg download`
|
|
156
156
|
|
|
@@ -158,7 +158,7 @@ Download a Datafile for a given environment
|
|
|
158
158
|
|
|
159
159
|
```
|
|
160
160
|
USAGE
|
|
161
|
-
$ qfg download [--json] [--interactive] [--no-color] [--verbose] [-
|
|
161
|
+
$ qfg download [--json] [--interactive] [--no-color] [--verbose] [-w <value>] [--environment <value>]
|
|
162
162
|
[--sdk-key <value>]
|
|
163
163
|
|
|
164
164
|
FLAGS
|
|
@@ -166,11 +166,11 @@ FLAGS
|
|
|
166
166
|
--sdk-key=<value> SDK key for authentication (uses legacy download endpoint)
|
|
167
167
|
|
|
168
168
|
GLOBAL FLAGS
|
|
169
|
-
-
|
|
170
|
-
--[no-]interactive
|
|
171
|
-
--json
|
|
172
|
-
--no-color
|
|
173
|
-
--verbose
|
|
169
|
+
-w, --workspace=<value> Workspace slug to use (overrides QUONFIG_WORKSPACE env var and saved default)
|
|
170
|
+
--[no-]interactive Force interactive mode
|
|
171
|
+
--json Format output as json.
|
|
172
|
+
--no-color Do not colorize output
|
|
173
|
+
--verbose Verbose output
|
|
174
174
|
|
|
175
175
|
DESCRIPTION
|
|
176
176
|
Download a Datafile for a given environment
|
|
@@ -183,7 +183,7 @@ EXAMPLES
|
|
|
183
183
|
$ qfg download --environment=test --sdk-key=YOUR_SDK_KEY
|
|
184
184
|
```
|
|
185
185
|
|
|
186
|
-
_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.6/src/commands/download.ts)_
|
|
187
187
|
|
|
188
188
|
## `qfg generate`
|
|
189
189
|
|
|
@@ -191,7 +191,7 @@ Generate type definitions for your Quonfig configuration
|
|
|
191
191
|
|
|
192
192
|
```
|
|
193
193
|
USAGE
|
|
194
|
-
$ qfg generate [--json] [--interactive] [--no-color] [--verbose] [-
|
|
194
|
+
$ qfg generate [--json] [--interactive] [--no-color] [--verbose] [-w <value>] [-o <value>] [--targets
|
|
195
195
|
<value>]
|
|
196
196
|
|
|
197
197
|
FLAGS
|
|
@@ -200,11 +200,11 @@ FLAGS
|
|
|
200
200
|
react-ts)
|
|
201
201
|
|
|
202
202
|
GLOBAL FLAGS
|
|
203
|
-
-
|
|
204
|
-
--[no-]interactive
|
|
205
|
-
--json
|
|
206
|
-
--no-color
|
|
207
|
-
--verbose
|
|
203
|
+
-w, --workspace=<value> Workspace slug to use (overrides QUONFIG_WORKSPACE env var and saved default)
|
|
204
|
+
--[no-]interactive Force interactive mode
|
|
205
|
+
--json Format output as json.
|
|
206
|
+
--no-color Do not colorize output
|
|
207
|
+
--verbose Verbose output
|
|
208
208
|
|
|
209
209
|
DESCRIPTION
|
|
210
210
|
Generate type definitions for your Quonfig configuration
|
|
@@ -253,7 +253,7 @@ EXAMPLES
|
|
|
253
253
|
$ qfg generate --targets node-ts -o ./dist # combine with targets
|
|
254
254
|
```
|
|
255
255
|
|
|
256
|
-
_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.6/src/commands/generate.ts)_
|
|
257
257
|
|
|
258
258
|
## `qfg generate-new-hex-key`
|
|
259
259
|
|
|
@@ -276,7 +276,7 @@ EXAMPLES
|
|
|
276
276
|
$ qfg generate-new-hex-key
|
|
277
277
|
```
|
|
278
278
|
|
|
279
|
-
_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.6/src/commands/generate-new-hex-key.ts)_
|
|
280
280
|
|
|
281
281
|
## `qfg get [NAME]`
|
|
282
282
|
|
|
@@ -284,7 +284,7 @@ Get the value of a config/feature-flag/etc.
|
|
|
284
284
|
|
|
285
285
|
```
|
|
286
286
|
USAGE
|
|
287
|
-
$ qfg get [NAME] [--json] [--interactive] [--no-color] [--verbose] [-
|
|
287
|
+
$ qfg get [NAME] [--json] [--interactive] [--no-color] [--verbose] [-w <value>] [--environment <value>]
|
|
288
288
|
|
|
289
289
|
ARGUMENTS
|
|
290
290
|
NAME config/feature-flag/etc. name
|
|
@@ -293,11 +293,11 @@ FLAGS
|
|
|
293
293
|
--environment=<value> environment to evaluate in
|
|
294
294
|
|
|
295
295
|
GLOBAL FLAGS
|
|
296
|
-
-
|
|
297
|
-
--[no-]interactive
|
|
298
|
-
--json
|
|
299
|
-
--no-color
|
|
300
|
-
--verbose
|
|
296
|
+
-w, --workspace=<value> Workspace slug to use (overrides QUONFIG_WORKSPACE env var and saved default)
|
|
297
|
+
--[no-]interactive Force interactive mode
|
|
298
|
+
--json Format output as json.
|
|
299
|
+
--no-color Do not colorize output
|
|
300
|
+
--verbose Verbose output
|
|
301
301
|
|
|
302
302
|
DESCRIPTION
|
|
303
303
|
Get the value of a config/feature-flag/etc.
|
|
@@ -308,7 +308,7 @@ EXAMPLES
|
|
|
308
308
|
$ qfg get my.config.name --environment=production
|
|
309
309
|
```
|
|
310
310
|
|
|
311
|
-
_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.6/src/commands/get.ts)_
|
|
312
312
|
|
|
313
313
|
## `qfg info [NAME]`
|
|
314
314
|
|
|
@@ -316,7 +316,7 @@ Show current values, rules, and evaluation stats for a flag or config.
|
|
|
316
316
|
|
|
317
317
|
```
|
|
318
318
|
USAGE
|
|
319
|
-
$ qfg info [NAME] [--json] [--interactive] [--no-color] [--verbose] [-
|
|
319
|
+
$ qfg info [NAME] [--json] [--interactive] [--no-color] [--verbose] [-w <value>] [--exclude-evaluations]
|
|
320
320
|
|
|
321
321
|
ARGUMENTS
|
|
322
322
|
NAME config/feature-flag/etc. name
|
|
@@ -325,11 +325,11 @@ FLAGS
|
|
|
325
325
|
--exclude-evaluations Exclude evaluation data
|
|
326
326
|
|
|
327
327
|
GLOBAL FLAGS
|
|
328
|
-
-
|
|
329
|
-
--[no-]interactive
|
|
330
|
-
--json
|
|
331
|
-
--no-color
|
|
332
|
-
--verbose
|
|
328
|
+
-w, --workspace=<value> Workspace slug to use (overrides QUONFIG_WORKSPACE env var and saved default)
|
|
329
|
+
--[no-]interactive Force interactive mode
|
|
330
|
+
--json Format output as json.
|
|
331
|
+
--no-color Do not colorize output
|
|
332
|
+
--verbose Verbose output
|
|
333
333
|
|
|
334
334
|
DESCRIPTION
|
|
335
335
|
Show current values, rules, and evaluation stats for a flag or config.
|
|
@@ -352,7 +352,7 @@ EXAMPLES
|
|
|
352
352
|
$ qfg info my.config.name --exclude-evaluations # skip 24h stats
|
|
353
353
|
```
|
|
354
354
|
|
|
355
|
-
_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.6/src/commands/info.ts)_
|
|
356
356
|
|
|
357
357
|
## `qfg init [DIRECTORY]`
|
|
358
358
|
|
|
@@ -390,7 +390,7 @@ EXAMPLES
|
|
|
390
390
|
$ qfg init --dry-run
|
|
391
391
|
```
|
|
392
392
|
|
|
393
|
-
_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.6/src/commands/init.ts)_
|
|
394
394
|
|
|
395
395
|
## `qfg interactive`
|
|
396
396
|
|
|
@@ -408,7 +408,7 @@ EXAMPLES
|
|
|
408
408
|
$ qfg
|
|
409
409
|
```
|
|
410
410
|
|
|
411
|
-
_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.6/src/commands/interactive.ts)_
|
|
412
412
|
|
|
413
413
|
## `qfg list`
|
|
414
414
|
|
|
@@ -416,7 +416,7 @@ Show keys for your config/feature flags/etc.
|
|
|
416
416
|
|
|
417
417
|
```
|
|
418
418
|
USAGE
|
|
419
|
-
$ qfg list [--json] [--interactive] [--no-color] [--verbose] [-
|
|
419
|
+
$ qfg list [--json] [--interactive] [--no-color] [--verbose] [-w <value>] [--configs] [--feature-flags]
|
|
420
420
|
[--log-levels] [--schemas] [--segments]
|
|
421
421
|
|
|
422
422
|
FLAGS
|
|
@@ -427,11 +427,11 @@ FLAGS
|
|
|
427
427
|
--segments include segments
|
|
428
428
|
|
|
429
429
|
GLOBAL FLAGS
|
|
430
|
-
-
|
|
431
|
-
--[no-]interactive
|
|
432
|
-
--json
|
|
433
|
-
--no-color
|
|
434
|
-
--verbose
|
|
430
|
+
-w, --workspace=<value> Workspace slug to use (overrides QUONFIG_WORKSPACE env var and saved default)
|
|
431
|
+
--[no-]interactive Force interactive mode
|
|
432
|
+
--json Format output as json.
|
|
433
|
+
--no-color Do not colorize output
|
|
434
|
+
--verbose Verbose output
|
|
435
435
|
|
|
436
436
|
DESCRIPTION
|
|
437
437
|
Show keys for your config/feature flags/etc.
|
|
@@ -445,7 +445,7 @@ EXAMPLES
|
|
|
445
445
|
$ qfg list --feature-flags
|
|
446
446
|
```
|
|
447
447
|
|
|
448
|
-
_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.6/src/commands/list.ts)_
|
|
449
449
|
|
|
450
450
|
## `qfg login`
|
|
451
451
|
|
|
@@ -453,10 +453,7 @@ Log in to Quonfig via WorkOS device authorization
|
|
|
453
453
|
|
|
454
454
|
```
|
|
455
455
|
USAGE
|
|
456
|
-
$ qfg login [--json] [--interactive] [--no-color] [--verbose]
|
|
457
|
-
|
|
458
|
-
FLAGS
|
|
459
|
-
-p, --profile=<value> Profile name to create or update (defaults to "default")
|
|
456
|
+
$ qfg login [--json] [--interactive] [--no-color] [--verbose]
|
|
460
457
|
|
|
461
458
|
GLOBAL FLAGS
|
|
462
459
|
--[no-]interactive Force interactive mode
|
|
@@ -473,7 +470,7 @@ EXAMPLES
|
|
|
473
470
|
$ qfg login --profile myprofile
|
|
474
471
|
```
|
|
475
472
|
|
|
476
|
-
_See code: [src/commands/login.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
473
|
+
_See code: [src/commands/login.ts](https://github.com/quonfig/cli/blob/v0.0.6/src/commands/login.ts)_
|
|
477
474
|
|
|
478
475
|
## `qfg logout`
|
|
479
476
|
|
|
@@ -496,7 +493,7 @@ EXAMPLES
|
|
|
496
493
|
$ qfg logout
|
|
497
494
|
```
|
|
498
495
|
|
|
499
|
-
_See code: [src/commands/logout.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
496
|
+
_See code: [src/commands/logout.ts](https://github.com/quonfig/cli/blob/v0.0.6/src/commands/logout.ts)_
|
|
500
497
|
|
|
501
498
|
## `qfg mcp`
|
|
502
499
|
|
|
@@ -529,7 +526,7 @@ EXAMPLES
|
|
|
529
526
|
$ qfg mcp --url http://local-app.quonfig-staging.com:3003/api/v1/mcp
|
|
530
527
|
```
|
|
531
528
|
|
|
532
|
-
_See code: [src/commands/mcp.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
529
|
+
_See code: [src/commands/mcp.ts](https://github.com/quonfig/cli/blob/v0.0.6/src/commands/mcp.ts)_
|
|
533
530
|
|
|
534
531
|
## `qfg override [NAME]`
|
|
535
532
|
|
|
@@ -537,7 +534,7 @@ Override the value of an item for your user/SDK key combo
|
|
|
537
534
|
|
|
538
535
|
```
|
|
539
536
|
USAGE
|
|
540
|
-
$ qfg override [NAME] [--json] [--interactive] [--no-color] [--verbose] [-
|
|
537
|
+
$ qfg override [NAME] [--json] [--interactive] [--no-color] [--verbose] [-w <value>] [--environment <value>]
|
|
541
538
|
[--remove] [--value <value>]
|
|
542
539
|
|
|
543
540
|
ARGUMENTS
|
|
@@ -549,11 +546,11 @@ FLAGS
|
|
|
549
546
|
--value=<value> value to use for your override
|
|
550
547
|
|
|
551
548
|
GLOBAL FLAGS
|
|
552
|
-
-
|
|
553
|
-
--[no-]interactive
|
|
554
|
-
--json
|
|
555
|
-
--no-color
|
|
556
|
-
--verbose
|
|
549
|
+
-w, --workspace=<value> Workspace slug to use (overrides QUONFIG_WORKSPACE env var and saved default)
|
|
550
|
+
--[no-]interactive Force interactive mode
|
|
551
|
+
--json Format output as json.
|
|
552
|
+
--no-color Do not colorize output
|
|
553
|
+
--verbose Verbose output
|
|
557
554
|
|
|
558
555
|
DESCRIPTION
|
|
559
556
|
Override the value of an item for your user/SDK key combo
|
|
@@ -568,30 +565,7 @@ EXAMPLES
|
|
|
568
565
|
$ qfg override my.double.config --value=3.14159
|
|
569
566
|
```
|
|
570
567
|
|
|
571
|
-
_See code: [src/commands/override.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
572
|
-
|
|
573
|
-
## `qfg profile`
|
|
574
|
-
|
|
575
|
-
Manage profiles and set default profile
|
|
576
|
-
|
|
577
|
-
```
|
|
578
|
-
USAGE
|
|
579
|
-
$ qfg profile [--json] [--interactive] [--no-color] [--verbose]
|
|
580
|
-
|
|
581
|
-
GLOBAL FLAGS
|
|
582
|
-
--[no-]interactive Force interactive mode
|
|
583
|
-
--json Format output as json.
|
|
584
|
-
--no-color Do not colorize output
|
|
585
|
-
--verbose Verbose output
|
|
586
|
-
|
|
587
|
-
DESCRIPTION
|
|
588
|
-
Manage profiles and set default profile
|
|
589
|
-
|
|
590
|
-
EXAMPLES
|
|
591
|
-
$ qfg profile
|
|
592
|
-
```
|
|
593
|
-
|
|
594
|
-
_See code: [src/commands/profile.ts](https://github.com/quonfig/cli/blob/v0.0.5/src/commands/profile.ts)_
|
|
568
|
+
_See code: [src/commands/override.ts](https://github.com/quonfig/cli/blob/v0.0.6/src/commands/override.ts)_
|
|
595
569
|
|
|
596
570
|
## `qfg pull`
|
|
597
571
|
|
|
@@ -635,7 +609,7 @@ EXAMPLES
|
|
|
635
609
|
$ qfg pull # uses QUONFIG_DIR env var
|
|
636
610
|
```
|
|
637
611
|
|
|
638
|
-
_See code: [src/commands/pull.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
612
|
+
_See code: [src/commands/pull.ts](https://github.com/quonfig/cli/blob/v0.0.6/src/commands/pull.ts)_
|
|
639
613
|
|
|
640
614
|
## `qfg schema NAME`
|
|
641
615
|
|
|
@@ -643,7 +617,7 @@ Get or update first-class schema documents
|
|
|
643
617
|
|
|
644
618
|
```
|
|
645
619
|
USAGE
|
|
646
|
-
$ qfg schema NAME [--json] [--interactive] [--no-color] [--verbose] [-
|
|
620
|
+
$ qfg schema NAME [--json] [--interactive] [--no-color] [--verbose] [-w <value>] [--get] [--protected]
|
|
647
621
|
[--set-json-schema <value>] [--set-zod <value>]
|
|
648
622
|
|
|
649
623
|
ARGUMENTS
|
|
@@ -656,11 +630,11 @@ FLAGS
|
|
|
656
630
|
--set-zod=<value> compatibility alias for --set-json-schema; now expects plain JSON Schema
|
|
657
631
|
|
|
658
632
|
GLOBAL FLAGS
|
|
659
|
-
-
|
|
660
|
-
--[no-]interactive
|
|
661
|
-
--json
|
|
662
|
-
--no-color
|
|
663
|
-
--verbose
|
|
633
|
+
-w, --workspace=<value> Workspace slug to use (overrides QUONFIG_WORKSPACE env var and saved default)
|
|
634
|
+
--[no-]interactive Force interactive mode
|
|
635
|
+
--json Format output as json.
|
|
636
|
+
--no-color Do not colorize output
|
|
637
|
+
--verbose Verbose output
|
|
664
638
|
|
|
665
639
|
DESCRIPTION
|
|
666
640
|
Get or update first-class schema documents
|
|
@@ -673,7 +647,7 @@ EXAMPLES
|
|
|
673
647
|
$ qfg schema my-schema --set-json-schema=@schemas/my-schema.json --protected
|
|
674
648
|
```
|
|
675
649
|
|
|
676
|
-
_See code: [src/commands/schema.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
650
|
+
_See code: [src/commands/schema.ts](https://github.com/quonfig/cli/blob/v0.0.6/src/commands/schema.ts)_
|
|
677
651
|
|
|
678
652
|
## `qfg serve DATA-FILE`
|
|
679
653
|
|
|
@@ -709,7 +683,7 @@ EXAMPLES
|
|
|
709
683
|
$ qfg serve ./quonfig.test.588.config.json --port=3099
|
|
710
684
|
```
|
|
711
685
|
|
|
712
|
-
_See code: [src/commands/serve.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
686
|
+
_See code: [src/commands/serve.ts](https://github.com/quonfig/cli/blob/v0.0.6/src/commands/serve.ts)_
|
|
713
687
|
|
|
714
688
|
## `qfg set-default [NAME]`
|
|
715
689
|
|
|
@@ -717,7 +691,7 @@ Set the unconditional fallback value for a flag or config in a specific environm
|
|
|
717
691
|
|
|
718
692
|
```
|
|
719
693
|
USAGE
|
|
720
|
-
$ qfg set-default [NAME] [--json] [--interactive] [--no-color] [--verbose] [-
|
|
694
|
+
$ qfg set-default [NAME] [--json] [--interactive] [--no-color] [--verbose] [-w <value>] [--confidential]
|
|
721
695
|
[--env-var <value>] [--environment <value>] [--value <value>] [--confirm] [--secret] [--secret-key-name <value>]
|
|
722
696
|
|
|
723
697
|
ARGUMENTS
|
|
@@ -734,11 +708,11 @@ FLAGS
|
|
|
734
708
|
--value=<value> new default value
|
|
735
709
|
|
|
736
710
|
GLOBAL FLAGS
|
|
737
|
-
-
|
|
738
|
-
--[no-]interactive
|
|
739
|
-
--json
|
|
740
|
-
--no-color
|
|
741
|
-
--verbose
|
|
711
|
+
-w, --workspace=<value> Workspace slug to use (overrides QUONFIG_WORKSPACE env var and saved default)
|
|
712
|
+
--[no-]interactive Force interactive mode
|
|
713
|
+
--json Format output as json.
|
|
714
|
+
--no-color Do not colorize output
|
|
715
|
+
--verbose Verbose output
|
|
742
716
|
|
|
743
717
|
DESCRIPTION
|
|
744
718
|
Set the unconditional fallback value for a flag or config in a specific environment.
|
|
@@ -773,7 +747,7 @@ EXAMPLES
|
|
|
773
747
|
$ qfg set-rollout my.flag.name --environment production --true-percent 20
|
|
774
748
|
```
|
|
775
749
|
|
|
776
|
-
_See code: [src/commands/set-default.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
750
|
+
_See code: [src/commands/set-default.ts](https://github.com/quonfig/cli/blob/v0.0.6/src/commands/set-default.ts)_
|
|
777
751
|
|
|
778
752
|
## `qfg set-rollout [NAME]`
|
|
779
753
|
|
|
@@ -781,7 +755,7 @@ Configure a percentage rollout (gradual rollout / A/B test / canary deploy) for
|
|
|
781
755
|
|
|
782
756
|
```
|
|
783
757
|
USAGE
|
|
784
|
-
$ qfg set-rollout [NAME] [--json] [--interactive] [--no-color] [--verbose] [-
|
|
758
|
+
$ qfg set-rollout [NAME] [--json] [--interactive] [--no-color] [--verbose] [-w <value>] [--environment <value>]
|
|
785
759
|
[--hash-by <value>] [--true-percent <value>] [--weights <value>] [--confirm]
|
|
786
760
|
|
|
787
761
|
ARGUMENTS
|
|
@@ -797,11 +771,11 @@ FLAGS
|
|
|
797
771
|
"red:33,green:33,blue:34")
|
|
798
772
|
|
|
799
773
|
GLOBAL FLAGS
|
|
800
|
-
-
|
|
801
|
-
--[no-]interactive
|
|
802
|
-
--json
|
|
803
|
-
--no-color
|
|
804
|
-
--verbose
|
|
774
|
+
-w, --workspace=<value> Workspace slug to use (overrides QUONFIG_WORKSPACE env var and saved default)
|
|
775
|
+
--[no-]interactive Force interactive mode
|
|
776
|
+
--json Format output as json.
|
|
777
|
+
--no-color Do not colorize output
|
|
778
|
+
--verbose Verbose output
|
|
805
779
|
|
|
806
780
|
DESCRIPTION
|
|
807
781
|
Configure a percentage rollout (gradual rollout / A/B test / canary deploy) for a flag.
|
|
@@ -850,7 +824,7 @@ EXAMPLES
|
|
|
850
824
|
$ qfg set-rollout my.variant.flag --environment production --weights "a:33,b:33,c:34" --hash-by user.id
|
|
851
825
|
```
|
|
852
826
|
|
|
853
|
-
_See code: [src/commands/set-rollout.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
827
|
+
_See code: [src/commands/set-rollout.ts](https://github.com/quonfig/cli/blob/v0.0.6/src/commands/set-rollout.ts)_
|
|
854
828
|
|
|
855
829
|
## `qfg sync`
|
|
856
830
|
|
|
@@ -882,7 +856,7 @@ EXAMPLES
|
|
|
882
856
|
$ qfg sync --watch --dir ./our-config --interval 30
|
|
883
857
|
```
|
|
884
858
|
|
|
885
|
-
_See code: [src/commands/sync.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
859
|
+
_See code: [src/commands/sync.ts](https://github.com/quonfig/cli/blob/v0.0.6/src/commands/sync.ts)_
|
|
886
860
|
|
|
887
861
|
## `qfg verify [PATH]`
|
|
888
862
|
|
|
@@ -915,7 +889,7 @@ EXAMPLES
|
|
|
915
889
|
$ qfg verify --json
|
|
916
890
|
```
|
|
917
891
|
|
|
918
|
-
_See code: [src/commands/verify.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
892
|
+
_See code: [src/commands/verify.ts](https://github.com/quonfig/cli/blob/v0.0.6/src/commands/verify.ts)_
|
|
919
893
|
|
|
920
894
|
## `qfg whoami`
|
|
921
895
|
|
|
@@ -938,11 +912,11 @@ EXAMPLES
|
|
|
938
912
|
$ qfg whoami
|
|
939
913
|
```
|
|
940
914
|
|
|
941
|
-
_See code: [src/commands/whoami.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
915
|
+
_See code: [src/commands/whoami.ts](https://github.com/quonfig/cli/blob/v0.0.6/src/commands/whoami.ts)_
|
|
942
916
|
|
|
943
917
|
## `qfg workspace`
|
|
944
918
|
|
|
945
|
-
|
|
919
|
+
Show the current workspace
|
|
946
920
|
|
|
947
921
|
```
|
|
948
922
|
USAGE
|
|
@@ -955,13 +929,13 @@ GLOBAL FLAGS
|
|
|
955
929
|
--verbose Verbose output
|
|
956
930
|
|
|
957
931
|
DESCRIPTION
|
|
958
|
-
|
|
932
|
+
Show the current workspace
|
|
959
933
|
|
|
960
934
|
EXAMPLES
|
|
961
935
|
$ qfg workspace
|
|
962
936
|
```
|
|
963
937
|
|
|
964
|
-
_See code: [src/commands/workspace.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
938
|
+
_See code: [src/commands/workspace.ts](https://github.com/quonfig/cli/blob/v0.0.6/src/commands/workspace.ts)_
|
|
965
939
|
|
|
966
940
|
## `qfg workspace bootstrap`
|
|
967
941
|
|
|
@@ -994,7 +968,30 @@ EXAMPLES
|
|
|
994
968
|
$ qfg workspace bootstrap --dir ./our-config --skip-validate
|
|
995
969
|
```
|
|
996
970
|
|
|
997
|
-
_See code: [src/commands/workspace/bootstrap.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
971
|
+
_See code: [src/commands/workspace/bootstrap.ts](https://github.com/quonfig/cli/blob/v0.0.6/src/commands/workspace/bootstrap.ts)_
|
|
972
|
+
|
|
973
|
+
## `qfg workspace switch`
|
|
974
|
+
|
|
975
|
+
Switch to a different workspace
|
|
976
|
+
|
|
977
|
+
```
|
|
978
|
+
USAGE
|
|
979
|
+
$ qfg workspace switch [--json] [--interactive] [--no-color] [--verbose]
|
|
980
|
+
|
|
981
|
+
GLOBAL FLAGS
|
|
982
|
+
--[no-]interactive Force interactive mode
|
|
983
|
+
--json Format output as json.
|
|
984
|
+
--no-color Do not colorize output
|
|
985
|
+
--verbose Verbose output
|
|
986
|
+
|
|
987
|
+
DESCRIPTION
|
|
988
|
+
Switch to a different workspace
|
|
989
|
+
|
|
990
|
+
EXAMPLES
|
|
991
|
+
$ qfg workspace switch
|
|
992
|
+
```
|
|
993
|
+
|
|
994
|
+
_See code: [src/commands/workspace/switch.ts](https://github.com/quonfig/cli/blob/v0.0.6/src/commands/workspace/switch.ts)_
|
|
998
995
|
<!-- commandsstop -->
|
|
999
996
|
|
|
1000
997
|
## Local Development
|
|
@@ -1011,10 +1008,13 @@ fish -c "cd ../../quonfig/cli;bin/dev.js"
|
|
|
1011
1008
|
|
|
1012
1009
|
## Releasing
|
|
1013
1010
|
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1011
|
+
Publishing is fully automated via CI. To ship a new version:
|
|
1012
|
+
|
|
1013
|
+
1. Bump the version in `package.json`
|
|
1014
|
+
2. Add an entry to `CHANGELOG.md`
|
|
1015
|
+
3. Commit and push to `main`
|
|
1016
|
+
|
|
1017
|
+
The [release workflow](.github/workflows/release.yaml) detects that the version in `package.json` is not yet on npm and publishes automatically using GitHub OIDC (no npm token or OTP needed locally).
|
|
1018
1018
|
|
|
1019
1019
|
## Contributing
|
|
1020
1020
|
|
package/dist/commands/login.js
CHANGED
|
@@ -10,7 +10,8 @@ export default class Login extends BaseCommand {
|
|
|
10
10
|
static flags = {
|
|
11
11
|
profile: Flags.string({
|
|
12
12
|
char: 'p',
|
|
13
|
-
description: 'Profile name to
|
|
13
|
+
description: 'Profile name to save credentials under (advanced; defaults to "default")',
|
|
14
|
+
hidden: true,
|
|
14
15
|
}),
|
|
15
16
|
};
|
|
16
17
|
async run() {
|
|
@@ -56,6 +57,8 @@ export default class Login extends BaseCommand {
|
|
|
56
57
|
let workspaceName;
|
|
57
58
|
let workspaceSlug;
|
|
58
59
|
let organizationName;
|
|
60
|
+
let organizationId;
|
|
61
|
+
let multipleWorkspacesAvailable = false;
|
|
59
62
|
try {
|
|
60
63
|
const apiUrl = getApiUrl();
|
|
61
64
|
this.verboseLog('Resolving workspace...', { apiUrl, orgId });
|
|
@@ -70,17 +73,15 @@ export default class Login extends BaseCommand {
|
|
|
70
73
|
if (res.ok) {
|
|
71
74
|
const body = await res.json();
|
|
72
75
|
const allWorkspaces = (body.json ?? body);
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
: [];
|
|
76
|
-
const candidates = orgWorkspaces.length > 0 ? orgWorkspaces : (Array.isArray(allWorkspaces) ? allWorkspaces : []);
|
|
76
|
+
const candidates = Array.isArray(allWorkspaces) ? allWorkspaces : [];
|
|
77
|
+
multipleWorkspacesAvailable = candidates.length > 1;
|
|
77
78
|
let match;
|
|
78
79
|
if (candidates.length === 1) {
|
|
79
80
|
match = candidates[0];
|
|
80
81
|
}
|
|
81
82
|
else if (candidates.length > 1) {
|
|
82
83
|
const chosen = await select({
|
|
83
|
-
choices: candidates.map((w) => ({ name: w.workspaceSlug
|
|
84
|
+
choices: candidates.map((w) => ({ name: `${w.organizationName} / ${w.workspaceSlug}`, value: w.workspaceId })),
|
|
84
85
|
message: 'Select workspace:',
|
|
85
86
|
});
|
|
86
87
|
match = candidates.find((w) => w.workspaceId === chosen);
|
|
@@ -90,6 +91,7 @@ export default class Login extends BaseCommand {
|
|
|
90
91
|
workspaceName = match.workspaceSlug;
|
|
91
92
|
workspaceSlug = match.workspaceSlug;
|
|
92
93
|
organizationName = match.organizationName;
|
|
94
|
+
organizationId = match.workosOrgId;
|
|
93
95
|
this.verboseLog('Resolved workspace', { workspaceId, workspaceName, workspaceSlug, organizationName });
|
|
94
96
|
}
|
|
95
97
|
}
|
|
@@ -113,33 +115,35 @@ export default class Login extends BaseCommand {
|
|
|
113
115
|
workspace: workspaceId || orgId || 'unknown',
|
|
114
116
|
workspaceName: workspaceName || (orgId ? `org:${orgId}` : undefined),
|
|
115
117
|
workspaceSlug,
|
|
118
|
+
organizationName,
|
|
116
119
|
},
|
|
117
120
|
},
|
|
118
121
|
});
|
|
119
|
-
this.log(`\nProfile '${profileName}' configured.`);
|
|
120
|
-
if (shouldSetDefault) {
|
|
121
|
-
this.log('Set as default profile.');
|
|
122
|
-
}
|
|
123
122
|
this.log('\nSuccessfully logged in!');
|
|
124
123
|
if (userEmail) {
|
|
125
124
|
this.log(`Logged in as: ${userEmail}`);
|
|
126
125
|
}
|
|
127
126
|
if (workspaceName) {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
const orgPrefix = organizationName ? `${organizationName} / ` : '';
|
|
128
|
+
this.log(`Workspace: ${orgPrefix}${workspaceName}`);
|
|
129
|
+
if (workspaceId) {
|
|
130
|
+
this.log(` (${workspaceId})`);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
else if (orgId) {
|
|
134
134
|
this.log(`Organization: ${orgId}`);
|
|
135
135
|
}
|
|
136
|
+
if (multipleWorkspacesAvailable) {
|
|
137
|
+
this.log(`\nTo switch workspaces: qfg workspace switch`);
|
|
138
|
+
}
|
|
136
139
|
return {
|
|
137
140
|
email: userEmail,
|
|
138
|
-
organizationId: orgId,
|
|
139
|
-
|
|
141
|
+
organizationId: organizationId || orgId,
|
|
142
|
+
organizationName,
|
|
140
143
|
success: true,
|
|
141
144
|
userId: user.id,
|
|
142
145
|
workspaceId,
|
|
146
|
+
workspaceSlug,
|
|
143
147
|
};
|
|
144
148
|
}
|
|
145
149
|
}
|