{"record":{"id":"ec1f40d911fccc15","repo":"can1357/oh-my-pi","slug":"unknown-security-plan-option-token","errorCode":null,"errorMessage":"Unknown security plan option: ${token}","messagePattern":"Unknown security plan option: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/slash-commands/helpers/security.ts","lineNumber":104,"sourceCode":"\t\t\tcase \"--diff\":\n\t\t\t\tkind = \"ref_diff\";\n\t\t\t\tbaseRevision = requireToken(tokens, ++index, token);\n\t\t\t\theadRevision = requireToken(tokens, ++index, token);\n\t\t\t\tbreak;\n\t\t\tcase \"--knowledge-base\":\n\t\t\t\tknowledgeBasePaths.push(requireToken(tokens, ++index, token));\n\t\t\t\tbreak;\n\t\t\tcase \"--output\":\n\t\t\t\toutputRoot = requireToken(tokens, ++index, token);\n\t\t\t\tbreak;\n\t\t\tcase \"--archive-existing\":\n\t\t\t\tarchiveExisting = true;\n\t\t\t\tbreak;\n\t\t\tcase \"--credential\":\n\t\t\t\tcredentialId = parsePositiveCredential(requireToken(tokens, ++index, token));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unknown security plan option: ${token}`);\n\t\t}\n\t}\n\tconst common = { includePaths, excludePaths };\n\tconst target: SecurityTargetRequest =\n\t\tkind === \"ref_diff\"\n\t\t\t? {\n\t\t\t\t\tkind,\n\t\t\t\t\tbaseRevision: baseRevision ?? \"\",\n\t\t\t\t\theadRevision: headRevision ?? \"\",\n\t\t\t\t\t...common,\n\t\t\t\t}\n\t\t\t: kind === \"working_tree\"\n\t\t\t\t? { kind, ...common }\n\t\t\t\t: kind === \"scoped_path\"\n\t\t\t\t\t? { kind, ...common }\n\t\t\t\t\t: { kind: \"repository\", ...common };\n\treturn { target, knowledgeBasePaths, outputRoot, archiveExisting, credentialId };\n}","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/slash-commands/helpers/security.ts#L86-L122","documentation":"parsePlanOptions walks slash-command tokens against a fixed switch of known plan flags (`--include`, `--exclude`, `--credential`, etc.). Any token not matched by a case reaches the default branch and throws this error, naming the offending token.","triggerScenarios":"Typing an unsupported flag such as `--path`, `--out`, a misspelling like `--credntial`, or a subcommand word in the wrong position of `/security plan ...`.","commonSituations":"Typos in flag names; copying flags from another subcommand (e.g. export-only flags); shell aliasing inserting extra words.","solutions":["Use only supported plan flags (see the switch: --include, --exclude, --credential, etc.).","Check the spelling of the flagged token in the error message.","Move flags that belong to export/results to the export subcommand instead of plan.","Run the command's help to list valid options."],"exampleFix":"// before\n/security plan --paths src/\n// after\n/security plan --include src/","handlingStrategy":"try-catch","validationCode":"const KNOWN = [\"--include\", \"--exclude\", \"--credential\"];\nconst bad = tokens.filter(t => t.startsWith(\"--\") && !KNOWN.includes(t));\nif (bad.length) throw new Error(`Unknown security plan option: ${bad[0]}`);","typeGuard":"null","tryCatchPattern":"try {\n  options = parsePlanOptions(rest);\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith(\"Unknown security plan option\")) {\n    printPlanUsage(err.message);\n    return;\n  }\n  throw err;\n}","preventionTips":["Check help output for the exact flag set of the plan subcommand.","Avoid reusing flags from other security subcommands.","Double-check spelling of hyphenated flags."],"tags":["cli","argument-parsing","usage"],"backgroundTag":"unknown-option-flag","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}