{"record":{"id":"80f4a10057e7c460","repo":"can1357/oh-my-pi","slug":"unknown-security-cloud-option-token","errorCode":null,"errorMessage":"Unknown security cloud option: ${token}","messagePattern":"Unknown security cloud option: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/slash-commands/helpers/security.ts","lineNumber":255,"sourceCode":"\t\t\t\tbreak;\n\t\t\tcase \"--lookback\": {\n\t\t\t\tconst value = requireToken(tokens, ++index, token);\n\t\t\t\tif (value === \"all\") {\n\t\t\t\t\toptions.lookbackDays = value;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tconst days = Number(value);\n\t\t\t\tif (!Number.isSafeInteger(days) || days < 1) throw new Error(`Invalid lookback: ${value}`);\n\t\t\t\toptions.lookbackDays = days;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tif (!token.startsWith(\"--\") && !positionalConsumed && (subcommand === \"status\" || subcommand === \"pull\")) {\n\t\t\t\t\toptions.configurationId = token;\n\t\t\t\t\tpositionalConsumed = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tthrow new Error(`Unknown security cloud option: ${token}`);\n\t\t}\n\t}\n\treturn options;\n}\n\nfunction cloudClientFor(runtime: SlashCommandRuntime, credentialId?: number): CodexSecurityCloudClient {\n\tconst authStorage = runtime.session.modelRegistry.authStorage;\n\tconst account = selectSecurityAccount(authStorage, \"openai-codex\", credentialId, runtime.session.sessionId);\n\treturn new CodexSecurityCloudClient({ authStorage, account });\n}\n\nasync function handleCloudCommand(runtime: SlashCommandRuntime, rest: string): Promise<void> {\n\tconst { verb, rest: optionsText } = parseSubcommand(rest);\n\tconst subcommand = verb || \"scans\";\n\tconst options = parseCloudOptions(optionsText, subcommand);\n\tconst client = cloudClientFor(runtime, options.credentialId);\n\tswitch (subcommand) {\n\t\tcase \"scans\": {","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/slash-commands/helpers/security.ts#L237-L273","documentation":"Thrown by parseCloudOptions when a token passed to /security cloud is not a recognized flag and is not an allowed positional argument. Positionals (the configuration id) are only accepted for the `status` and `pull` subcommands, and only one per invocation. Everything else is rejected so typos fail fast instead of being silently ignored.","triggerScenarios":"Run `/security cloud status --config secconf_123` (no --config flag exists), `/security cloud scans secconf_123` (positional not allowed for `scans`), `/security cloud start extra-arg ...` (second positional), or any misspelled flag like `--repoid`.","commonSituations":"Guessing flag names (--config vs bare positional, --repo instead of --repo-id); supplying a configuration id to `scans` which takes no arguments; copy-pasting options from other subcommands.","solutions":["For status/pull, pass the configuration id as a bare positional: `/security cloud status secconf_123`.","Use only the supported flags: --credential, --repo-id, --repo-url, --environment, --lookback.","Run `/security cloud` with no arguments to list scans and confirm valid syntax.","Check flag spelling (hyphenated: --repo-id, --repo-url)."],"exampleFix":"// before\n/security cloud status --config secconf_abc\n// after\n/security cloud status secconf_abc","handlingStrategy":"validation","validationCode":"const ALLOWED_FLAGS = new Set([\"--credential\", \"--repo-id\", \"--repo-url\", \"--environment\", \"--lookback\"]);\nconst bad = args.filter(a => a.startsWith(\"--\") && !ALLOWED_FLAGS.has(a));\nif (bad.length) throw new Error(`Unsupported cloud flags: ${bad.join(\", \")}`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass configuration ids as bare positionals for status/pull — there is no --config flag.","Only `status` and `pull` accept a positional id; `scans` and `start` take none.","Use hyphenated flag spellings: --repo-id, --repo-url, --environment."],"tags":["cli","argument-parsing","usage"],"backgroundTag":"unknown-cli-option","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}