{"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":null,"httpStatus":null,"severity":"error","filePath":"scripts/install-guided.js","lineNumber":84,"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":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/install-guided.js#L66-L102","documentation":"Each value for --harness, --claude-scope, --claude-hooks, and --profile is capped at 256 characters. A longer value is rejected to guard against absurd or hostile input before it is stored in the options object.","triggerScenarios":"Passing a pathological value such as a 300-character string after one of the value flags, or accidentally glob-expanding a huge path into a flag value.","commonSituations":"A shell expansion or variable that unexpectedly contains a very long string, or a copy-paste of a file path list where a single value is expected.","solutions":["Shorten the value to a single, valid token (e.g. claude, user, standard, core)","Check the shell variable you are interpolating is not accidentally huge","Pass harnesses one at a time with repeated --harness flags instead of one long value"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const VALUE_FLAGS = new Set(['--harness','--claude-scope','--claude-hooks','--profile']);\nfor (let i = 0; i < argv.length; i++) {\n  if (VALUE_FLAGS.has(argv[i])) {\n    const v = argv[i + 1] || '';\n    if (v.length > 256) throw new Error(`Value for ${argv[i]} exceeds 256 chars`);\n  }\n}","typeGuard":"function isWithinValueLimit(value, max = 256) {\n  return typeof value === 'string' && value.length > 0 && value.length <= max;\n}","tryCatchPattern":"try { parseInstallGuidedArgs(argv); }\ncatch (err) {\n  if (/is too long/.test(err.message)) {\n    console.error(err.message);\n    process.exit(2);\n  }\n  throw err;\n}","preventionTips":["Pass short, canonical tokens (claude, user, standard, core) rather than paths or lists","Sanitize shell variables before interpolating them into flag values","Use repeated --harness flags instead of one enormous value"],"tags":["cli","argument-validation","input-limits","install-guided"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}