{"record":{"id":"4f5239e4aff5843c","repo":"affaan-m/ECC","slug":"move-scope-requires-an-explicit-scope-destinat","errorCode":null,"errorMessage":"--move-scope requires an explicit --scope destination.","messagePattern":"--move-scope requires an explicit --scope destination\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/setup.js","lineNumber":113,"sourceCode":"      options.json = true;\n    } else if (argument === '--help' || argument === '-h') {\n      options.help = true;\n    } else {\n      throw new Error(`Unknown argument: ${argument}`);\n    }\n  }\n\n  if (options.mode !== undefined && options.mode !== MODE) {\n    throw new Error(`Invalid setup mode: ${options.mode}. This command currently supports ${MODE}.`);\n  }\n  if (options.scope !== undefined && !VALID_SCOPES.has(options.scope)) {\n    throw new Error(`Invalid --scope value: ${options.scope}`);\n  }\n  if (options.hooks !== undefined && !VALID_HOOK_MODES.has(options.hooks)) {\n    throw new Error(`Invalid --hooks value: ${options.hooks}`);\n  }\n  if (options.moveScope && options.scope === undefined) {\n    throw new Error('--move-scope requires an explicit --scope destination.');\n  }\n  return options;\n}\n\nfunction questionWithCancellation(terminal, prompt) {\n  return new Promise((resolve, reject) => {\n    let settled = false;\n    const finish = callback => value => {\n      if (settled) return;\n      settled = true;\n      terminal.removeListener('close', onClose);\n      callback(value);\n    };\n    const onClose = finish(() => {\n      const error = new Error('Readline was closed before an answer was received.');\n      error.code = 'ABORT_ERR';\n      reject(error);\n    });","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/setup.js#L95-L131","documentation":"parseArgs throws this when --move-scope is passed without also passing an explicit --scope. Scope migration needs a concrete destination scope to move the installation to; requesting the move without naming the destination is ambiguous and rejected.","triggerScenarios":"Running `ecc setup --move-scope` or `ecc setup --mode claude-plugin --move-scope --hooks minimal` — --move-scope present but --scope undefined.","commonSituations":"Assuming --move-scope alone migrates to a default destination; copying the flag from migration docs but dropping the paired --scope; refactoring scripts where the --scope argument was removed.","solutions":["Add the destination: `ecc setup --move-scope --scope user` (or project/local).","Drop --move-scope if migration is already auto-detected by choosing a different scope.","Run `ecc setup --help` to see the documented pairing `--scope project --move-scope`."],"exampleFix":"// before\nnpm run setup -- --move-scope\n\n// after\nnpm run setup -- --move-scope --scope user","handlingStrategy":"validation","validationCode":"const has = (f) => argv.includes(f);\nif (has('--move-scope') && !has('--scope')) {\n  throw new Error('--move-scope requires an explicit --scope destination.');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runSetup(rawArgs);\n} catch (err) {\n  if (err.message.includes('--move-scope requires')) {\n    console.error(err.message);\n    process.exitCode = 2;\n  } else throw err;\n}","preventionTips":["Always pair --move-scope with --scope in the same command line.","Define migration invocations as full literal commands in scripts.","Note that plain scope changes migrate automatically; --move-scope is only for explicit requests."],"tags":["cli","flag-dependency","migration"],"backgroundTag":"missing-required-flag","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"}