@quonfig/cli 0.0.18 → 0.0.20

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.
@@ -20,6 +20,7 @@
20
20
  * - Weighted values non-empty and consistent
21
21
  */
22
22
  import { z } from 'zod';
23
+ import { LOG_LEVELS } from '../util/log-levels.js';
23
24
  // ── Schemas (subset of app-quonfig config-schemas.ts) ───────────────────
24
25
  const ConfigTypeSchema = z.enum(['feature_flag', 'config', 'log_level', 'segment', 'schema']);
25
26
  const ValueTypeSchema = z.enum(['bool', 'string', 'int', 'double', 'json', 'string_list', 'duration', 'log_level']);
@@ -47,7 +48,7 @@ const OperatorSchema = z.enum([
47
48
  'LOOKUP_KEY_IN',
48
49
  'LOOKUP_KEY_NOT_IN',
49
50
  ]);
50
- const LogLevelSchema = z.enum(['TRACE', 'DEBUG', 'INFO', 'WARN', 'ERROR', 'FATAL']);
51
+ const LogLevelSchema = z.enum(LOG_LEVELS);
51
52
  const BoolValueSchema = z.object({ type: z.literal('bool'), value: z.boolean() });
52
53
  const StringValueSchema = z.object({ type: z.literal('string'), value: z.string() });
53
54
  const IntValueSchema = z.object({ type: z.literal('int'), value: z.union([z.number(), z.string()]) });
@@ -69,7 +69,7 @@
69
69
  "required": true
70
70
  }
71
71
  },
72
- "description": "Create a new feature flag, config value, or other item.\n\nUse --type to specify the kind of item:\n boolean-flag On/off feature flag (sendToClientSdk defaults to true; best for gradual rollouts)\n string A string configuration value\n int An integer configuration value\n double A floating-point configuration value\n string-list A comma-separated list of strings\n json An arbitrary JSON blob\n boolean A plain boolean (not a feature flag)\n\nThis sets the global default value. Override per-environment with:\n qfg set-default my.flag --environment production --value true\n\nFor a percentage rollout (gradual rollout / A/B test / canary deploy), use:\n qfg set-rollout my.flag --environment production --true-percent 20\n\nOr edit the JSON config file directly for complex targeting rules:\n qfg config-schema # full operator reference + examples\n qfg pull --dir ./config # clone workspace, then edit JSON and git push",
72
+ "description": "Create a new feature flag, config value, or other item.\n\nUse --type to specify the kind of item:\n boolean-flag On/off feature flag (sendToClientSdk defaults to true; best for gradual rollouts)\n string A string configuration value\n int An integer configuration value\n double A floating-point configuration value\n string-list A comma-separated list of strings\n json An arbitrary JSON blob\n boolean A plain boolean (not a feature flag)\n log_level A dynamic log level (value must be one of TRACE/DEBUG/INFO/WARN/ERROR/FATAL)\n\nThis sets the global default value. Override per-environment with:\n qfg set-default my.flag --environment production --value true\n\nFor a percentage rollout (gradual rollout / A/B test / canary deploy), use:\n qfg set-rollout my.flag --environment production --true-percent 20\n\nOr edit the JSON config file directly for complex targeting rules:\n qfg config-schema # full operator reference + examples\n qfg pull --dir ./config # clone workspace, then edit JSON and git push\n\nLog levels:\n qfg create log-level.my-app --type log_level --value WARN\n # Log-level keys must start with \"log-level.\".\n # For per-logger targeting, create ONE log-level config per service and add\n # rules on the \"quonfig-sdk-logging.key\" context property (e.g.\n # PROP_STARTS_WITH_ONE_OF MyPackage.) rather than one config per logger.",
73
73
  "examples": [
74
74
  "<%= config.bin %> <%= command.id %> my.new.flag --type boolean-flag",
75
75
  "<%= config.bin %> <%= command.id %> my.new.flag --type boolean-flag --value=true",
@@ -77,6 +77,7 @@
77
77
  "<%= config.bin %> <%= command.id %> my.new.string --type string --value=\"hello world\" --secret",
78
78
  "<%= config.bin %> <%= command.id %> my.new.string --type string --env-var=MY_ENV_VAR_NAME",
79
79
  "<%= config.bin %> <%= command.id %> my.new.string --type json --value=\"{\\\"key\\\": \\\"value\\\"}\"",
80
+ "<%= config.bin %> <%= command.id %> log-level.my-app --type log_level --value WARN",
80
81
  "# After creating a flag, set a 20% rollout in production:",
81
82
  "<%= config.bin %> set-rollout my.new.flag --environment production --true-percent 20"
82
83
  ],
@@ -156,7 +157,8 @@
156
157
  "double",
157
158
  "int",
158
159
  "string-list",
