{"record":{"id":"2f146323067c7ed2","repo":"Yeachan-Heo/oh-my-codex","slug":"missing-command-to-run-sparkshell-usage","errorCode":null,"errorMessage":"Missing command to run.\n${SPARKSHELL_USAGE}","messagePattern":"Missing command to run\\.\n(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/sparkshell.ts","lineNumber":303,"sourceCode":"      index += 2;\n      continue;\n    }\n    if (token.startsWith('--budget=') || token.startsWith('--cache-ttl-ms=') || token.startsWith('--team=') || token.startsWith('--worker=')) {\n      index += 1;\n      continue;\n    }\n    return [...args.slice(index)];\n  }\n  return [];\n}\n\nexport function parseSparkShellFallbackInvocation(\n  args: readonly string[],\n  options: ParseSparkShellFallbackOptions = {},\n): SparkShellFallbackInvocation {\n  args = stripSparkShellWrapperOptions(args);\n  if (args.length === 0) {\n    throw new Error(`Missing command to run.\\n${SPARKSHELL_USAGE}`);\n  }\n\n  if (args[0] === '--shell') {\n    const script = args[1];\n    if (!script) throw new Error(`--shell requires a command string.\\n${SPARKSHELL_USAGE}`);\n    if (args.length !== 2) throw new Error(`--shell does not accept additional arguments.\\n${SPARKSHELL_USAGE}`);\n    return { kind: 'command', argv: resolveFallbackShellArgv(script, options) };\n  }\n  if (args[0]?.startsWith('--shell=')) {\n    const script = args[0].slice('--shell='.length);\n    if (!script.trim()) throw new Error(`--shell requires a command string.\\n${SPARKSHELL_USAGE}`);\n    if (args.length !== 1) throw new Error(`--shell does not accept additional arguments.\\n${SPARKSHELL_USAGE}`);\n    return { kind: 'command', argv: resolveFallbackShellArgv(script, options) };\n  }\n\n  const paneStart = args.findIndex((arg) => arg === '--tmux-pane' || arg.startsWith('--tmux-pane='));\n  if (paneStart < 0) {\n    return { kind: 'command', argv: [...args] };","sourceCodeStart":285,"sourceCodeEnd":321,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/sparkshell.ts#L285-L321","documentation":"After stripping wrapper-only options, no arguments remain — sparkshell has no command to execute. The usage text is included to show expected invocation shape.","triggerScenarios":"parseSparkShellFallbackInvocation called with args that are all wrapper flags (e.g. only `--json`) or an empty array.","commonSituations":"User runs `omx sparkshell` with no command, or passes only tuning flags forgetting the actual command; scripts with an empty command array variable.","solutions":["Append the command to run after the flags, e.g. `omx sparkshell --json -- npm test`","Use `--` to separate wrapper flags from the command","If scripting, assert the command array is non-empty before invoking"],"exampleFix":"# before\nomx sparkshell --json\n# after\nomx sparkshell --json -- npm test","handlingStrategy":"validation","validationCode":"if (args.filter((a) => a !== '--').length === 0) { throw new UsageError('sparkshell requires a command'); }","typeGuard":null,"tryCatchPattern":"catch (e) { if (String(e).startsWith('Missing command to run')) { printUsage(); } else throw e; }","preventionTips":["Always terminate sparkshell invocations with `-- <command...>`","Assert non-empty command arrays in wrapper scripts"],"tags":["cli","argument-parsing","sparkshell","usage"],"backgroundTag":"missing-cli-command","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}