{"record":{"id":"c7563b5a5ce7f617","repo":"jackwener/OpenCLI","slug":"query-is-required-c7563b","errorCode":null,"errorMessage":"query is required","messagePattern":"query is required","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/pinterest/search-users.js","lineNumber":23,"sourceCode":"\nconst DEFAULT_LIMIT = 25;\nconst MAX_LIMIT = 100;\n\ncli({\n  site: 'pinterest',\n  name: 'search-users',\n  access: 'read',\n  description: 'Search for users on Pinterest',\n  domain: 'www.pinterest.com',\n  strategy: Strategy.COOKIE,\n  args: [\n    { name: 'query', type: 'string', positional: true, required: true, help: 'Search keyword' },\n    { name: 'limit', type: 'int', default: DEFAULT_LIMIT, help: `Number of users (max ${MAX_LIMIT})` },\n  ],\n  columns: ['username', 'fullName', 'followerCount', 'pinCount', 'url'],\n  func: async (page, kwargs) => {\n    const query = String(kwargs.query ?? '').trim();\n    if (!query) throw new ArgumentError('query is required');\n    const limit = requireLimit(kwargs.limit, { fallback: DEFAULT_LIMIT, max: MAX_LIMIT });\n\n    const sourceUrl = `/search/users/?q=${encodeURIComponent(query)}`;\n    await page.goto(`${PINTEREST_BASE}${sourceUrl}`);\n\n    const rows = await collectResults(page, {\n      resource: 'BaseSearchResource',\n      baseOptions: { query, scope: 'users' },\n      sourceUrl,\n      limit,\n      keyField: 'username',\n      pageSize: DEFAULT_PAGE_SIZE,\n      mapItem: (user) => {\n        if (!user || user.type !== 'user' || !user.username) return null;\n        return {\n          username: user.username,\n          fullName: (user.full_name || '').trim(),\n          followerCount: typeof user.follower_count === 'number' ? user.follower_count : 0,","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/pinterest/search-users.js#L5-L41","documentation":"The pinterest search-users CLI command requires a positional 'query' argument. Empty, undefined, or whitespace-only values are rejected with ArgumentError before navigating to /search/users/?q=, since a blank user search is meaningless.","triggerScenarios":"Running `pinterest search-users` with the positional keyword omitted, empty, or only spaces, making the trimmed query falsy.","commonSituations":"Interactive scripts where the user pressed Enter on an empty prompt, CI jobs with an unset input variable, or arguments lost due to unquoted shell expansion.","solutions":["Pass a non-empty keyword: pinterest search-users \" photography\"","Validate the input variable in your shell script before invoking the command","Quote arguments containing spaces so the shell passes them as one value"],"exampleFix":"// before\npinterest search-users $NAME   // NAME=\"\" or unquoted with spaces\n// after\npinterest search-users \"${NAME:?NAME is required}\"","handlingStrategy":"validation","validationCode":"[ -z \"${NAME:-}\" ] && { echo 'query is required' >&2; exit 2; }\npinterest search-users \"$NAME\"","typeGuard":"const isNonEmptyString = (v) => typeof v === 'string' && v.trim().length > 0;","tryCatchPattern":null,"preventionTips":["Use ${VAR:?msg} parameter expansion to hard-fail on unset variables","Prompt-verify interactive input is non-blank before exec","Keep required arguments out of optional flag parsing paths"],"tags":["cli","argument-validation","missing-argument"],"backgroundTag":"missing-required-argument","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}