{"record":{"id":"ce047791a5f41f28","repo":"Yeachan-Heo/oh-my-codex","slug":"missing-value-after-input","errorCode":null,"errorMessage":"Missing value after --input","messagePattern":"Missing value after --input","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/team.ts","lineNumber":538,"sourceCode":"  operation: TeamApiOperation;\n  input: Record<string, unknown>;\n  json: boolean;\n} {\n  const operation = resolveTeamApiOperation(args[0] || '');\n  if (!operation) {\n    throw new Error(`Usage: omx team api <operation> [--input <json>] [--json]\\nSupported operations: ${TEAM_API_OPERATIONS.join(', ')}`);\n  }\n  let input: Record<string, unknown> = {};\n  let json = false;\n  for (let i = 1; i < args.length; i += 1) {\n    const token = args[i];\n    if (token === '--json') {\n      json = true;\n      continue;\n    }\n    if (token === '--input') {\n      const next = args[i + 1];\n      if (!next) throw new Error('Missing value after --input');\n      try {\n        const parsed = JSON.parse(next) as unknown;\n        if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {\n          throw new Error('input must be a JSON object');\n        }\n        input = parsed as Record<string, unknown>;\n      } catch (error) {\n        throw new Error(`Invalid --input JSON: ${error instanceof Error ? error.message : String(error)}`);\n      }\n      i += 1;\n      continue;\n    }\n    if (token.startsWith('--input=')) {\n      const raw = token.slice('--input='.length);\n      try {\n        const parsed = JSON.parse(raw) as unknown;\n        if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {\n          throw new Error('input must be a JSON object');","sourceCodeStart":520,"sourceCodeEnd":556,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/team.ts#L520-L556","documentation":"Thrown by parseTeamApiArgs when `--input` is the last token, so there is no following argument to parse as JSON. The CLI requires --input to be immediately followed by its JSON payload.","triggerScenarios":"`omx team api <op> --input` with nothing after it, or a shell quoting mistake that drops the JSON argument.","commonSituations":"Building the command dynamically and the input variable is empty/unset, trailing-flag typos, or a truncated command line in a script.","solutions":["Supply the JSON object right after --input: `omx team api <op> --input '{\"team\":\"acme\"}'`.","If generating the command in a script, guard that the input variable is non-empty before appending --input.","Alternatively use the `--input=<json>` form so the value is never a separate token."],"exampleFix":"# before\nomx team api create --input\n# after\nomx team api create --input '{\"name\":\"acme\"}'","handlingStrategy":"validation","validationCode":"const i = args.indexOf('--input');\nif (i !== -1 && (i === args.length - 1 || args[i + 1].startsWith('--'))) {\n  throw new Error('Missing value after --input');\n}\n// or prefer the --input=<json> form so a value can never be omitted","typeGuard":"function hasInputValue(args: string[]): boolean {\n  const i = args.indexOf('--input');\n  return i === -1 || i + 1 < args.length;\n}","tryCatchPattern":"try { await teamApi(args); } catch (e) {\n  if (e instanceof Error && e.message === 'Missing value after --input') { /* prompt for input or default to {} */ }\n  else throw e;\n}","preventionTips":["Prefer --input=<json> to keep flag and value in one token.","When composing commands programmatically, skip --input when the payload variable is empty."],"tags":["cli","missing-argument","usage-error"],"backgroundTag":"missing-cli-option-value","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}