@quonfig/cli 0.0.39 → 0.0.41
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 +190 -43
- package/dist/commands/login.js +1 -1
- package/dist/commands/migrate/my-code.js +2 -5
- package/dist/commands/pull.d.ts +11 -11
- package/dist/commands/pull.js +20 -19
- package/dist/commands/push.js +2 -2
- package/dist/commands/run.d.ts +46 -0
- package/dist/commands/run.js +324 -0
- package/dist/commands/set-default.js +3 -6
- package/dist/commands/sync.d.ts +1 -1
- package/dist/commands/sync.js +1 -1
- package/dist/commands/whoami.d.ts +6 -6
- package/dist/commands/whoami.js +27 -27
- package/dist/commands/workspace/create.d.ts +6 -6
- package/dist/commands/workspace/create.js +31 -27
- package/dist/commands/workspace/switch.d.ts +7 -7
- package/dist/commands/workspace/switch.js +36 -36
- package/dist/commands/workspace.d.ts +7 -7
- package/dist/commands/workspace.js +41 -43
- package/dist/push/run-push.d.ts +16 -16
- package/dist/util/config-value-dto.js +10 -6
- package/dist/util/git-ops.js +5 -10
- package/dist/util/open-browser.js +1 -1
- package/dist/util/parse-run-env-spec.d.ts +23 -0
- package/dist/util/parse-run-env-spec.js +56 -0
- package/dist/util/quonfig-json.js +2 -2
- package/dist/util/resolve-run-environment.d.ts +46 -0
- package/dist/util/resolve-run-environment.js +52 -0
- package/dist/util/resolve-workspace.d.ts +1 -1
- package/dist/util/token-storage.d.ts +6 -6
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/oclif.manifest.json +114 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
<!-- toc -->
|
|
4
4
|
* [Quonfig CLI](#quonfig-cli)
|
|
5
5
|
* [Usage](#usage)
|
|
6
|
+
* [Running commands with injected env](#running-commands-with-injected-env)
|
|
7
|
+
* [.qfg.env](#qfgenv)
|
|
8
|
+
* [blank lines and # comments are skipped](#blank-lines-and--comments-are-skipped)
|
|
6
9
|
* [Commands](#commands)
|
|
7
10
|
<!-- tocstop -->
|
|
8
11
|
|
|
@@ -14,7 +17,7 @@ $ npm install -g @quonfig/cli
|
|
|
14
17
|
$ qfg COMMAND
|
|
15
18
|
running command...
|
|
16
19
|
$ qfg (--version)
|
|
17
|
-
@quonfig/cli/0.0.
|
|
20
|
+
@quonfig/cli/0.0.41 linux-x64 node-v24.4.1
|
|
18
21
|
$ qfg --help [COMMAND]
|
|
19
22
|
USAGE
|
|
20
23
|
$ qfg COMMAND
|
|
@@ -22,6 +25,98 @@ USAGE
|
|
|
22
25
|
```
|
|
23
26
|
<!-- usagestop -->
|
|
24
27
|
|
|
28
|
+
# Running commands with injected env
|
|
29
|
+
|
|
30
|
+
Some workflows need Quonfig values to land in `process.env` **before** application
|
|
31
|
+
code runs — Drizzle migrations read `DATABASE_URL` at module import, `next-auth`
|
|
32
|
+
reads `AUTH_SECRET` automatically, and arbitrary build steps / one-shot scripts
|
|
33
|
+
can't always go through `instrumentation.ts`. Use `qfg run` to resolve configs
|
|
34
|
+
and exec the child with those vars merged into its environment.
|
|
35
|
+
|
|
36
|
+
The flag separator `--` is **required** between `qfg run` flags and the child
|
|
37
|
+
command — without it, oclif tries to parse the child's flags as its own.
|
|
38
|
+
|
|
39
|
+
## Inline form
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
qfg run \
|
|
43
|
+
--env DATABASE_URL=db.url \
|
|
44
|
+
--env AUTH_SECRET=auth.secret \
|
|
45
|
+
--environment=staging \
|
|
46
|
+
-- \
|
|
47
|
+
npm run migrate
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The grammar is `VAR=key.path` (uses `=`, not `:`, to match `docker -e VAR=value`
|
|
51
|
+
muscle memory). `--env` is repeatable.
|
|
52
|
+
|
|
53
|
+
## File form
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
# .qfg.env
|
|
57
|
+
DATABASE_URL=db.url
|
|
58
|
+
AUTH_SECRET=auth.secret
|
|
59
|
+
# blank lines and # comments are skipped
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
qfg run --env-file=.qfg.env --environment=staging -- npm run migrate
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Auth / environment is binary
|
|
67
|
+
|
|
68
|
+
`qfg run` enforces a strict either/or rule, never a precedence chain. This is
|
|
69
|
+
intentional — a "match-only" exception drifts silently in CI and masks
|
|
70
|
+
misconfiguration.
|
|
71
|
+
|
|
72
|
+
| Mode | When | Provides |
|
|
73
|
+
|-------|-----------------------------------------|-----------------------------------------------------------|
|
|
74
|
+
| **A** | `QUONFIG_BACKEND_SDK_KEY` is set | env + workspace from the SDK key |
|
|
75
|
+
| **B** | No SDK key — uses `qfg login` user auth | `--environment` _or_ `QUONFIG_ENVIRONMENT` (exactly one) |
|
|
76
|
+
|
|
77
|
+
Mixing the two is an error:
|
|
78
|
+
|
|
79
|
+
- Mode A + `--environment` (or `QUONFIG_ENVIRONMENT`) → exits non-zero before
|
|
80
|
+
spawning, even if they would agree.
|
|
81
|
+
- Mode B with neither → exits non-zero.
|
|
82
|
+
- Mode B with both `--environment` and `QUONFIG_ENVIRONMENT` → exits non-zero.
|
|
83
|
+
|
|
84
|
+
There is **no interactive prompt**. `qfg run` is meant for scripts and CI;
|
|
85
|
+
prompting mid-`&&`-chain would be worse UX than failing loud.
|
|
86
|
+
|
|
87
|
+
## Override vs preserve
|
|
88
|
+
|
|
89
|
+
By default `qfg run` **overrides** any value already set in the parent env —
|
|
90
|
+
the whole point is "make these vars come from Quonfig." Pass `--preserve-env`
|
|
91
|
+
to flip that: vars already set in the parent are kept, and only unset vars
|
|
92
|
+
are filled in.
|
|
93
|
+
|
|
94
|
+
```sh
|
|
95
|
+
qfg run --env DATABASE_URL=db.url --preserve-env --environment=staging -- npm test
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Missing keys fail before the child spawns
|
|
99
|
+
|
|
100
|
+
If any requested config key is missing from the workspace, `qfg run` exits
|
|
101
|
+
non-zero with a list of the missing keys and never spawns the child. This
|
|
102
|
+
avoids the trap where the child blows up later with an empty value and the
|
|
103
|
+
real cause is buried under unrelated stack traces.
|
|
104
|
+
|
|
105
|
+
## package.json example
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"scripts": {
|
|
110
|
+
"migrate": "qfg run --env-file=.qfg.env --environment=staging -- drizzle-kit migrate",
|
|
111
|
+
"migrate:prod": "qfg run --env-file=.qfg.env -- drizzle-kit migrate"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
The first uses Mode B (`--environment=staging` flag). The second relies on
|
|
117
|
+
`QUONFIG_BACKEND_SDK_KEY` being set in the prod environment (Mode A) so the
|
|
118
|
+
script doesn't need to know which env it's running in.
|
|
119
|
+
|
|
25
120
|
# Commands
|
|
26
121
|
|
|
27
122
|
<!-- commands -->
|
|
@@ -56,6 +151,7 @@ USAGE
|
|
|
56
151
|
* [`qfg override [NAME] [VALUE]`](#qfg-override-name-value)
|
|
57
152
|
* [`qfg pull`](#qfg-pull)
|
|
58
153
|
* [`qfg push`](#qfg-push)
|
|
154
|
+
* [`qfg run [COMMAND]`](#qfg-run-command)
|
|
59
155
|
* [`qfg schema NAME`](#qfg-schema-name)
|
|
60
156
|
* [`qfg sdk-key`](#qfg-sdk-key)
|
|
61
157
|
* [`qfg sdk-key create`](#qfg-sdk-key-create)
|
|
@@ -99,7 +195,7 @@ EXAMPLES
|
|
|
99
195
|
$ qfg activity restore my.flag --yes
|
|
100
196
|
```
|
|
101
197
|
|
|
102
|
-
_See code: [src/commands/activity.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
198
|
+
_See code: [src/commands/activity.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/activity.ts)_
|
|
103
199
|
|
|
104
200
|
## `qfg activity deleted`
|
|
105
201
|
|
|
@@ -128,7 +224,7 @@ EXAMPLES
|
|
|
128
224
|
$ qfg activity deleted --json
|
|
129
225
|
```
|
|
130
226
|
|
|
131
|
-
_See code: [src/commands/activity/deleted.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
227
|
+
_See code: [src/commands/activity/deleted.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/activity/deleted.ts)_
|
|
132
228
|
|
|
133
229
|
## `qfg activity feed`
|
|
134
230
|
|
|
@@ -163,7 +259,7 @@ EXAMPLES
|
|
|
163
259
|
$ qfg activity feed --json
|
|
164
260
|
```
|
|
165
261
|
|
|
166
|
-
_See code: [src/commands/activity/feed.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
262
|
+
_See code: [src/commands/activity/feed.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/activity/feed.ts)_
|
|
167
263
|
|
|
168
264
|
## `qfg activity history [NAME]`
|
|
169
265
|
|
|
@@ -197,7 +293,7 @@ EXAMPLES
|
|
|
197
293
|
$ qfg activity history request.timeout --json
|
|
198
294
|
```
|
|
199
295
|
|
|
200
|
-
_See code: [src/commands/activity/history.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
296
|
+
_See code: [src/commands/activity/history.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/activity/history.ts)_
|
|
201
297
|
|
|
202
298
|
## `qfg activity restore [NAME]`
|
|
203
299
|
|
|
@@ -236,7 +332,7 @@ EXAMPLES
|
|
|
236
332
|
$ qfg activity restore request.timeout --type config --yes
|
|
237
333
|
```
|
|
238
334
|
|
|
239
|
-
_See code: [src/commands/activity/restore.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
335
|
+
_See code: [src/commands/activity/restore.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/activity/restore.ts)_
|
|
240
336
|
|
|
241
337
|
## `qfg audit-log [NAME]`
|
|
242
338
|
|
|
@@ -264,7 +360,7 @@ EXAMPLES
|
|
|
264
360
|
$ qfg audit-log my.flag
|
|
265
361
|
```
|
|
266
362
|
|
|
267
|
-
_See code: [src/commands/audit-log.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
363
|
+
_See code: [src/commands/audit-log.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/audit-log.ts)_
|
|
268
364
|
|
|
269
365
|
## `qfg config-schema`
|
|
270
366
|
|
|
@@ -293,7 +389,7 @@ EXAMPLES
|
|
|
293
389
|
$ qfg config-schema --json-schema # full JSON Schema document (copy into your editor)
|
|
294
390
|
```
|
|
295
391
|
|
|
296
|
-
_See code: [src/commands/config-schema.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
392
|
+
_See code: [src/commands/config-schema.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/config-schema.ts)_
|
|
297
393
|
|
|
298
394
|
## `qfg create NAME`
|
|
299
395
|
|
|
@@ -378,7 +474,7 @@ EXAMPLES
|
|
|
378
474
|
$ qfg set-rollout my.new.flag --environment production --true-percent 20
|
|
379
475
|
```
|
|
380
476
|
|
|
381
|
-
_See code: [src/commands/create.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
477
|
+
_See code: [src/commands/create.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/create.ts)_
|
|
382
478
|
|
|
383
479
|
## `qfg delete NAME`
|
|
384
480
|
|
|
@@ -424,7 +520,7 @@ EXAMPLES
|
|
|
424
520
|
$ qfg delete my.config --yes
|
|
425
521
|
```
|
|
426
522
|
|
|
427
|
-
_See code: [src/commands/delete.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
523
|
+
_See code: [src/commands/delete.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/delete.ts)_
|
|
428
524
|
|
|
429
525
|
## `qfg flag info [NAME]`
|
|
430
526
|
|
|
@@ -627,7 +723,7 @@ EXAMPLES
|
|
|
627
723
|
$ qfg generate --targets node-ts -o ./dist # combine with targets
|
|
628
724
|
```
|
|
629
725
|
|
|
630
|
-
_See code: [src/commands/generate.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
726
|
+
_See code: [src/commands/generate.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/generate.ts)_
|
|
631
727
|
|
|
632
728
|
## `qfg generate-new-hex-key`
|
|
633
729
|
|
|
@@ -650,7 +746,7 @@ EXAMPLES
|
|
|
650
746
|
$ qfg generate-new-hex-key
|
|
651
747
|
```
|
|
652
748
|
|
|
653
|
-
_See code: [src/commands/generate-new-hex-key.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
749
|
+
_See code: [src/commands/generate-new-hex-key.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/generate-new-hex-key.ts)_
|
|
654
750
|
|
|
655
751
|
## `qfg get [NAME]`
|
|
656
752
|
|
|
@@ -682,7 +778,7 @@ EXAMPLES
|
|
|
682
778
|
$ qfg get my.config.name --environment=production
|
|
683
779
|
```
|
|
684
780
|
|
|
685
|
-
_See code: [src/commands/get.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
781
|
+
_See code: [src/commands/get.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/get.ts)_
|
|
686
782
|
|
|
687
783
|
## `qfg history NAME`
|
|
688
784
|
|
|
@@ -708,7 +804,7 @@ EXAMPLES
|
|
|
708
804
|
$ qfg history my.flag
|
|
709
805
|
```
|
|
710
806
|
|
|
711
|
-
_See code: [src/commands/history.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
807
|
+
_See code: [src/commands/history.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/history.ts)_
|
|
712
808
|
|
|
713
809
|
## `qfg info [NAME]`
|
|
714
810
|
|
|
@@ -756,7 +852,7 @@ EXAMPLES
|
|
|
756
852
|
$ qfg info my.config.name --exclude-evaluations # skip 24h stats
|
|
757
853
|
```
|
|
758
854
|
|
|
759
|
-
_See code: [src/commands/info.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
855
|
+
_See code: [src/commands/info.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/info.ts)_
|
|
760
856
|
|
|
761
857
|
## `qfg init [DIRECTORY]`
|
|
762
858
|
|
|
@@ -796,7 +892,7 @@ EXAMPLES
|
|
|
796
892
|
$ qfg init --dry-run
|
|
797
893
|
```
|
|
798
894
|
|
|
799
|
-
_See code: [src/commands/init.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
895
|
+
_See code: [src/commands/init.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/init.ts)_
|
|
800
896
|
|
|
801
897
|
## `qfg interactive`
|
|
802
898
|
|
|
@@ -826,7 +922,7 @@ EXAMPLES
|
|
|
826
922
|
$ qfg
|
|
827
923
|
```
|
|
828
924
|
|
|
829
|
-
_See code: [src/commands/interactive.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
925
|
+
_See code: [src/commands/interactive.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/interactive.ts)_
|
|
830
926
|
|
|
831
927
|
## `qfg list`
|
|
832
928
|
|
|
@@ -866,7 +962,7 @@ EXAMPLES
|
|
|
866
962
|
$ qfg list --feature-flags
|
|
867
963
|
```
|
|
868
964
|
|
|
869
|
-
_See code: [src/commands/list.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
965
|
+
_See code: [src/commands/list.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/list.ts)_
|
|
870
966
|
|
|
871
967
|
## `qfg log`
|
|
872
968
|
|
|
@@ -891,7 +987,7 @@ EXAMPLES
|
|
|
891
987
|
$ qfg log --limit 5
|
|
892
988
|
```
|
|
893
989
|
|
|
894
|
-
_See code: [src/commands/log.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
990
|
+
_See code: [src/commands/log.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/log.ts)_
|
|
895
991
|
|
|
896
992
|
## `qfg log-level NAME`
|
|
897
993
|
|
|
@@ -956,7 +1052,7 @@ EXAMPLES
|
|
|
956
1052
|
$ qfg log-level log-level.my-app --target=Chatty --value=INFO --environment=production
|
|
957
1053
|
```
|
|
958
1054
|
|
|
959
|
-
_See code: [src/commands/log-level.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1055
|
+
_See code: [src/commands/log-level.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/log-level.ts)_
|
|
960
1056
|
|
|
961
1057
|
## `qfg login`
|
|
962
1058
|
|
|
@@ -981,7 +1077,7 @@ EXAMPLES
|
|
|
981
1077
|
$ qfg login --profile myprofile
|
|
982
1078
|
```
|
|
983
1079
|
|
|
984
|
-
_See code: [src/commands/login.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1080
|
+
_See code: [src/commands/login.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/login.ts)_
|
|
985
1081
|
|
|
986
1082
|
## `qfg logout`
|
|
987
1083
|
|
|
@@ -1004,7 +1100,7 @@ EXAMPLES
|
|
|
1004
1100
|
$ qfg logout
|
|
1005
1101
|
```
|
|
1006
1102
|
|
|
1007
|
-
_See code: [src/commands/logout.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1103
|
+
_See code: [src/commands/logout.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/logout.ts)_
|
|
1008
1104
|
|
|
1009
1105
|
## `qfg migrate`
|
|
1010
1106
|
|
|
@@ -1058,7 +1154,7 @@ EXAMPLES
|
|
|
1058
1154
|
$ qfg migrate --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-repo --staging
|
|
1059
1155
|
```
|
|
1060
1156
|
|
|
1061
|
-
_See code: [src/commands/migrate.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1157
|
+
_See code: [src/commands/migrate.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/migrate.ts)_
|
|
1062
1158
|
|
|
1063
1159
|
## `qfg migrate doctor`
|
|
1064
1160
|
|
|
@@ -1096,7 +1192,7 @@ EXAMPLES
|
|
|
1096
1192
|
$ qfg migrate doctor --json
|
|
1097
1193
|
```
|
|
1098
1194
|
|
|
1099
|
-
_See code: [src/commands/migrate/doctor.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1195
|
+
_See code: [src/commands/migrate/doctor.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/migrate/doctor.ts)_
|
|
1100
1196
|
|
|
1101
1197
|
## `qfg migrate my-code`
|
|
1102
1198
|
|
|
@@ -1128,7 +1224,7 @@ EXAMPLES
|
|
|
1128
1224
|
$ qfg migrate my-code --dry-run
|
|
1129
1225
|
```
|
|
1130
1226
|
|
|
1131
|
-
_See code: [src/commands/migrate/my-code.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1227
|
+
_See code: [src/commands/migrate/my-code.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/migrate/my-code.ts)_
|
|
1132
1228
|
|
|
1133
1229
|
## `qfg migrate status`
|
|
1134
1230
|
|
|
@@ -1159,7 +1255,7 @@ EXAMPLES
|
|
|
1159
1255
|
$ qfg migrate status --json
|
|
1160
1256
|
```
|
|
1161
1257
|
|
|
1162
|
-
_See code: [src/commands/migrate/status.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1258
|
+
_See code: [src/commands/migrate/status.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/migrate/status.ts)_
|
|
1163
1259
|
|
|
1164
1260
|
## `qfg override [NAME] [VALUE]`
|
|
1165
1261
|
|
|
@@ -1214,7 +1310,7 @@ EXAMPLES
|
|
|
1214
1310
|
$ qfg override my.flag true --env=staging
|
|
1215
1311
|
```
|
|
1216
1312
|
|
|
1217
|
-
_See code: [src/commands/override.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1313
|
+
_See code: [src/commands/override.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/override.ts)_
|
|
1218
1314
|
|
|
1219
1315
|
## `qfg pull`
|
|
1220
1316
|
|
|
@@ -1261,7 +1357,7 @@ EXAMPLES
|
|
|
1261
1357
|
$ qfg pull # uses QUONFIG_DIR env var
|
|
1262
1358
|
```
|
|
1263
1359
|
|
|
1264
|
-
_See code: [src/commands/pull.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1360
|
+
_See code: [src/commands/pull.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/pull.ts)_
|
|
1265
1361
|
|
|
1266
1362
|
## `qfg push`
|
|
1267
1363
|
|
|
@@ -1309,7 +1405,58 @@ EXAMPLES
|
|
|
1309
1405
|
$ qfg push --dir ./our-config --yes
|
|
1310
1406
|
```
|
|
1311
1407
|
|
|
1312
|
-
_See code: [src/commands/push.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1408
|
+
_See code: [src/commands/push.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/push.ts)_
|
|
1409
|
+
|
|
1410
|
+
## `qfg run [COMMAND]`
|
|
1411
|
+
|
|
1412
|
+
Run a child process with Quonfig configs injected as env vars.
|
|
1413
|
+
|
|
1414
|
+
```
|
|
1415
|
+
USAGE
|
|
1416
|
+
$ qfg run [COMMAND...] [--json] [--interactive] [--no-color] [--verbose] [-w <value>] [--env
|
|
1417
|
+
<value>...] [--env-file <value>] [--environment <value>] [--preserve-env]
|
|
1418
|
+
|
|
1419
|
+
ARGUMENTS
|
|
1420
|
+
COMMAND... child command (after '--')
|
|
1421
|
+
|
|
1422
|
+
FLAGS
|
|
1423
|
+
--env=<value>... [default: ] Inline env mapping in VAR=key.path form. Repeatable.
|
|
1424
|
+
--env-file=<value> Path to a file with one VAR=key.path per line (# comments and blank lines OK).
|
|
1425
|
+
--environment=<value> Quonfig environment to evaluate in (Mode B). Mutually exclusive with QUONFIG_ENVIRONMENT.
|
|
1426
|
+
--preserve-env Skip vars that are already set in the parent env. Default: override.
|
|
1427
|
+
|
|
1428
|
+
GLOBAL FLAGS
|
|
1429
|
+
-w, --workspace=<value> Workspace slug to use (overrides QUONFIG_WORKSPACE env var and saved default)
|
|
1430
|
+
--[no-]interactive Force interactive mode
|
|
1431
|
+
--json Format output as json.
|
|
1432
|
+
--no-color Do not colorize output
|
|
1433
|
+
--verbose Verbose output
|
|
1434
|
+
|
|
1435
|
+
DESCRIPTION
|
|
1436
|
+
Run a child process with Quonfig configs injected as env vars.
|
|
1437
|
+
|
|
1438
|
+
Resolves --env VAR=key.path mappings (and --env-file lines) against your
|
|
1439
|
+
workspace, merges them into the parent env, and exec's the child command.
|
|
1440
|
+
Exits with the child's exit code. Missing keys → fail before spawning.
|
|
1441
|
+
|
|
1442
|
+
Auth / environment is BINARY:
|
|
1443
|
+
Mode A — QUONFIG_BACKEND_SDK_KEY set: env is encoded in the key.
|
|
1444
|
+
Setting --environment OR QUONFIG_ENVIRONMENT alongside is an error.
|
|
1445
|
+
Mode B — no SDK key: pass exactly one of --environment or QUONFIG_ENVIRONMENT.
|
|
1446
|
+
|
|
1447
|
+
The flag separator '--' is REQUIRED between qfg flags and the child command.
|
|
1448
|
+
|
|
1449
|
+
EXAMPLES
|
|
1450
|
+
$ qfg run --env DATABASE_URL=db.url --environment=staging -- env
|
|
1451
|
+
|
|
1452
|
+
$ qfg run --env-file=.qfg.env --environment=staging -- npm run migrate
|
|
1453
|
+
|
|
1454
|
+
$ qfg run --env DATABASE_URL=db.url -- ./bin/migrate.js # Mode A: relies on QUONFIG_BACKEND_SDK_KEY
|
|
1455
|
+
|
|
1456
|
+
$ qfg run --env DATABASE_URL=db.url --preserve-env --environment=staging -- npm test
|
|
1457
|
+
```
|
|
1458
|
+
|
|
1459
|
+
_See code: [src/commands/run.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/run.ts)_
|
|
1313
1460
|
|
|
1314
1461
|
## `qfg schema NAME`
|
|
1315
1462
|
|
|
@@ -1347,7 +1494,7 @@ EXAMPLES
|
|
|
1347
1494
|
$ qfg schema my-schema --set-json-schema=@schemas/my-schema.json --protected
|
|
1348
1495
|
```
|
|
1349
1496
|
|
|
1350
|
-
_See code: [src/commands/schema.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1497
|
+
_See code: [src/commands/schema.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/schema.ts)_
|
|
1351
1498
|
|
|
1352
1499
|
## `qfg sdk-key`
|
|
1353
1500
|
|
|
@@ -1374,7 +1521,7 @@ EXAMPLES
|
|
|
1374
1521
|
$ qfg sdk-key revoke <key-id>
|
|
1375
1522
|
```
|
|
1376
1523
|
|
|
1377
|
-
_See code: [src/commands/sdk-key.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1524
|
+
_See code: [src/commands/sdk-key.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/sdk-key.ts)_
|
|
1378
1525
|
|
|
1379
1526
|
## `qfg sdk-key create`
|
|
1380
1527
|
|
|
@@ -1406,7 +1553,7 @@ EXAMPLES
|
|
|
1406
1553
|
$ qfg sdk-key create --environment staging --type browser
|
|
1407
1554
|
```
|
|
1408
1555
|
|
|
1409
|
-
_See code: [src/commands/sdk-key/create.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1556
|
+
_See code: [src/commands/sdk-key/create.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/sdk-key/create.ts)_
|
|
1410
1557
|
|
|
1411
1558
|
## `qfg sdk-key list`
|
|
1412
1559
|
|
|
@@ -1435,7 +1582,7 @@ EXAMPLES
|
|
|
1435
1582
|
$ qfg sdk-key list --environment production
|
|
1436
1583
|
```
|
|
1437
1584
|
|
|
1438
|
-
_See code: [src/commands/sdk-key/list.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1585
|
+
_See code: [src/commands/sdk-key/list.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/sdk-key/list.ts)_
|
|
1439
1586
|
|
|
1440
1587
|
## `qfg sdk-key revoke KEYID`
|
|
1441
1588
|
|
|
@@ -1462,7 +1609,7 @@ EXAMPLES
|
|
|
1462
1609
|
$ qfg sdk-key revoke a1b2c3d4-e5f6-7890-abcd-ef1234567890
|
|
1463
1610
|
```
|
|
1464
1611
|
|
|
1465
|
-
_See code: [src/commands/sdk-key/revoke.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1612
|
+
_See code: [src/commands/sdk-key/revoke.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/sdk-key/revoke.ts)_
|
|
1466
1613
|
|
|
1467
1614
|
## `qfg set-default [NAME]`
|
|
1468
1615
|
|
|
@@ -1533,7 +1680,7 @@ EXAMPLES
|
|
|
1533
1680
|
$ qfg pull && qfg config-schema
|
|
1534
1681
|
```
|
|
1535
1682
|
|
|
1536
|
-
_See code: [src/commands/set-default.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1683
|
+
_See code: [src/commands/set-default.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/set-default.ts)_
|
|
1537
1684
|
|
|
1538
1685
|
## `qfg set-rollout [NAME]`
|
|
1539
1686
|
|
|
@@ -1610,7 +1757,7 @@ EXAMPLES
|
|
|
1610
1757
|
$ qfg set-rollout my.variant.flag --environment production --weights "a:33,b:33,c:34" --hash-by user.id
|
|
1611
1758
|
```
|
|
1612
1759
|
|
|
1613
|
-
_See code: [src/commands/set-rollout.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1760
|
+
_See code: [src/commands/set-rollout.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/set-rollout.ts)_
|
|
1614
1761
|
|
|
1615
1762
|
## `qfg sync`
|
|
1616
1763
|
|
|
@@ -1642,7 +1789,7 @@ EXAMPLES
|
|
|
1642
1789
|
$ qfg sync --watch --dir ./our-config --interval 30
|
|
1643
1790
|
```
|
|
1644
1791
|
|
|
1645
|
-
_See code: [src/commands/sync.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1792
|
+
_See code: [src/commands/sync.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/sync.ts)_
|
|
1646
1793
|
|
|
1647
1794
|
## `qfg toggle [NAME]`
|
|
1648
1795
|
|
|
@@ -1744,7 +1891,7 @@ EXAMPLES
|
|
|
1744
1891
|
$ qfg verify --json
|
|
1745
1892
|
```
|
|
1746
1893
|
|
|
1747
|
-
_See code: [src/commands/verify.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1894
|
+
_See code: [src/commands/verify.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/verify.ts)_
|
|
1748
1895
|
|
|
1749
1896
|
## `qfg whoami`
|
|
1750
1897
|
|
|
@@ -1767,7 +1914,7 @@ EXAMPLES
|
|
|
1767
1914
|
$ qfg whoami
|
|
1768
1915
|
```
|
|
1769
1916
|
|
|
1770
|
-
_See code: [src/commands/whoami.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1917
|
+
_See code: [src/commands/whoami.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/whoami.ts)_
|
|
1771
1918
|
|
|
1772
1919
|
## `qfg workspace`
|
|
1773
1920
|
|
|
@@ -1790,7 +1937,7 @@ EXAMPLES
|
|
|
1790
1937
|
$ qfg workspace
|
|
1791
1938
|
```
|
|
1792
1939
|
|
|
1793
|
-
_See code: [src/commands/workspace.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1940
|
+
_See code: [src/commands/workspace.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/workspace.ts)_
|
|
1794
1941
|
|
|
1795
1942
|
## `qfg workspace bootstrap`
|
|
1796
1943
|
|
|
@@ -1823,7 +1970,7 @@ EXAMPLES
|
|
|
1823
1970
|
$ qfg workspace bootstrap --dir ./our-config --skip-validate
|
|
1824
1971
|
```
|
|
1825
1972
|
|
|
1826
|
-
_See code: [src/commands/workspace/bootstrap.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
1973
|
+
_See code: [src/commands/workspace/bootstrap.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/workspace/bootstrap.ts)_
|
|
1827
1974
|
|
|
1828
1975
|
## `qfg workspace create SLUG`
|
|
1829
1976
|
|
|
@@ -1857,7 +2004,7 @@ EXAMPLES
|
|
|
1857
2004
|
$ qfg workspace create my-team --org 11111111-1111-1111-1111-111111111111
|
|
1858
2005
|
```
|
|
1859
2006
|
|
|
1860
|
-
_See code: [src/commands/workspace/create.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
2007
|
+
_See code: [src/commands/workspace/create.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/workspace/create.ts)_
|
|
1861
2008
|
|
|
1862
2009
|
## `qfg workspace switch [SLUG]`
|
|
1863
2010
|
|
|
@@ -1885,7 +2032,7 @@ EXAMPLES
|
|
|
1885
2032
|
$ qfg workspace switch acme/production
|
|
1886
2033
|
```
|
|
1887
2034
|
|
|
1888
|
-
_See code: [src/commands/workspace/switch.ts](https://github.com/quonfig/cli/blob/v0.0.
|
|
2035
|
+
_See code: [src/commands/workspace/switch.ts](https://github.com/quonfig/cli/blob/v0.0.41/src/commands/workspace/switch.ts)_
|
|
1889
2036
|
<!-- commandsstop -->
|
|
1890
2037
|
|
|
1891
2038
|
## Local Development
|
package/dist/commands/login.js
CHANGED
|
@@ -35,7 +35,7 @@ export default class Login extends BaseCommand {
|
|
|
35
35
|
const onEnter = (chunk) => {
|
|
36
36
|
if (browserOpened)
|
|
37
37
|
return;
|
|
38
|
-
if (
|
|
38
|
+
if (!/[\n\r]/.test(chunk.toString()))
|
|
39
39
|
return;
|
|
40
40
|
browserOpened = true;
|
|
41
41
|
openBrowser(deviceAuth.verification_uri_complete);
|
|
@@ -5,17 +5,14 @@ import { BaseCommand } from '../../index.js';
|
|
|
5
5
|
const SKILL_NAME = 'qfg-migrate-code';
|
|
6
6
|
const SUPPORTED_SOURCES = new Set(['launch']);
|
|
7
7
|
function findIdentifierMap(startDir) {
|
|
8
|
-
let dir = path.resolve(startDir)
|
|
9
|
-
while (true) {
|
|
8
|
+
for (let dir = path.resolve(startDir);; dir = path.dirname(dir)) {
|
|
10
9
|
const candidate = path.join(dir, '.qf', 'identifier-map.json');
|
|
11
10
|
if (fs.existsSync(candidate)) {
|
|
12
11
|
const raw = fs.readFileSync(candidate, 'utf8');
|
|
13
12
|
return { dir, map: JSON.parse(raw) };
|
|
14
13
|
}
|
|
15
|
-
|
|
16
|
-
if (parent === dir)
|
|
14
|
+
if (path.dirname(dir) === dir)
|
|
17
15
|
return null;
|
|
18
|
-
dir = parent;
|
|
19
16
|
}
|
|
20
17
|
}
|
|
21
18
|
export default class MigrateMyCode extends BaseCommand {
|
package/dist/commands/pull.d.ts
CHANGED
|
@@ -9,17 +9,6 @@ export default class Pull extends BaseCommand {
|
|
|
9
9
|
workspace: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
10
|
};
|
|
11
11
|
run(): Promise<JsonObj | void>;
|
|
12
|
-
/**
|
|
13
|
-
* Wraps `readWorkspaceSlug` so a legacy bare-slug value (`"workspace":
|
|
14
|
-
* "foo"` instead of `"workspace": "org/foo"`) reads as `undefined`
|
|
15
|
-
* rather than throwing. The caller then takes the "no pin set" branch
|
|
16
|
-
* and overwrites with the canonical form, completing the migration.
|
|
17
|
-
*
|
|
18
|
-
* Any other parse error still resolves to `undefined` here (and is
|
|
19
|
-
* verbose-logged) — backfill is non-fatal; the next push surfaces the
|
|
20
|
-
* real diagnosis.
|
|
21
|
-
*/
|
|
22
|
-
private readPinTolerant;
|
|
23
12
|
/**
|
|
24
13
|
* Local-only backfill of the `workspace` pin in `quonfig.json`.
|
|
25
14
|
*
|
|
@@ -46,6 +35,17 @@ export default class Pull extends BaseCommand {
|
|
|
46
35
|
private commitPinIfRepo;
|
|
47
36
|
private looksLike401;
|
|
48
37
|
private maybeWriteQuonfigDir;
|
|
38
|
+
/**
|
|
39
|
+
* Wraps `readWorkspaceSlug` so a legacy bare-slug value (`"workspace":
|
|
40
|
+
* "foo"` instead of `"workspace": "org/foo"`) reads as `undefined`
|
|
41
|
+
* rather than throwing. The caller then takes the "no pin set" branch
|
|
42
|
+
* and overwrites with the canonical form, completing the migration.
|
|
43
|
+
*
|
|
44
|
+
* Any other parse error still resolves to `undefined` here (and is
|
|
45
|
+
* verbose-logged) — backfill is non-fatal; the next push surfaces the
|
|
46
|
+
* real diagnosis.
|
|
47
|
+
*/
|
|
48
|
+
private readPinTolerant;
|
|
49
49
|
private refreshAndGetUrl;
|
|
50
50
|
private resolveTokenEntry;
|
|
51
51
|
}
|
package/dist/commands/pull.js
CHANGED
|
@@ -174,25 +174,6 @@ CLI shortcuts (no JSON editing needed for simple cases):
|
|
|
174
174
|
await this.backfillWorkspacePin(resolvedDir, tokenEntry, workspaceId, orgSlug);
|
|
175
175
|
return { dir: resolvedDir, workspaceId };
|
|
176
176
|
}
|
|
177
|
-
/**
|
|
178
|
-
* Wraps `readWorkspaceSlug` so a legacy bare-slug value (`"workspace":
|
|
179
|
-
* "foo"` instead of `"workspace": "org/foo"`) reads as `undefined`
|
|
180
|
-
* rather than throwing. The caller then takes the "no pin set" branch
|
|
181
|
-
* and overwrites with the canonical form, completing the migration.
|
|
182
|
-
*
|
|
183
|
-
* Any other parse error still resolves to `undefined` here (and is
|
|
184
|
-
* verbose-logged) — backfill is non-fatal; the next push surfaces the
|
|
185
|
-
* real diagnosis.
|
|
186
|
-
*/
|
|
187
|
-
async readPinTolerant(dir) {
|
|
188
|
-
try {
|
|
189
|
-
return await readWorkspaceSlug(dir);
|
|
190
|
-
}
|
|
191
|
-
catch (error) {
|
|
192
|
-
this.verboseLog('Pull', `quonfig.json workspace pin needs migration: ${String(error)}`);
|
|
193
|
-
return undefined;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
177
|
/**
|
|
197
178
|
* Local-only backfill of the `workspace` pin in `quonfig.json`.
|
|
198
179
|
*
|
|
@@ -304,6 +285,26 @@ CLI shortcuts (no JSON editing needed for simple cases):
|
|
|
304
285
|
// Non-fatal
|
|
305
286
|
}
|
|
306
287
|
}
|
|
288
|
+
/**
|
|
289
|
+
* Wraps `readWorkspaceSlug` so a legacy bare-slug value (`"workspace":
|
|
290
|
+
* "foo"` instead of `"workspace": "org/foo"`) reads as `undefined`
|
|
291
|
+
* rather than throwing. The caller then takes the "no pin set" branch
|
|
292
|
+
* and overwrites with the canonical form, completing the migration.
|
|
293
|
+
*
|
|
294
|
+
* Any other parse error still resolves to `undefined` here (and is
|
|
295
|
+
* verbose-logged) — backfill is non-fatal; the next push surfaces the
|
|
296
|
+
* real diagnosis.
|
|
297
|
+
*/
|
|
298
|
+
async readPinTolerant(dir) {
|
|
299
|
+
let pin;
|
|
300
|
+
try {
|
|
301
|
+
pin = await readWorkspaceSlug(dir);
|
|
302
|
+
}
|
|
303
|
+
catch (error) {
|
|
304
|
+
this.verboseLog('Pull', `quonfig.json workspace pin needs migration: ${String(error)}`);
|
|
305
|
+
}
|
|
306
|
+
return pin;
|
|
307
|
+
}
|
|
307
308
|
async refreshAndGetUrl(workspaceId, orgSlug) {
|
|
308
309
|
const data = await mintGiteaToken(workspaceId, orgSlug, 'read', 'pull');
|
|
309
310
|
const entry = {
|
package/dist/commands/push.js
CHANGED
|
@@ -3,7 +3,7 @@ import * as path from 'node:path';
|
|
|
3
3
|
import { Flags } from '@oclif/core';
|
|
4
4
|
import { BaseCommand } from '../index.js';
|
|
5
5
|
import { mintGiteaToken } from '../util/gitea-api.js';
|
|
6
|
-
import { dirtyTrackedFiles, getOriginMainSha, getRemoteUrl, gitFetch, gitSetRemote, isGitRepo, isLocalBehindOrDivergedFromRemote, runGit } from '../util/git-ops.js';
|
|
6
|
+
import { dirtyTrackedFiles, getOriginMainSha, getRemoteUrl, gitFetch, gitSetRemote, isGitRepo, isLocalBehindOrDivergedFromRemote, runGit, } from '../util/git-ops.js';
|
|
7
7
|
import { PushFatalError, runPush, } from '../push/run-push.js';
|
|
8
8
|
import { computeBarePathDiff } from '../push/bare-path-diff.js';
|
|
9
9
|
import { callConfigsPush } from '../push/config-push-client.js';
|
|
@@ -230,7 +230,7 @@ export function buildRealDeps(cmd, orgSlug) {
|
|
|
230
230
|
// fetch. Bare path has no `.git/` to rev-parse — return undefined
|
|
231
231
|
// and let the server apply its bare-path lock policy.
|
|
232
232
|
if (!(await isGitRepo(dir)))
|
|
233
|
-
return
|
|
233
|
+
return;
|
|
234
234
|
return getOriginMainSha(dir);
|
|
235
235
|
},
|
|
236
236
|
};
|