{"record":{"id":"d30d2330bc986a9b","repo":"EveryInc/compound-engineering-plugin","slug":"unknown-target-targetname-d30d23","errorCode":null,"errorMessage":"Unknown target: ${targetName}","messagePattern":"Unknown target: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/commands/install.ts","lineNumber":158,"sourceCode":"            piHome,\n            pluginName: plugin.manifest.name,\n            hasExplicitOutput,\n          })\n          const writeScope =\n            tool.name === \"opencode\" ? resolveOpenCodeWriteScope(hasExplicitOutput, undefined) : undefined\n          await handler.write(root, bundle, writeScope)\n          console.log(`Installed ${plugin.manifest.name} to ${tool.name} at ${root}`)\n        }\n\n        if (activeTargets.some((t) => t.name === \"codex\")) {\n          await stripCodexAgentsToolMap(codexHome)\n        }\n        return\n      }\n\n      const target = targets[targetName]\n      if (!target) {\n        throw new Error(`Unknown target: ${targetName}`)\n      }\n      if (!target.implemented) {\n        throw new Error(`Target ${targetName} is registered but not implemented yet.`)\n      }\n\n      const resolvedScope = validateScope(targetName, target, args.scope ? String(args.scope) : undefined)\n\n      const bundle = target.convert(plugin, options)\n      if (!bundle) {\n        throw new Error(`Target ${targetName} did not return a bundle.`)\n      }\n      const primaryOutputRoot = resolveTargetOutputRoot({\n        targetName,\n        outputRoot,\n        codexHome,\n        piHome,\n        pluginName: plugin.manifest.name,\n        hasExplicitOutput,","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/EveryInc/compound-engineering-plugin/blob/c9c10f8c75412c7232cb2bd663e5fd1cea98d84e/src/commands/install.ts#L140-L176","documentation":"`install --to` must name a target registered in the shared `targets` registry (src/targets/index.ts: opencode, codex, pi, antigravity). If the name is not a key in that record, `run` throws this error before checking implementation status or writing any files.","triggerScenarios":"Running `install --to gemini`, `--to kiro`, `--to copilot`, or any misspelled/unknown target. Notably, the cleanup command supports more targets (kiro, copilot, droid, qwen, windsurf) than install — passing a cleanup-only target to install produces this error.","commonSituations":"Assuming every agent platform with a cleanup target also has an install target; typos or wrong casing; scripts written against a different version of the target registry; confusing `convert`/`install` target sets with `cleanup` target sets.","solutions":["Use one of the registered install targets: --to opencode, codex, pi, or antigravity.","Match case exactly — registry keys are lowercase.","Confirm available targets with `install --help` or by reading `targets` in src/targets/index.ts.","If the platform you want is cleanup-only (kiro, copilot, droid, qwen, windsurf), it has no installer; convert/install only supports the registered set."],"exampleFix":"// before\nbun run src/index.ts install --to windsurf --plugin compound-engineering\n// Error: Unknown target: windsurf\n\n// after\nbun run src/index.ts install --to opencode --plugin compound-engineering","handlingStrategy":"validation","validationCode":"import { targets } from \"./src/targets/index\"\nconst to = process.env.INSTALL_TARGET\nif (!(to in targets)) {\n  throw new Error(`--to '${to}' is not an install target. Registered: ${Object.keys(targets).join(\", \")}`)\n}","typeGuard":"function isInstallTarget(v: string): v is keyof typeof targets {\n  return v in targets\n}","tryCatchPattern":"try {\n  await install({ to: targetName, plugin })\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith(\"Unknown target:\")) {\n    console.error(`${e.message} — install targets: opencode, codex, pi, antigravity`)\n  } else throw e\n}","preventionTips":["Remember install/convert support fewer targets than cleanup; don't reuse cleanup target lists for install.","Use lowercase exact registry keys.","Derive the allowed list from Object.keys(targets) in scripts instead of maintaining a copy."],"tags":["cli","validation","argument-parsing"],"backgroundTag":"unknown-identifier","analyzedSha":"c9c10f8c75412c7232cb2bd663e5fd1cea98d84e","analyzedAt":"2026-08-31T15:18:07.959Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}