{"record":{"id":"8246f55181716461","repo":"affaan-m/ECC","slug":"unknown-install-target-parsed-target-expected","errorCode":null,"errorMessage":"Unknown install target: ${parsed.target}. Expected one of ${SUPPORTED_INSTALL_TARGETS.join(', ')}","messagePattern":"Unknown install target: (.+?)\\. Expected one of (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/consult.js","lineNumber":232,"sourceCode":"        throw new Error('Missing value for --target');\n      }\n      parsed.target = args[index + 1];\n      index += 1;\n    } else if (arg === '--limit') {\n      if (!args[index + 1]) {\n        throw new Error('Missing value for --limit');\n      }\n      parsed.limit = Math.min(parsePositiveInteger(args[index + 1], '--limit'), MAX_LIMIT);\n      index += 1;\n    } else if (arg.startsWith('-')) {\n      throw new Error(`Unknown argument: ${arg}`);\n    } else {\n      parsed.queryParts.push(arg);\n    }\n  }\n\n  if (!SUPPORTED_INSTALL_TARGETS.includes(parsed.target)) {\n    throw new Error(\n      `Unknown install target: ${parsed.target}. Expected one of ${SUPPORTED_INSTALL_TARGETS.join(', ')}`\n    );\n  }\n\n  parsed.query = parsed.queryParts.join(' ').trim();\n  return parsed;\n}\n\nfunction commandFor(kind, id, target) {\n  if (kind === 'profile') {\n    return `npx ecc-universal install --profile ${id} --target ${target}`;\n  }\n\n  return `npx ecc-universal install --profile minimal --target ${target} --with ${id}`;\n}\n\nfunction planCommandFor(componentId, target) {\n  return `npx ecc-universal plan --profile minimal --target ${target} --with ${componentId}`;","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/consult.js#L214-L250","documentation":"After parsing all arguments, consult.js validates the --target value against SUPPORTED_INSTALL_TARGETS, which is ['claude', 'claude-project', 'cursor', 'antigravity', 'codex', 'gemini', 'opencode', 'codebuddy', 'joycode', 'qwen', 'zed', 'hermes', 'openclaw', 'kimi']. If the target is not in this list (including when left at the default 'claude' which is valid, or set to something unrecognized), the error lists all valid options. This is a post-parse validation, meaning a syntactically correct --target value that is semantically invalid still fails.","triggerScenarios":"Passing --target vscode (not supported), --target Claude (case-sensitive, capital C fails), --target npm, or any other value not in the exact supported list. The default target 'claude' is always valid.","commonSituations":"Users assuming their IDE or harness name is supported when it uses a different identifier; case mismatch (Claude vs claude); using a new harness name not yet added to SUPPORTED_INSTALL_TARGETS; typos in the target name.","solutions":["Use one of the exact supported targets listed in the error message","Ensure exact case matching (all lowercase)","If you need a new target, it must be added to SUPPORTED_INSTALL_TARGETS in scripts/lib/install-manifests.js"],"exampleFix":"// before\nnode scripts/consult.js --target vscode security\nnode scripts/consult.js --target Claude security\n// after\nnode scripts/consult.js --target claude security","handlingStrategy":"validation","validationCode":"// Validate the target before passing it to consult.js\nconst SUPPORTED = ['claude', 'claude-project', 'cursor', 'antigravity', 'codex', 'gemini', 'opencode', 'codebuddy', 'joycode', 'qwen', 'zed', 'hermes', 'openclaw', 'kimi'];\nconst target = process.env.CONSULT_TARGET || 'claude';\nif (!SUPPORTED.includes(target)) {\n  console.error(`Unknown install target: ${target}`);\n  console.error(`Expected one of: ${SUPPORTED.join(', ')}`);\n  process.exit(1);\n}","typeGuard":"// Type guard for a supported install target\nconst SUPPORTED_TARGETS = ['claude', 'claude-project', 'cursor', 'antigravity', 'codex', 'gemini', 'opencode', 'codebuddy', 'joycode', 'qwen', 'zed', 'hermes', 'openclaw', 'kimi'];\nfunction isSupportedTarget(value) {\n  return typeof value === 'string' && SUPPORTED_TARGETS.includes(value);\n}","tryCatchPattern":"try {\n  const options = parseArgs(process.argv);\n} catch (error) {\n  if (error.message.startsWith('Unknown install target:')) {\n    console.error(error.message);\n    console.error('Use --target claude (default) or check the full list in the error message.');\n    process.exit(2);\n  }\n  throw error;\n}","preventionTips":["Use the default target 'claude' by omitting --target","Target names are case-sensitive lowercase — 'Claude' fails, 'claude' passes","Consult SUPPORTED_INSTALL_TARGETS in scripts/lib/install-manifests.js for the authoritative list","When a new harness is added to ECC, this list grows — always reference the source"],"tags":["cli","argument-parsing","validation","install-targets","consult"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}