{"record":{"id":"b6fb98afcb07522b","repo":"EveryInc/compound-engineering-plugin","slug":"unknown-target-targetname","errorCode":null,"errorMessage":"Unknown target: ${targetName}","messagePattern":"Unknown target: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/commands/convert.ts","lineNumber":147,"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(`Converted ${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\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 primaryOutputRoot = resolveTargetOutputRoot({\n      targetName,\n      outputRoot,\n      codexHome,\n      piHome,\n      pluginName: plugin.manifest.name,\n      hasExplicitOutput,\n      scope: resolvedScope,\n    })\n    const bundle = target.convert(plugin, options)","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/EveryInc/compound-engineering-plugin/blob/c9c10f8c75412c7232cb2bd663e5fd1cea98d84e/src/commands/convert.ts#L129-L165","documentation":"`convert --to` must name a registered target in the `targets` registry (src/targets/index.ts). If `targets[targetName]` is undefined the CLI throws this error before any conversion runs. Registered targets include opencode, codex, pi, and antigravity.","triggerScenarios":"Running `convert --to claude`, `--to cursor`, or any misspelled/unsupported target name. Also occurs when passing the name of a target you expect to exist but that isn't in your installed CLI version's registry.","commonSituations":"Confusing convert targets with cleanup targets (cleanup supports kiro/copilot/droid/qwen/windsurf, convert does not); typos like \"openCode\" (case-sensitive); using docs for a newer/older CLI version with a different target set.","solutions":["Use a registered target: --to opencode, codex, pi, or antigravity.","Check case-sensitivity: the name must match the registry key exactly (lowercase).","List available targets via `convert --help` or by inspecting `targets` in src/targets/index.ts for your version.","If you need a target that isn't registered, don't confuse it with `cleanup` targets — convert only supports the registered set."],"exampleFix":"// before\nbun run src/index.ts convert --to cursor --source ./plugin\n// Error: Unknown target: cursor\n\n// after\nbun run src/index.ts convert --to opencode --source ./plugin","handlingStrategy":"validation","validationCode":"const CONVERT_TARGETS = [\"opencode\", \"codex\", \"pi\", \"antigravity\"] as const\nconst to = process.env.TARGET\nif (!(CONVERT_TARGETS as readonly string[]).includes(to)) {\n  throw new Error(`--to must be one of ${CONVERT_TARGETS.join(\" | \")}, got: ${to}`)\n}","typeGuard":"type ConvertTarget = \"opencode\" | \"codex\" | \"pi\" | \"antigravity\"\nfunction isConvertTarget(v: string): v is ConvertTarget {\n  return ([\"opencode\", \"codex\", \"pi\", \"antigravity\"] as const).includes(v as never)\n}","tryCatchPattern":"try {\n  await convert({ to: targetName })\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith(\"Unknown target:\")) {\n    console.error(`${e.message} — registered targets: opencode, codex, pi, antigravity`)\n  } else throw e\n}","preventionTips":["Don't assume cleanup targets (kiro, copilot, windsurf, ...) are convertible targets — the sets differ.","Use lowercase target names; registry keys are case-sensitive.","In scripts, import the `targets` record from src/targets/index.ts (or read its keys) instead of hardcoding names."],"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"}