@camunda8/cli 2.8.0-alpha.7 → 2.8.0-alpha.9

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.
@@ -51,9 +51,47 @@ export interface CommandDef {
51
51
  requiresResource: boolean;
52
52
  /** Valid resource names (canonical short forms used in help). */
53
53
  resources: string[];
54
- /** Flags specific to this verb (beyond global flags). Superset of all resource-specific flags. */
54
+ /**
55
+ * Verb-level flag schema. Per-resource flags must live exclusively in
56
+ * `resourceFlags` — they are *not* duplicated here. Mixing a flag into
57
+ * both buckets defeats unknown-flag detection (#256), and the
58
+ * structural disjointness invariant in
59
+ * `tests/unit/command-registry.test.ts` will fail.
60
+ *
61
+ * **Effective-resolution semantics** (see `ResolvedFlags` in
62
+ * `src/command-framework.ts` and `validateFlags` in `src/index.ts`):
63
+ * the handler's typed `flags` parameter and `validateFlags`'s
64
+ * required-field/validator checks resolve to
65
+ * `resourceFlags[resource] ?? flags`. So for a verb that declares
66
+ * **both** `flags` and `resourceFlags[r]`, the verb-level `flags` are
67
+ * **not** seen by the handler or by `validateFlags` when dispatching to
68
+ * resource `r` — only `resourceFlags[r]` is. Verb-level `flags` are
69
+ * still treated as valid by `detectUnknownFlags`, so
70
+ * `detectUnknownFlags`/`warnUnknownFlags` will not emit an
71
+ * unknown-flag warning for them, and `deriveParseArgsOptions` still
72
+ * includes them so they parse, but they will not flow into the
73
+ * handler's typed parameter for any resource that has its own bucket.
74
+ *
75
+ * Practical guidance: if a flag must be visible to the handler for a
76
+ * given resource, declare it in that resource's `resourceFlags` bucket
77
+ * (typically by spreading a shared constant such as `SEARCH_FLAGS`
78
+ * into each per-resource bucket). Reserve verb-level `flags` for verbs
79
+ * with no `resourceFlags` at all, or for flags that are deliberately
80
+ * parse-only on resources with their own bucket.
81
+ */
55
82
  flags: Record<string, FlagDef>;
56
- /** Per-resource flag scoping. Keys are canonical resource names. */
83
+ /**
84
+ * Per-resource flag scoping. Keys are canonical resource names.
85
+ * Flags declared here must not also appear in `flags` (see above).
86
+ *
87
+ * When a resource has an entry here, the framework resolves the
88
+ * effective flag schema as `resourceFlags[resource]` and **ignores**
89
+ * the verb-level `flags` for handler typing and `validateFlags`.
90
+ * `deriveParseArgsOptions` still includes both buckets so they parse,
91
+ * and the scoping lets `warnUnknownFlags` warn when a flag is passed
92
+ * against a resource that does not declare it. See the doc on `flags`
93
+ * above for the full effective-resolution semantics.
94
+ */
57
95
  resourceFlags?: Record<string, Record<string, FlagDef>>;
58
96
  /** Per-resource positional argument schemas. Keys are canonical resource names. */
59
97
  resourcePositionals?: Record<string, readonly PositionalDef[]>;
@@ -127,6 +165,12 @@ export declare const GLOBAL_FLAGS: {
127
165
  readonly agentDescription: "Comma-separated list of output fields to include.\nReduces context window size when parsing output.\nExample: c8ctl list pi --fields Key,State,processDefinitionId\nCase-insensitive.";
128
166
  readonly agentAppliesTo: "all list/search/get commands";
129
167
  };
168
+ readonly json: {
169
+ readonly type: "boolean";
170
+ readonly description: "Force JSON output for this invocation (does not persist; overrides session state and C8CTL_OUTPUT_MODE)";
171
+ readonly agentDescription: "Per-invocation JSON output. Equivalent to setting outputMode=json for one command without mutating session.json.\nPrecedence: --json > C8CTL_OUTPUT_MODE > persisted session state.";
172
+ readonly agentAppliesTo: "all commands";
173
+ };
130
174
  };
