affaan-m/ECC · error · Error

--legacy-codex-sync cannot be combined with --target

Error message

--legacy-codex-sync cannot be combined with --target

What it means

Mutually exclusive paths in uninstall: --legacy-codex-sync performs the standalone legacy sync cleanup while --target removes specific targets; combining them is ambiguous and rejected before any file removal.

Source

Thrown at scripts/uninstall.js:98

    console.log(`  ${result.dryRun ? 'Planned removals' : 'Removed paths'}: ${paths.length}`);
  }

  console.log(`\nSummary: checked=${result.summary.checkedCount}, ${result.dryRun ? 'planned' : 'uninstalled'}=${result.dryRun ? result.summary.plannedRemovalCount : result.summary.uninstalledCount}, partial=${result.summary.partialCount}, errors=${result.summary.errorCount}`);

  if (!result.dryRun) {
    console.log(`\n${exitFeedbackLines().join('\n')}`);
  }
}

async function main() {
  try {
    const options = parseArgs(process.argv);
    if (options.help) {
      showHelp(0);
    }

    if (options.legacyCodexSync && options.targets.length > 0) {
      throw new Error('--legacy-codex-sync cannot be combined with --target');
    }
    const result = options.legacyCodexSync
      ? uninstallLegacyCodexSync({
          codexHome: process.env.CODEX_HOME,
          dryRun: options.dryRun,
        })
      : uninstallInstalledStates({
          homeDir: process.env.HOME || os.homedir(),
          projectRoot: process.cwd(),
          targets: options.targets,
          dryRun: options.dryRun,
        });
    if (!options.dryRun && !options.legacyCodexSync) {
      const { reconcileCanonicalInstallStates } = require('./lib/install-state-store-sync');
      result.installStateProjection = await reconcileCanonicalInstallStates({
        homeDir: process.env.HOME || os.homedir(),
        projectRoot: process.cwd(),
        targets: options.targets,

View on GitHub (pinned to 06c5e118c4)

Solutions

  1. Pass only one of the conflicting options; remove the other(s) and re-run the command.
Defensive patterns

Strategy: validation

When it happens

Trigger: Triggered when uninstall.js rejects the current invocation: --legacy-codex-sync cannot be combined with --target

Common situations: Occurs while running scripts/uninstall.js with invalid arguments, missing flags, or a failing external dependency; the guard at scripts/uninstall.js:98 aborts the command with this message.


AI-assisted analysis of affaan-m/ECC@06c5e118c4 (2026-08-18). Data as JSON: /api/errors/9b24bea9f6a78deb. Report an issue: GitHub.