{"record":{"id":"a1fb72a1d01647f1","repo":"jackwener/OpenCLI","slug":"boss-security-id-contains-unsupported-characters","errorCode":null,"errorMessage":"boss security-id contains unsupported characters","messagePattern":"boss security-id contains unsupported characters","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/boss/detail.js","lineNumber":179,"sourceCode":"    navigateBefore: false,\n    browser: true,\n    defaultWindowMode: 'background',\n    siteSession: 'persistent',\n    args: [\n        { name: 'security-id', positional: true, required: true, help: 'Security ID from search results (security_id field)' },\n    ],\n    columns: [\n        'name', 'salary', 'experience', 'degree',\n        'city', 'address',\n        'description', 'skills', 'welfare',\n        'boss_name', 'boss_title', 'active_time',\n        'company', 'industry', 'scale', 'stage', 'url',\n    ],\n    func: async (page, kwargs) => {\n        requirePage(page);\n        const jobId = readRequiredString(kwargs['security-id'], 'security-id');\n        if (!/^[A-Za-z0-9_-]+$/.test(jobId)) {\n            throw new ArgumentError('boss security-id contains unsupported characters', 'Pass the security_id returned by `opencli boss search`');\n        }\n        verbose('Fetching job detail from the rendered BOSS page...');\n        return [await captureJobDetail(page, jobId)];\n    },\n});\n\nexport const __test__ = { cleanText, domSnapshotToRow };\n","sourceCodeStart":161,"sourceCodeEnd":187,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/boss/detail.js#L161-L187","documentation":"`opencli boss detail` validates the `security-id` argument against /^[A-Za-z0-9_-]+$/ before building the job-detail URL https://www.zhipin.com/job_detail/<id>.html. If the value contains spaces, slashes, full-width characters, or a full job URL, the command refuses to proceed with an ArgumentError. This guards against users pasting URLs or mangled IDs that would produce an invalid request.","triggerScenarios":"Calling `opencli boss detail` with a security-id that is not a plain BOSS security_id string — e.g. pasting the whole job_detail URL, an id wrapped in quotes/spaces, a full-width character id, or using a numeric job id from another source instead of the security_id from `opencli boss search`.","commonSituations":"Copy-pasting the job URL instead of the security_id field from search output; shell quoting adding stray characters; trimming/copy errors that pick up trailing whitespace or newline; using an id from a different BOSS API surface that uses a different id format.","solutions":["Run `opencli boss search` again and copy the `security_id` field exactly as printed, not the job URL.","Strip whitespace and quotes from the value before passing it (e.g. echo -n \"$ID\" | tr -d ' \"').","If you only have a job URL, extract the segment after /job_detail/ and before .html and pass that.","Check your shell history/alias for extra flags or characters appended to the id."],"exampleFix":"// before\nopencli boss detail \"https://www.zhipin.com/job_detail/abcDEF123.html\"\n// after\nopencli boss detail abcDEF123","handlingStrategy":"validation","validationCode":"const securityId = process.argv[2];\nif (!/^[A-Za-z0-9_-]+$/.test(securityId)) {\n  throw new Error(`Invalid security-id: ${securityId}. Use the security_id from 'opencli boss search'.`);\n}","typeGuard":"function isValidSecurityId(v) {\n  return typeof v === 'string' && /^[A-Za-z0-9_-]+$/.test(v);\n}","tryCatchPattern":"try {\n  await run(['opencli', 'boss', 'detail', securityId]);\n} catch (e) {\n  if (e.message.includes('unsupported characters')) {\n    console.error('Re-run `opencli boss search` and pass its security_id field verbatim.');\n  }\n  throw e;\n}","preventionTips":["Copy the security_id field, never the job URL.","Trim and de-quote the id before passing it.","Validate with /^[A-Za-z0-9_-]+$/ in wrapper scripts.","Keep search output parsing strict so the id isn't contaminated by adjacent columns."],"tags":["argument-validation","input-validation","boss"],"backgroundTag":"invalid-argument-format","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}