{"record":{"id":"1c85fa82fc81a549","repo":"Yeachan-Heo/oh-my-codex","slug":"shell-does-not-accept-additional-arguments-sp","errorCode":null,"errorMessage":"--shell does not accept additional arguments.\n${SPARKSHELL_USAGE}","messagePattern":"--shell does not accept additional arguments\\.\n(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/sparkshell.ts","lineNumber":309,"sourceCode":"    }\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] };\n  }\n\n  let paneId: string | undefined;\n  let tailLines = 200;\n  let sawTailLines = false;\n","sourceCodeStart":291,"sourceCodeEnd":327,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/sparkshell.ts#L291-L327","documentation":"`--shell <script>` was given but additional arguments followed; the shell form accepts exactly one command string and no extra positional args. Usage text is appended.","triggerScenarios":"`omx sparkshell --shell \"echo hi\" extra-arg` — args.length !== 2 after stripping wrapper options.","commonSituations":"User mixes the one-shot --shell form with positional command args intended for the default form; leftover flags after the script string.","solutions":["Remove the extra arguments, keeping only `--shell <script>`","If you meant to run a bare command with args, drop `--shell` and pass them positionally: `omx sparkshell -- npm test --watch`","Quote the whole script so args meant for the inner shell travel inside the string"],"exampleFix":"# before\nomx sparkshell --shell \"npm test\" --watch\n# after\nomx sparkshell --shell \"npm test --watch\"","handlingStrategy":"validation","validationCode":"const i = args.indexOf('--shell');\nconst ok = i === -1 || args.length === i + 2; // script must be the last token","typeGuard":null,"tryCatchPattern":"catch (e) { if (String(e).startsWith('--shell does not accept')) { printUsage(); } else throw e; }","preventionTips":["Put all inner-command args inside the quoted script string","Don't append flags after the --shell script token"],"tags":["cli","sparkshell","shell","usage"],"backgroundTag":"unexpected-cli-arguments","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}