{"record":{"id":"c13368d83a129df0","repo":"Yeachan-Heo/oh-my-codex","slug":"usage-omx-team-api-operation-input-json","errorCode":null,"errorMessage":"Usage: omx team api <operation> [--input <json>] [--json]\\nSupported operations: ${TEAM_API_OPERATIONS.join(', ')}","messagePattern":"Usage: omx team api <operation> \\[--input <json>\\] \\[--json\\]\\\\nSupported operations: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/team.ts","lineNumber":526,"sourceCode":"\nexport interface ParsedTeamStartArgs {\n  parsed: ParsedTeamArgs;\n  worktreeMode: WorktreeMode;\n}\n\nfunction resolveDefaultTeamWorktreeMode(mode: WorktreeMode): WorktreeMode {\n  if (mode.enabled) return mode;\n  return { enabled: true, detached: true, name: null };\n}\n\nfunction parseTeamApiArgs(args: string[]): {\n  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>;","sourceCodeStart":508,"sourceCodeEnd":544,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/team.ts#L508-L544","documentation":"Thrown by parseTeamApiArgs when the first argument to `omx team api` does not resolve to a known TeamApiOperation (empty or unrecognized). It's a usage error that also lists the supported operations via TEAM_API_OPERATIONS.join(', ').","triggerScenarios":"Running `omx team api` with no operation, or with a misspelled/unknown operation such as `omx team api list-member` when the supported set doesn't include it.","commonSituations":"Version drift where an operation was renamed or removed, tab-completion or scripts referencing old operation names, or forgetting the operation argument entirely.","solutions":["Run with one of the operations listed in the error message (TEAM_API_OPERATIONS).","Check the current TEAM_API_OPERATIONS constant/source for your installed version to confirm available names.","Update scripts/aliases that reference a renamed operation."],"exampleFix":"# before\nomx team api get-member --json\n# after\nomx team api <supported-operation> --json   # e.g. one of the names in the error message","handlingStrategy":"validation","validationCode":"if (!TEAM_API_OPERATIONS.includes(args[0])) {\n  console.error('Supported operations: ' + TEAM_API_OPERATIONS.join(', '));\n  process.exit(2);\n}","typeGuard":"const isTeamApiOperation = (v: string): v is TeamApiOperation =>\n  (TEAM_API_OPERATIONS as readonly string[]).includes(v);","tryCatchPattern":"try { await teamApi(args); } catch (e) {\n  if (e instanceof Error && e.message.startsWith('Usage: omx team api')) { /* show help, exit 2 */ }\n  else throw e;\n}","preventionTips":["Derive operation names from TEAM_API_OPERATIONS rather than hardcoding.","Add a `--help` check or tab-completion for operations instead of guessing."],"tags":["cli","usage-error","argument-validation"],"backgroundTag":"unknown-cli-subcommand","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}