{"record":{"id":"43f4f1f2798395c3","repo":"heygen-com/hyperframes","slug":"use-either-all-or-capability-not-both","errorCode":null,"errorMessage":"Use either --all or --capability, not both","messagePattern":"Use either --all or --capability, not both","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/media-treatment.ts","lineNumber":564,"sourceCode":"  analyze?: boolean;\n  clear?: boolean;\n  \"dry-run\"?: boolean;\n  json?: boolean;\n}\n\nfunction runCapabilityQuery(args: MediaTreatmentCommandArgs): void {\n  const capability = readOptionalString(args.capability);\n  const hasMutationOption = [\n    readOptionalString(args.selector),\n    readOptionalString(args.grading),\n    args.clear,\n    args[\"dry-run\"],\n    args.apply,\n    args.analyze,\n  ].some(Boolean);\n  if (hasMutationOption) throw new Error(\"--capabilities cannot be combined with mutation options\");\n  if (args.all === true && capability)\n    throw new Error(\"Use either --all or --capability, not both\");\n\n  let capabilities: unknown = getMediaTreatmentCapabilityOverview();\n  if (args.all === true) capabilities = getHfColorGradingCapabilities();\n  else if (capability) capabilities = getMediaTreatmentCapabilityDetail(capability);\n  console.log(JSON.stringify(withMeta({ ok: true, capabilities }), null, 2));\n}\n\nfunction resolveMutationFile(args: MediaTreatmentCommandArgs) {\n  const project = resolveProject(readOptionalString(args.project));\n  const fileArg = readOptionalString(args.file) ?? \"index.html\";\n  const filePath = resolve(project.dir, fileArg);\n  if (!isPathInside(filePath, project.dir) || !filePath.toLowerCase().endsWith(\".html\")) {\n    throw new Error(\"--file must be an HTML file inside the project\");\n  }\n  if (!existsSync(filePath)) throw new Error(`Composition file not found: ${fileArg}`);\n  return { project, filePath };\n}\n","sourceCodeStart":546,"sourceCodeEnd":582,"githubUrl":"https://github.com/heygen-com/hyperframes/blob/c2996c8626135db5253519359d8a063d3bafad8d/packages/cli/src/commands/media-treatment.ts#L546-L582","documentation":"Thrown by runCapabilityQuery when both --all and --capability <id> are provided. --all prints the entire exhaustive catalog; --capability narrows to one family/item. They are mutually exclusive output scopes and cannot be combined.","triggerScenarios":"Running `hyperframes media-treatment --capabilities --all --capability wheels` or `--all --capability kuwahara`.","commonSituations":"Agent loops that pass --all for completeness then append --capability for focus. Users exploring who set both flags expecting a filtered subset of --all.","solutions":["For the full catalog: use `--capabilities --all` alone","For one capability: use `--capabilities --capability <id>` alone","For a concise overview: use `--capabilities` alone"],"exampleFix":"// before\nhyperframes media-treatment --capabilities --all --capability wheels\n// after — choose one scope\nhyperframes media-treatment --capabilities --all\n// or\nhyperframes media-treatment --capabilities --capability wheels","handlingStrategy":"validation","validationCode":"function assertExclusiveScope(all?: boolean, capability?: string): void {\n  if (all && capability) {\n    throw new Error('Use --all or --capability, not both');\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat --all and --capability as mutually exclusive in command builders","Default to --capability <id> for focused inspection"],"tags":["media-treatment","cli","argument-conflict","validation"],"backgroundTag":null,"analyzedSha":"c2996c8626135db5253519359d8a063d3bafad8d","analyzedAt":"2026-08-12T22:18:56.877Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}