EveryInc/compound-engineering-plugin · error · Error

Unknown target: ${targetName}

Error message

Unknown target: ${targetName}

What it means

`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.

Source

Thrown at src/commands/convert.ts:147

          piHome,
          pluginName: plugin.manifest.name,
          hasExplicitOutput,
        })
        const writeScope =
          tool.name === "opencode" ? resolveOpenCodeWriteScope(hasExplicitOutput, undefined) : undefined
        await handler.write(root, bundle, writeScope)
        console.log(`Converted ${plugin.manifest.name} to ${tool.name} at ${root}`)
      }

      if (activeTargets.some((t) => t.name === "codex")) {
        await stripCodexAgentsToolMap(codexHome)
      }
      return
    }

    const target = targets[targetName]
    if (!target) {
      throw new Error(`Unknown target: ${targetName}`)
    }

    if (!target.implemented) {
      throw new Error(`Target ${targetName} is registered but not implemented yet.`)
    }

    const resolvedScope = validateScope(targetName, target, args.scope ? String(args.scope) : undefined)

    const primaryOutputRoot = resolveTargetOutputRoot({
      targetName,
      outputRoot,
      codexHome,
      piHome,
      pluginName: plugin.manifest.name,
      hasExplicitOutput,
      scope: resolvedScope,
    })
    const bundle = target.convert(plugin, options)

View on GitHub (pinned to c9c10f8c75)

Solutions

  1. Use a registered target: --to opencode, codex, pi, or antigravity.
  2. Check case-sensitivity: the name must match the registry key exactly (lowercase).
  3. List available targets via `convert --help` or by inspecting `targets` in src/targets/index.ts for your version.
  4. If you need a target that isn't registered, don't confuse it with `cleanup` targets — convert only supports the registered set.

Example fix

// before
bun run src/index.ts convert --to cursor --source ./plugin
// Error: Unknown target: cursor

// after
bun run src/index.ts convert --to opencode --source ./plugin
Defensive patterns

Strategy: validation

Validate before calling

const CONVERT_TARGETS = ["opencode", "codex", "pi", "antigravity"] as const
const to = process.env.TARGET
if (!(CONVERT_TARGETS as readonly string[]).includes(to)) {
  throw new Error(`--to must be one of ${CONVERT_TARGETS.join(" | ")}, got: ${to}`)
}

Type guard

type ConvertTarget = "opencode" | "codex" | "pi" | "antigravity"
function isConvertTarget(v: string): v is ConvertTarget {
  return (["opencode", "codex", "pi", "antigravity"] as const).includes(v as never)
}

Try / catch

try {
  await convert({ to: targetName })
} catch (e) {
  if (e instanceof Error && e.message.startsWith("Unknown target:")) {
    console.error(`${e.message} — registered targets: opencode, codex, pi, antigravity`)
  } else throw e
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of EveryInc/compound-engineering-plugin@c9c10f8c75 (2026-08-31). Data as JSON: /api/errors/b6fb98afcb07522b. Report an issue: GitHub.