{"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":"validation","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/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/consult.js#L214-L250","documentation":"parseArgs in scripts/consult.js validates the --install-target CLI flag against SUPPORTED_INSTALL_TARGETS before running a consult lookup. If the user names a target (install surface) that the consult tool does not know, it refuses with a list of valid targets. This keeps installs from being routed to nonexistent or unsupported surfaces.","triggerScenarios":"Running the consult script with `--install-target <value>` where <value> is not in SUPPORTED_INSTALL_TARGETS — e.g. a typo, a renamed surface, or a target from a newer/older version of the repo.","commonSituations":"Typing `--install-target agents` when only e.g. `skills,commands` are supported; following outdated docs; scripting the CLI with a hardcoded target after the target list changed.","solutions":["Read the expected list from the error message and pass one of the listed targets.","Check SUPPORTED_INSTALL_TARGETS at the top of scripts/consult.js for the current valid values.","If the target should exist, update SUPPORTED_INSTALL_TARGETS (and related routing) in scripts/consult.js."],"exampleFix":"// before\nnode scripts/consult.js --install-target hooks \"security review\"\n// after\nnode scripts/consult.js --install-target skills \"security review\"","handlingStrategy":"validation","validationCode":"const SUPPORTED = ['skills', 'commands']; // mirror from scripts/consult.js\nif (!SUPPORTED.includes(target)) {\n  throw new Error(`Unsupported target: ${target}. Expected one of ${SUPPORTED.join(', ')}`);\n}","typeGuard":"function isValidTarget(t) { return typeof t === 'string' && SUPPORTED_INSTALL_TARGETS.includes(t); }","tryCatchPattern":"try {\n  runConsult(['--install-target', target, query]);\n} catch (e) {\n  if (e.message.startsWith('Unknown install target')) {\n    console.error(`Pick a target from: ${e.message.match(/Expected one of (.*)/)?.[1]}`);\n  } else throw e;\n}","preventionTips":["Derive target choices from SUPPORTED_INSTALL_TARGETS instead of hardcoding strings.","Add a shell completion or menu listing valid targets.","Re-check the target list after pulling repo updates."],"tags":["cli","argument-validation","install-target"],"backgroundTag":"invalid-enum-value","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}