{"record":{"id":"7fdd20430786045d","repo":"affaan-m/ECC","slug":"value-for-argument-is-too-long","errorCode":null,"errorMessage":"Value for ${argument} is too long.","messagePattern":"Value for (.+?) is too long\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/install-guided.js","lineNumber":85,"sourceCode":"    profile: undefined,\n    yes: false,\n  };\n  const valueFlags = new Map([\n    ['--harness', 'harnesses'],\n    ['--claude-scope', 'claudeScope'],\n    ['--claude-hooks', 'claudeHooks'],\n    ['--profile', 'profile'],\n  ]);\n\n  for (let index = 0; index < argv.length; index += 1) {\n    const argument = argv[index];\n    if (valueFlags.has(argument)) {\n      const value = argv[index + 1];\n      if (!value || value.startsWith('--')) {\n        throw new Error(`Missing value for ${argument}`);\n      }\n      if (value.length > 256) {\n        throw new Error(`Value for ${argument} is too long.`);\n      }\n      const key = valueFlags.get(argument);\n      options = key === 'harnesses'\n        ? { ...options, harnesses: [...options.harnesses, value] }\n        : { ...options, [key]: value };\n      index += 1;\n    } else if (argument === '--all-harnesses') {\n      options = { ...options, allHarnesses: true };\n    } else if (argument === '--yes' || argument === '-y') {\n      options = { ...options, yes: true };\n    } else if (argument === '--dry-run') {\n      options = { ...options, dryRun: true };\n    } else if (argument === '--json') {\n      options = { ...options, json: true };\n    } else if (argument === '--help' || argument === '-h') {\n      options = { ...options, help: true };\n    } else {\n      throw new Error('Unknown argument. Run guided install with --help to see valid options.');","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/install-guided.js#L67-L103","documentation":"parseArgs in scripts/install-guided.js enforces a 256-character limit on every value passed to a value flag. Oversized values are rejected to prevent absurd inputs, buffer bloat, and injection-sized payloads from reaching downstream config or shell steps.","triggerScenarios":"Passing a --harness, --root, or similar value longer than 256 characters — e.g. a deeply nested path, a blob pasted by mistake, or an unquoted glob expansion feeding a huge token.","commonSituations":"Very deep project paths on Windows, accidentally pasting file contents as a flag value, shell glob expansion producing one giant argument.","solutions":["Shorten the value — use a shorter relative path or identifier","Check the command for accidental paste or glob expansion (`echo` the args first)","If the value is a path, cd into the tree and pass a relative path instead","If 256 chars is genuinely needed, this is unsupported; restructure the input"],"exampleFix":"// before\nnode scripts/install-guided.js --root /very/long/path/... (>256 chars)\n// after\ncd /very/long/path && node /path/to/scripts/install-guided.js --root .","handlingStrategy":"validation","validationCode":"if (typeof value === 'string' && value.length > 256) {\n  throw new Error(`Value for ${flag} is too long (max 256 chars).`);\n}\n// check before invoking install-guided.js","typeGuard":"const isAcceptableValue = (v) => typeof v === 'string' && v.length > 0 && v.length <= 256;","tryCatchPattern":"try {\n  parseArgs(rawArgv);\n} catch (err) {\n  if (err.message.includes('is too long')) {\n    console.error(`${err.message} Pass a shorter path or identifier.`);\n    process.exit(2);\n  }\n  throw err;\n}","preventionTips":["Quote globs to prevent shell expansion into giant tokens","Use short relative paths from the project root","Echo arguments in wrapper scripts to inspect what is actually passed"],"tags":["cli","validation","input-length"],"backgroundTag":"value-out-of-range","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"}