131
175
  /**
132
176
  * Flags shared across all search/list commands.
@@ -182,136 +226,6 @@ export declare const COMMAND_REGISTRY: {
182
226
  }[];
183
227
  resources: string[];
184
228
  flags: {
185
- mappingRuleId: {
186
- readonly type: "string";
187
- readonly description: "Filter by mapping rule ID";
188
- };
189
- name: {
190
- readonly type: "string";
191
- readonly description: "Filter by name";
192
- };
193
- claimName: {
194
- readonly type: "string";
195
- readonly description: "Filter by claim name";
196
- };
197
- claimValue: {
198
- readonly type: "string";
199
- readonly description: "Filter by claim value";
200
- };
201
- ownerId: {
202
- readonly type: "string";
203
- readonly description: "Filter by owner ID";
204
- };
205
- ownerType: {
206
- readonly type: "string";
207
- readonly description: "Filter by owner type";
208
- };
209
- resourceType: {
210
- readonly type: "string";
211
- readonly description: "Filter by resource type";
212
- };
213
- resourceId: {
214
- readonly type: "string";
215
- readonly description: "Filter by resource ID";
216
- };
217
- tenantId: {
218
- readonly type: "string";
219
- readonly description: "Filter by tenant ID";
220
- readonly validate: typeof TenantId.assumeExists;
221
- };
222
- groupId: {
223
- readonly type: "string";
224
- readonly description: "Filter by group ID";
225
- };
226
- roleId: {
227
- readonly type: "string";
228
- readonly description: "Filter by role ID";
229
- };
230
- username: {
231
- readonly type: "string";
232
- readonly description: "Filter by username";
233
- readonly validate: typeof Username.assumeExists;
234
- };
235
- email: {
236
- readonly type: "string";
237
- readonly description: "Filter by email";
238
- };
239
- state: {
240
- readonly type: "string";
241
- readonly description: "Filter by state";
242
- };
243
- type: {
244
- readonly type: "string";
245
- readonly description: "Filter by job type";
246
- };
247
- processInstanceKey: {
248
- readonly type: "string";
249
- readonly description: "Filter by process instance key";
250
- readonly validate: typeof ProcessInstanceKey.assumeExists;
251
- };
252
- processDefinitionKey: {
253
- readonly type: "string";
254
- readonly description: "Filter by process definition key";
255
- readonly validate: typeof ProcessDefinitionKey.assumeExists;
256
- };
257
- itype: {
258
- readonly type: "string";
259
- readonly description: "Case-insensitive filter by job type";
260
- };
261
- bpmnProcessId: {
262
- readonly type: "string";
263
- readonly description: "Filter by BPMN process ID";
264
- };
265
- id: {
266
- readonly type: "string";
267
- readonly description: "Filter by BPMN process ID (alias)";
268
- };
269
- processDefinitionId: {
270
- readonly type: "string";
271
- readonly description: "Filter by process definition ID";
272
- readonly validate: typeof ProcessDefinitionId.assumeExists;
273
- };
274
- errorType: {
275
- readonly type: "string";
276
- readonly description: "Filter by error type";
277
- };
278
- errorMessage: {
279
- readonly type: "string";
280
- readonly description: "Filter by error message";
281
- };
282
- ierrorMessage: {
283
- readonly type: "string";
284
- readonly description: "Case-insensitive filter by error message";
285
- };
286
- iid: {
287
- readonly type: "string";
288
- readonly description: "Case-insensitive filter by BPMN process ID";
289
- };
290
- assignee: {
291
- readonly type: "string";
292
- readonly description: "Filter by assignee";
293
- };
294
- elementId: {
295
- readonly type: "string";
296
- readonly description: "Filter by element ID";
297
- };
298
- iassignee: {
299
- readonly type: "string";
300
- readonly description: "Case-insensitive filter by assignee";
301
- };
302
- key: {
303
- readonly type: "string";
304
- readonly description: "Filter by key";
305
- };
306
- iname: {
307
- readonly type: "string";
308
- readonly description: "Case-insensitive filter by name";
309
- };
310
- parentProcessInstanceKey: {
311
- readonly type: "string";
312
- readonly description: "Filter by parent process instance key";
313
- readonly validate: typeof ProcessInstanceKey.assumeExists;
314
- };
315
229
  sortBy: {
316
230
  readonly type: "string";
317
231
  readonly description: "Sort results by field";
@@ -604,152 +518,6 @@ export declare const COMMAND_REGISTRY: {
604
518
  }[];
605
519
  resources: string[];
606
520
  flags: {
607
- mappingRuleId: {
608
- readonly type: "string";
609
- readonly description: "Filter by mapping rule ID";
610
- };
611
- name: {
612
- readonly type: "string";
613
- readonly description: "Filter by name";
614
- };
615
- claimName: {
616
- readonly type: "string";
617
- readonly description: "Filter by claim name";
618
- };
619
- claimValue: {
620
- readonly type: "string";
621
- readonly description: "Filter by claim value";
622
- };
623
- ownerId: {
624
- readonly type: "string";
625
- readonly description: "Filter by owner ID";
626
- };
627
- ownerType: {
628
- readonly type: "string";
629
- readonly description: "Filter by owner type";
630
- };
631
- resourceType: {
632
- readonly type: "string";
633
- readonly description: "Filter by resource type";
634
- };
635
- resourceId: {
636
- readonly type: "string";
637
- readonly description: "Filter by resource ID";
638
- };
639
- tenantId: {
640
- readonly type: "string";
641
- readonly description: "Filter by tenant ID";
642
- readonly validate: typeof TenantId.assumeExists;
643
- };
644
- groupId: {
645
- readonly type: "string";
646
- readonly description: "Filter by group ID";
647
- };
648
- roleId: {
649
- readonly type: "string";
650
- readonly description: "Filter by role ID";
651
- };
652
- username: {
653
- readonly type: "string";
654
- readonly description: "Filter by username";
655
- readonly validate: typeof Username.assumeExists;
656
- };
657
- email: {
658
- readonly type: "string";
659
- readonly description: "Filter by email";
660
- };
661
- value: {
662
- readonly type: "string";
663
- readonly description: "Filter by value";
664
- };
665
- processInstanceKey: {
666
- readonly type: "string";
667
- readonly description: "Filter by process instance key";
668
- readonly validate: typeof ProcessInstanceKey.assumeExists;
669
- };
670
- scopeKey: {
671
- readonly type: "string";
672
- readonly description: "Filter by scope key";
673
- };
674
- fullValue: {
675
- readonly type: "boolean";
676
- readonly description: "Return full variable values (not truncated)";
677
- };
678
- iname: {
679
- readonly type: "string";
680
- readonly description: "Case-insensitive filter by name";
681
- };
682
- ivalue: {
683
- readonly type: "string";
684
- readonly description: "Case-insensitive filter by value";
685
- };
686
- state: {
687
- readonly type: "string";
688
- readonly description: "Filter by state";
689
- };
690
- type: {
691
- readonly type: "string";
692
- readonly description: "Filter by job type";
693
- };
694
- processDefinitionKey: {
695
- readonly type: "string";
696
- readonly description: "Filter by process definition key";
697
- readonly validate: typeof ProcessDefinitionKey.assumeExists;
698
- };
699
- itype: {
700
- readonly type: "string";
701
- readonly description: "Case-insensitive filter by job type";
702
- };
703
- bpmnProcessId: {
704
- readonly type: "string";
705
- readonly description: "Filter by BPMN process ID";
706
- };
707
- id: {
708
- readonly type: "string";
709
- readonly description: "Filter by BPMN process ID (alias)";
710
- };
711
- processDefinitionId: {
712
- readonly type: "string";
713
- readonly description: "Filter by process definition ID";
714
- readonly validate: typeof ProcessDefinitionId.assumeExists;
715
- };
716
- errorType: {
717
- readonly type: "string";
718
- readonly description: "Filter by error type";
719
- };
720
- errorMessage: {
721
- readonly type: "string";
722
- readonly description: "Filter by error message";
723
- };
724
- ierrorMessage: {
725
- readonly type: "string";
726
- readonly description: "Case-insensitive filter by error message";
727
- };
728
- iid: {
729
- readonly type: "string";
730
- readonly description: "Case-insensitive filter by BPMN process ID";
731
- };
732
- assignee: {
733
- readonly type: "string";
734
- readonly description: "Filter by assignee";
735
- };
736
- elementId: {
737
- readonly type: "string";
738
- readonly description: "Filter by element ID";
739
- };
740
- iassignee: {
741
- readonly type: "string";
742
- readonly description: "Case-insensitive filter by assignee";
743
- };
744
- key: {
745
- readonly type: "string";
746
- readonly description: "Filter by key";
747
- };
748
- parentProcessInstanceKey: {
749
- readonly type: "string";
750
- readonly description: "Filter by parent process instance key";
751
- readonly validate: typeof ProcessInstanceKey.assumeExists;
752
- };
753
521
  sortBy: {
754
522
  readonly type: "string";
755
523
  readonly description: "Sort results by field";
@@ -1068,32 +836,7 @@ export declare const COMMAND_REGISTRY: {
1068
836
  description: string;
1069
837
  }[];
1070
838
  resources: string[];
1071
- flags: {
1072
- variables: {
1073
- readonly type: "boolean";
1074
- readonly description: "Include variables in output";
1075
- };
1076
- userTask: {
1077
- readonly type: "boolean";
1078
- readonly description: "Get form for user task";
1079
- };
1080
- ut: {
1081
- readonly type: "boolean";
1082
- readonly description: "Alias for --userTask";
1083
- };
1084
- processDefinition: {
1085
- readonly type: "boolean";
1086
- readonly description: "Get form for process definition";
1087
- };
1088
- pd: {
1089
- readonly type: "boolean";
1090
- readonly description: "Alias for --processDefinition";
1091
- };
1092
- xml: {
1093
- readonly type: "boolean";
1094
- readonly description: "Get BPMN XML (process definitions)";
1095
- };
1096
- };
839
+ flags: {};
1097
840
  resourceFlags: {
1098
841
  "process-definition": {
1099
842
  readonly xml: {
@@ -2012,12 +1755,7 @@ export declare const COMMAND_REGISTRY: {
2012
1755
  description: string;
2013
1756
  }[];
2014
1757
  resources: string[];
2015
- flags: {
2016
- shell: {
2017
- type: "string";
2018
- description: string;
2019
- };
2020
- };
1758
+ flags: {};
2021
1759
  resourceFlags: {
2022
1760
  install: {
2023
1761
  shell: {
@@ -2106,7 +1844,7 @@ export declare function isValidCommand(verb: string, resource: string): boolean;
2106
1844
  * "string" wins because parseArgs with `type: "string"` can accept any
2107
1845
  * value, whereas `type: "boolean"` would discard the string payload.
2108
1846
  */
