{"record":{"id":"5705b4b4b5a50682","repo":"jackwener/OpenCLI","slug":"title-is-required","errorCode":null,"errorMessage":"<title> is required","messagePattern":"<title> is required","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/notebooklm/create.js","lineNumber":14,"sourceCode":"import { cli, Strategy } from '@jackwener/opencli/registry';\nimport { ArgumentError, CommandExecutionError } from '@jackwener/opencli/errors';\nimport { NOTEBOOKLM_DOMAIN, NOTEBOOKLM_SITE } from './shared.js';\nimport { callNotebooklmRpc } from './rpc.js';\nimport { buildNotebooklmNotebookUrl, ensureNotebooklmHome, requireNotebooklmExecute, requireNotebooklmSession, verifyNotebooklmNotebookExists } from './utils.js';\n\nconst NOTEBOOKLM_CREATE_PROJECT_RPC_ID = 'CCqFvf';\nconst DEFAULT_EMOJI = '📒';\nconst MAX_TITLE_LEN = 200;\nconst NOTEBOOK_UUID_RE = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i;\n\nexport function parseCreateTitle(value) {\n    const title = String(value ?? '').trim();\n    if (!title) throw new ArgumentError('<title> is required');\n    if (title.length > MAX_TITLE_LEN) {\n        throw new ArgumentError(`Title must be at most ${MAX_TITLE_LEN} characters (got ${title.length})`);\n    }\n    return title;\n}\n\nexport function parseCreateEmoji(value) {\n    const emoji = String(value ?? '').trim();\n    if (!emoji) return DEFAULT_EMOJI;\n    return emoji;\n}\n\nexport function parseCreateProjectResult(result) {\n    let current = result;\n    while (Array.isArray(current) && current.length === 1 && Array.isArray(current[0])) {\n        current = current[0];\n    }\n    const id = Array.isArray(current)","sourceCodeStart":1,"sourceCodeEnd":32,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/notebooklm/create.js#L1-L32","documentation":"parseCreateTitle validates the <title> positional argument for the notebooklm create command. An empty, whitespace-only, or missing title throws this ArgumentError. Titles are required because they are sent directly in the CreateProject RPC payload.","triggerScenarios":"Running `create` with no <title> argument, or with an empty/whitespace value like `create \"   \"`.","commonSituations":"Script variable expanding to empty ($TITLE unset); shell quoting dropping the argument; forgetting the positional arg after flags.","solutions":["Pass a non-empty title: `notebooklm create \"My Notebook\"`.","In scripts, guard the variable: [ -n \"$TITLE\" ] || exit before invoking.","Quote the title so shell word-splitting doesn't drop it."],"exampleFix":"// before\ncreate(\"\")\n// after\ncreate(\"Research Notes\")","handlingStrategy":"validation","validationCode":"const title = String(rawTitle ?? '').trim();\nif (!title) throw new Error('Title is required before calling create');","typeGuard":"function isValidTitle(v) {\n  return typeof v === 'string' && v.trim().length > 0;\n}","tryCatchPattern":"try {\n  await create(rawTitle);\n} catch (e) {\n  if (String(e.message) === '<title> is required') {\n    console.error('Usage: notebooklm create <title>');\n    process.exitCode = 2;\n    return;\n  }\n  throw e;\n}","preventionTips":["Quote positional args in shell to prevent them being dropped.","Guard script variables for non-empty values before invoking.","Default to a fallback title when input is optional in automation."],"tags":["cli","argument-validation","notebooklm"],"backgroundTag":"missing-required-argument","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}