159
- "json"
160
+ "json",
161
+ "log_level"
160
162
  ],
161
163
  "type": "option"
162
164
  },
@@ -752,6 +754,119 @@
752
754
  "list.js"
753
755
  ]
754
756
  },
757
+ "log-level": {
758
+ "aliases": [],
759
+ "args": {
760
+ "name": {
761
+ "description": "log-level key (must start with \"log-level.\", e.g. log-level.my-app)",
762
+ "name": "name",
763
+ "required": true
764
+ }
765
+ },
766
+ "description": "Create or add targeting rules to a log-level config.\n\nLog-level keys must start with \"log-level.\" (e.g. log-level.my-app). The\ndefault value applies to every logger in that service unless a targeting\nrule matches first.\n\nTwo modes:\n\n 1. Create a new log-level config with a default value:\n qfg log-level log-level.my-app --value=WARN\n\n 2. Add a per-logger targeting rule to an existing config. SDKs populate\n the \"quonfig-sdk-logging.key\" context automatically from the logger path,\n so this rule fires for any logger whose name starts with --target:\n qfg log-level log-level.my-app --target=MyPackage.Noisy --value=ERROR\n\n Pass --target multiple times to match any of several prefixes (OR).\n Pass --environment=<env> to scope the rule to a single environment.\n\nTo update the catch-all default for an existing log level, use set-default:\n qfg set-default log-level.my-app --value=DEBUG --environment=production\n\nFor more complex rules (regex, multi-criterion, exact match) edit the JSON:\n qfg pull && $EDITOR log-levels/log-level.my-app.json\n qfg config-schema # full operator reference",
767
+ "examples": [
768
+ "<%= config.bin %> <%= command.id %> log-level.my-app --value=WARN",
769
+ "<%= config.bin %> <%= command.id %> log-level.my-app --target=MyPackage.Noisy --value=ERROR",
770
+ "<%= config.bin %> <%= command.id %> log-level.my-app --target=A --target=B --value=DEBUG",
771
+ "<%= config.bin %> <%= command.id %> log-level.my-app --target=Chatty --value=INFO --environment=production"
772
+ ],
773
+ "flags": {
774
+ "json": {
775
+ "description": "Format output as json.",
776
+ "helpGroup": "GLOBAL",
777
+ "name": "json",
778
+ "allowNo": false,
779
+ "type": "boolean"
780
+ },
781
+ "interactive": {
782
+ "description": "Force interactive mode",
783
+ "helpGroup": "GLOBAL",
784
+ "name": "interactive",
785
+ "allowNo": true,
786
+ "type": "boolean"
787
+ },
788
+ "no-color": {
789
+ "description": "Do not colorize output",
790
+ "env": "NO_COLOR",
791
+ "helpGroup": "GLOBAL",
792
+ "name": "no-color",
793
+ "allowNo": false,
794
+ "type": "boolean"
795
+ },
796
+ "verbose": {
797
+ "description": "Verbose output",
798
+ "helpGroup": "GLOBAL",
799
+ "name": "verbose",
800
+ "allowNo": false,
801
+ "type": "boolean"
802
+ },
803
+ "workspace": {
804
+ "char": "w",
805
+ "description": "Workspace slug to use (overrides QUONFIG_WORKSPACE env var and saved default)",
806
+ "helpGroup": "GLOBAL",
807
+ "name": "workspace",
808
+ "required": false,
809
+ "hasDynamicHelp": false,
810
+ "multiple": false,
811
+ "type": "option"
812
+ },
813
+ "profile": {
814
+ "char": "p",
815
+ "description": "Deprecated: use --workspace instead",
816
+ "helpGroup": "GLOBAL",
817
+ "hidden": true,
818
+ "name": "profile",
819
+ "required": false,
820
+ "hasDynamicHelp": false,
821
+ "multiple": false,
822
+ "type": "option"
823
+ },
824
+ "environment": {
825
+ "description": "when used with --target, scope the rule to this environment instead of the default",
826
+ "name": "environment",
827
+ "hasDynamicHelp": false,
828
+ "multiple": false,
829
+ "type": "option"
830
+ },
831
+ "target": {
832
+ "description": "logger path prefix (matched via PROP_STARTS_WITH_ONE_OF on \"quonfig-sdk-logging.key\"); repeatable",
833
+ "name": "target",
834
+ "hasDynamicHelp": false,
835
+ "multiple": true,
836
+ "type": "option"
837
+ },
838
+ "value": {
839
+ "description": "log level — either the new default (create mode) or the level for the targeted loggers",
840
+ "name": "value",
841
+ "required": false,
842
+ "hasDynamicHelp": false,
843
+ "multiple": false,
844
+ "options": [
845
+ "TRACE",
846
+ "DEBUG",
847
+ "INFO",
848
+ "WARN",
849
+ "ERROR",
850
+ "FATAL"
851
+ ],
852
+ "type": "option"
853
+ }
854
+ },
855
+ "hasDynamicHelp": false,
856
+ "hiddenAliases": [],
857
+ "id": "log-level",
858
+ "pluginAlias": "@quonfig/cli",
859
+ "pluginName": "@quonfig/cli",
860
+ "pluginType": "core",
861
+ "strict": true,
862
+ "enableJsonFlag": true,
863
+ "isESM": true,
864
+ "relativePath": [
865
+ "dist",
866
+ "commands",
867
+ "log-level.js"
868
+ ]
869
+ },
755
870
  "login": {
756
871
  "aliases": [],
757
872
  "args": {},
@@ -2627,6 +2742,84 @@
2627
2742
  "bootstrap.js"
2628
2743
  ]
