{"record":{"id":"55b12f69e19eef6f","repo":"jackwener/OpenCLI","slug":"opencli-notebooklm-get","errorCode":null,"errorMessage":"opencli notebooklm get","messagePattern":"opencli notebooklm get","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"error","filePath":"clis/notebooklm/get.js","lineNumber":21,"sourceCode":"import { NOTEBOOKLM_DOMAIN, NOTEBOOKLM_SITE } from './shared.js';\nimport { getNotebooklmDetailViaRpc, getNotebooklmPageState, readCurrentNotebooklm, requireNotebooklmSession, } from './utils.js';\ncli({\n    site: NOTEBOOKLM_SITE,\n    name: 'get',\n    access: 'read',\n    aliases: ['metadata'],\n    description: 'Get rich metadata for the currently opened NotebookLM notebook',\n    domain: NOTEBOOKLM_DOMAIN,\n    strategy: Strategy.COOKIE,\n    browser: true,\n    navigateBefore: false,\n    args: [],\n    columns: ['id', 'title', 'emoji', 'source_count', 'created_at', 'updated_at', 'url', 'source'],\n    func: async (page) => {\n        await requireNotebooklmSession(page);\n        const state = await getNotebooklmPageState(page);\n        if (state.kind !== 'notebook') {\n            throw new EmptyResultError('opencli notebooklm get', 'No NotebookLM notebook is open in the adapter session. Run `opencli notebooklm open <notebook>` first.');\n        }\n        const rpcRow = await getNotebooklmDetailViaRpc(page).catch(() => null);\n        if (rpcRow)\n            return [rpcRow];\n        const current = await readCurrentNotebooklm(page);\n        if (!current) {\n            throw new EmptyResultError('opencli notebooklm get', 'NotebookLM notebook metadata was not found on the current page.');\n        }\n        return [{\n                ...current,\n                emoji: null,\n                source_count: null,\n                updated_at: null,\n            }];\n    },\n});\n","sourceCodeStart":3,"sourceCodeEnd":38,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/notebooklm/get.js#L3-L38","documentation":"This EmptyResultError is thrown by `opencli notebooklm get` when the session page is not on a notebook view (state.kind !== 'notebook'). The command needs an open notebook to fetch its detail row (id, title, emoji, counts, timestamps).","triggerScenarios":"Calling `opencli notebooklm get` before any notebook was opened, after navigating to the NotebookLM home/list, or when the session was restarted and page state reset.","commonSituations":"Script assumes a notebook is still open from a previous step that failed or navigated away; concurrent commands changed the shared session page.","solutions":["Run `opencli notebooklm open <notebook>` first, then `opencli notebooklm get`.","Ensure no other command navigated the shared session page between open and get.","Re-establish the adapter session if page state appears stale."],"exampleFix":"// before\nopencli notebooklm get   # no notebook open\n// after\nopencli notebooklm open \"My Notebook\"\nopencli notebooklm get","handlingStrategy":"validation","validationCode":"const state = await getNotebooklmPageState(page);\nif (state.kind !== 'notebook') {\n  await runCli(['notebooklm', 'open', notebookId]);\n}","typeGuard":"const isNotebookOpen = (state) => state?.kind === 'notebook';","tryCatchPattern":"try {\n  return await runCli(['notebooklm', 'get']);\n} catch (e) {\n  if (String(e.message).includes('No NotebookLM notebook is open')) {\n    await runCli(['notebooklm', 'open', notebookId]);\n    return await runCli(['notebooklm', 'get']);\n  }\n  throw e;\n}","preventionTips":["Call `notebooklm open` before `notebooklm get` in any workflow.","Avoid concurrent commands sharing one adapter session page.","Assert page state before querying notebook details."],"tags":["notebooklm","empty-result","session-state","cli"],"backgroundTag":"notebook-not-open-in-session","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}