2109
- export declare function deriveParseArgsOptions(): Record<string, {
1847
+ export declare function deriveParseArgsOptions(pluginFlags?: Record<string, Record<string, FlagDef>>): Record<string, {
2110
1848
  type: "string" | "boolean";
2111
1849
  short?: string;
2112
1850
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"command-registry.d.ts","sourceRoot":"","sources":["../src/command-registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACN,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EACX,MAAM,EACN,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,MAAM,qCAAqC,CAAC;AAI7C,MAAM,WAAW,OAAO;IACvB,8EAA8E;IAC9E,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC3B,+DAA+D;IAC/D,WAAW,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wEAAwE;IACxE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,wFAAwF;IACxF,GAAG,CAAC,EAAE,OAAO,CAAC;IACd;;;;;;OAMG;IAEH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,GAAG,CAAC;IAClC,wGAAwG;IACxG,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,8FAA8F;IAC9F,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,GAAG,CAAC;CAClC;AAED,MAAM,WAAW,UAAU;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,4EAA4E;IAC5E,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iEAAiE;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;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC/B,IAAI,EAAE,MAAM,GACV,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAUrC;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAWtE;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACrC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACnD,MAAM,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CA+ChE"}
@@ -62,6 +62,12 @@ export const GLOBAL_FLAGS = {
62
62
  agentDescription: "Comma-separated list of output fields to include.\nReduces context window size when parsing output.\nExample: c8ctl list pi --fields Key,State,processDefinitionId\nCase-insensitive.",
63
63
  agentAppliesTo: "all list/search/get commands",
64
64
  },
65
+ json: {
66
+ type: "boolean",
67
+ description: "Force JSON output for this invocation (does not persist; overrides session state and C8CTL_OUTPUT_MODE)",
68
+ agentDescription: "Per-invocation JSON output. Equivalent to setting outputMode=json for one command without mutating session.json.\nPrecedence: --json > C8CTL_OUTPUT_MODE > persisted session state.",
69
+ agentAppliesTo: "all commands",
70
+ },
65
71
  };
66
72
  /**
67
73
  * Flags shared across all search/list commands.
@@ -418,23 +424,18 @@ export const COMMAND_REGISTRY = {
418
424
  "auth",
419
425
  "mapping-rules",
420
426
  ],
427
+ // Verb-level `flags` holds only genuinely shared flags. Per-resource
428
+ // flags live exclusively in `resourceFlags` so unknown-flag detection
429
+ // warns when (e.g.) `--processDefinitionId` is passed against a
430
+ // non-PD resource (#256). The flag is still parsed by `parseArgs`
431
+ // (see `deriveParseArgsOptions`, which iterates `resourceFlags` too)
432
+ // and the value is ignored — the warning is the user-facing signal.
421
433
  flags: {
422
434
  all: {
423
435
  type: "boolean",
424
436
  description: "List all (disable pagination limit)",
425
437
  },
426
438
  ...SEARCH_FLAGS,
427
- ...PI_SEARCH_FLAGS,
428
- ...PD_SEARCH_FLAGS,
429
- ...UT_SEARCH_FLAGS,
430
- ...INC_SEARCH_FLAGS,
431
- ...JOB_SEARCH_FLAGS,
432
- ...USER_SEARCH_FLAGS,
433
- ...ROLE_SEARCH_FLAGS,
434
- ...GROUP_SEARCH_FLAGS,
435
- ...TENANT_SEARCH_FLAGS,
436
- ...AUTH_SEARCH_FLAGS,
437
- ...MR_SEARCH_FLAGS,
438
439
  },
439
440
  resourceFlags: {
440
441
  "process-definition": PD_SEARCH_FLAGS,
@@ -521,20 +522,14 @@ export const COMMAND_REGISTRY = {
521
522
  "auth",
522
523
  "mapping-rules",
523
524
  ],
525
+ // Verb-level `flags` holds only genuinely shared flags. Per-resource
526
+ // flags live exclusively in `resourceFlags` so unknown-flag detection
527
+ // warns when (e.g.) `--processDefinitionId` is passed against a
528
+ // non-PD resource (#256). The flag is still parsed by `parseArgs`
529
+ // (see `deriveParseArgsOptions`, which iterates `resourceFlags` too)
530
+ // and the value is ignored — the warning is the user-facing signal.
524
531
  flags: {
525
532
  ...SEARCH_FLAGS,
526
- ...PI_SEARCH_FLAGS,
527
- ...PD_SEARCH_FLAGS,
528
- ...UT_SEARCH_FLAGS,
529
- ...INC_SEARCH_FLAGS,
530
- ...JOB_SEARCH_FLAGS,
531
- ...VAR_SEARCH_FLAGS,
532
- ...USER_SEARCH_FLAGS,
533
- ...ROLE_SEARCH_FLAGS,
534
- ...GROUP_SEARCH_FLAGS,
535
- ...TENANT_SEARCH_FLAGS,
536
- ...AUTH_SEARCH_FLAGS,
537
- ...MR_SEARCH_FLAGS,
538
533
  },
539
534
  resourceFlags: {
540
535
  "process-definition": PD_SEARCH_FLAGS,
@@ -602,7 +597,13 @@ export const COMMAND_REGISTRY = {
602
597
  "auth",
603
598
  "mapping-rule",
604
599
  ],
605
- flags: { ...GET_PD_FLAGS, ...GET_FORM_FLAGS, ...GET_PI_FLAGS },
600
+ // Verb-level `flags` holds only genuinely shared flags. Per-resource
601
+ // flags live exclusively in `resourceFlags` so unknown-flag detection
602
+ // warns when (e.g.) `--xml` is passed against a non-PD resource
603
+ // (#256). The flag is still parsed by `parseArgs` (see
604
+ // `deriveParseArgsOptions`, which iterates `resourceFlags` too) and
605
+ // the value is ignored — the warning is the user-facing signal.
606
+ flags: {},
606
607
  resourceFlags: {
607
608
  "process-definition": GET_PD_FLAGS,
608
609
  form: GET_FORM_FLAGS,
@@ -1359,12 +1360,14 @@ export const COMMAND_REGISTRY = {
1359
1360
  },
1360
1361
  ],
1361
1362
  resources: ["bash", "zsh", "fish", "install"],
1362
- flags: {
1363
- shell: {
1364
- type: "string",
1365
- description: "Shell to install completions for (bash, zsh, fish)",
1366
- },
1367
- },
1363
+ // `--shell` only applies to `completion install` — declared once in
1364
+ // `resourceFlags.install` so it triggers an unknown-flag warning when
1365
+ // passed to other resources (e.g. `completion zsh --shell bash`).
1366
+ // This is the original #256 defect class. `parseArgs` still accepts
1367
+ // the flag globally via `deriveParseArgsOptions` iterating
1368
+ // `resourceFlags`, and the value is ignored on non-install branches
1369
+ // of `completionCommand` — the warning is the user-facing signal.
1370
+ flags: {},
1368
1371
  resourceFlags: {
1369
1372
  install: {
1370
1373
  shell: {
@@ -1403,7 +1406,7 @@ export const COMMAND_REGISTRY = {
1403
1406
  aliases: ["menu"],
1404
1407
  },
1405
1408
  which: {
1406
- description: "Show active profile",
1409
+ description: "Show active profile or output mode",
1407
1410
  mutating: false,
1408
1411
  requiresResource: true,
1409
1412
  helpExamples: [
@@ -1411,8 +1414,12 @@ export const COMMAND_REGISTRY = {
1411
1414
  command: "c8ctl which profile",
1412
1415
  description: "Show currently active profile",
1413
1416
  },
1417
+ {
1418
+ command: "c8ctl which output",
1419
+ description: "Show current output mode",
1420
+ },
1414
1421
  ],
1415
- resources: ["profile"],
1422
+ resources: ["profile", "output"],
1416
1423
  flags: {},
1417
1424
  },
1418
1425
  };
@@ -1499,7 +1506,7 @@ export function isValidCommand(verb, resource) {
1499
1506
  * "string" wins because parseArgs with `type: "string"` can accept any
1500
1507
  * value, whereas `type: "boolean"` would discard the string payload.
1501
1508
  */
1502
- export function deriveParseArgsOptions() {
1509
+ export function deriveParseArgsOptions(pluginFlags) {
1503
1510
  const options = {};
1504
1511
  function addFlags(flags) {
1505
1512
  for (const [name, def] of Object.entries(flags)) {
@@ -1533,6 +1540,12 @@ export function deriveParseArgsOptions() {
1533
1540
  }
1534
1541
  }
1535
1542
  }
1543
+ // Add plugin flags if provided
1544
+ if (pluginFlags) {
1545
+ for (const commandFlags of Object.values(pluginFlags)) {
1546
+ addFlags(commandFlags);
1547
+ }
1548
+ }
1536
1549
  return options;
1537
1550
  }
1538
1551
  //# sourceMappingURL=command-registry.js.map