2629
2744
  },
2745
+ "workspace:create": {
2746
+ "aliases": [],
2747
+ "args": {
2748
+ "slug": {
2749
+ "description": "Workspace slug (lowercase letters, numbers, hyphens)",
2750
+ "name": "slug",
2751
+ "required": true
2752
+ }
2753
+ },
2754
+ "description": "Create a new workspace. Provisions the Gitea repo and default environments, identical to the app's New Workspace UI.",
2755
+ "examples": [
2756
+ "<%= config.bin %> <%= command.id %> my-team",
2757
+ "<%= config.bin %> <%= command.id %> lt-21-smoke --name \"Load Test 21\"",
2758
+ "<%= config.bin %> <%= command.id %> my-team --org 11111111-1111-1111-1111-111111111111"
2759
+ ],
2760
+ "flags": {
2761
+ "json": {
2762
+ "description": "Format output as json.",
2763
+ "helpGroup": "GLOBAL",
2764
+ "name": "json",
2765
+ "allowNo": false,
2766
+ "type": "boolean"
2767
+ },
2768
+ "interactive": {
2769
+ "description": "Force interactive mode",
2770
+ "helpGroup": "GLOBAL",
2771
+ "name": "interactive",
2772
+ "allowNo": true,
2773
+ "type": "boolean"
2774
+ },
2775
+ "no-color": {
2776
+ "description": "Do not colorize output",
2777
+ "env": "NO_COLOR",
2778
+ "helpGroup": "GLOBAL",
2779
+ "name": "no-color",
2780
+ "allowNo": false,
2781
+ "type": "boolean"
2782
+ },
2783
+ "verbose": {
2784
+ "description": "Verbose output",
2785
+ "helpGroup": "GLOBAL",
2786
+ "name": "verbose",
2787
+ "allowNo": false,
2788
+ "type": "boolean"
2789
+ },
2790
+ "name": {
2791
+ "description": "Human-readable display name (defaults to the slug)",
2792
+ "name": "name",
2793
+ "required": false,
2794
+ "hasDynamicHelp": false,
2795
+ "multiple": false,
2796
+ "type": "option"
2797
+ },
2798
+ "org": {
2799
+ "description": "Organization UUID or slug. Required when you belong to more than one organization; inferred otherwise.",
2800
+ "name": "org",
2801
+ "required": false,
2802
+ "hasDynamicHelp": false,
2803
+ "multiple": false,
2804
+ "type": "option"
2805
+ }
2806
+ },
2807
+ "hasDynamicHelp": false,
2808
+ "hiddenAliases": [],
2809
+ "id": "workspace:create",
2810
+ "pluginAlias": "@quonfig/cli",
2811
+ "pluginName": "@quonfig/cli",
2812
+ "pluginType": "core",
2813
+ "strict": true,
2814
+ "enableJsonFlag": true,
2815
+ "isESM": true,
2816
+ "relativePath": [
2817
+ "dist",
2818
+ "commands",
2819
+ "workspace",
2820
+ "create.js"
2821
+ ]
2822
+ },
2630
2823
  "workspace:switch": {
2631
2824
  "aliases": [],
2632
2825
  "args": {
@@ -2689,5 +2882,5 @@
2689
2882
  ]
2690
2883
  }
2691
2884
  },
2692
- "version": "0.0.18"
2885
+ "version": "0.0.20"
2693
2886
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "packageManager": "yarn@4.11.0+sha512.4e54aeace9141df2f0177c266b05ec50dc044638157dae128c471ba65994ac802122d7ab35bcd9e81641228b7dcf24867d28e750e0bcae8a05277d600008ad54",
3
3
  "name": "@quonfig/cli",
4
- "version": "0.0.18",
4
+ "version": "0.0.20",
5
5
  "bugs": {
6
6
  "url": "https://github.com/quonfig/cli/issues"
7
7
  },