{"record":{"id":"aaec57fc11a50197","repo":"jackwener/OpenCLI","slug":"opencli-notebooklm-notes-get","errorCode":null,"errorMessage":"opencli notebooklm notes-get","messagePattern":"opencli notebooklm notes-get","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"error","filePath":"clis/notebooklm/notes-get.js","lineNumber":34,"sourceCode":"    description: 'Get one note from the current NotebookLM notebook by title from the visible note editor',\n    domain: NOTEBOOKLM_DOMAIN,\n    strategy: Strategy.COOKIE,\n    browser: true,\n    navigateBefore: false,\n    args: [\n        {\n            name: 'note',\n            positional: true,\n            required: true,\n            help: 'Note title or id from the current notebook',\n        },\n    ],\n    columns: ['title', 'content', 'source', 'url'],\n    func: async (page, kwargs) => {\n        await requireNotebooklmSession(page);\n        const state = await getNotebooklmPageState(page);\n        if (state.kind !== 'notebook') {\n            throw new EmptyResultError('opencli notebooklm notes-get', 'No NotebookLM notebook is open in the adapter session. Run `opencli notebooklm open <notebook>` first.');\n        }\n        const query = typeof kwargs.note === 'string' ? kwargs.note : String(kwargs.note ?? '');\n        const visible = await readNotebooklmVisibleNoteFromPage(page);\n        if (visible && matchesNoteTitle(visible.title, query))\n            return [visible];\n        const rows = await listNotebooklmNotesFromPage(page);\n        const listed = findNotebooklmNoteRow(rows, query);\n        if (listed) {\n            throw new EmptyResultError('opencli notebooklm notes-get', `Note \"${query}\" is listed in Studio, but opencli currently reads note content only from the visible note editor. Open that note in NotebookLM, then retry.`);\n        }\n        throw new EmptyResultError('opencli notebooklm notes-get', `Note \"${query}\" was not found in the current notebook.`);\n    },\n});\n","sourceCodeStart":16,"sourceCodeEnd":48,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/notebooklm/notes-get.js#L16-L48","documentation":"`opencli notebooklm notes-get <note>` throws this EmptyResultError when the session is not on a notebook page. Like note-list, reading note content requires an open notebook context; the guard on getNotebooklmPageState fires before any note lookup.","triggerScenarios":"Calling `notes-get` with a note title when getNotebooklmPageState(page).kind !== 'notebook' — no prior `open`, or the page navigated/redirected away from the notebook.","commonSituations":"Forgetting to run `open` in a fresh session; a failed or wrong-id `open` leaving the page on the home surface; cookie expiry redirect; running notes-get against a notebook URL that was never opened in this adapter session.","solutions":["Run `opencli notebooklm open <notebook-id-or-url>` first, then `opencli notebooklm notes-get <note-title>`.","Confirm the id with `opencli notebooklm list -f json` if `open` keeps failing.","Re-authenticate the browser session if redirects persist.","Avoid navigating the shared page between `open` and `notes-get`."],"exampleFix":"// before\nopencli notebooklm notes-get \"Summary\"\n// after\nopencli notebooklm open <notebook-id>\nopencli notebooklm notes-get \"Summary\"","handlingStrategy":"validation","validationCode":"const opened = await run('opencli notebooklm get -f json').catch(() => null);\nif (!opened) throw new Error('Open a notebook before notes-get');","typeGuard":"function canQueryNotes(state) {\n  return !!state && Array.isArray(state) && state.length > 0 && !!state[0].id;\n}","tryCatchPattern":"try {\n  note = await run(`opencli notebooklm notes-get \"${title}\" -f json`);\n} catch (e) {\n  if (String(e.message).includes('No NotebookLM notebook is open')) {\n    await run('opencli notebooklm open <notebook-id>');\n    note = await run(`opencli notebooklm notes-get \"${title}\" -f json`);\n  } else throw e;\n}","preventionTips":["Always sequence: list -> open -> notes-get.","Quote note titles to avoid shell splitting.","Re-run `open` whenever the page may have navigated away.","Validate note titles against note-list output before querying."],"tags":["notebooklm","session-state","empty-result"],"backgroundTag":"empty-result-error","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}