关于 notebooklm
notebooklm 是通过命令行操作 Google NotebookLM 的插件,面向管理笔记本、资料和生成内容的用户。它支持基于来源的问答及多种可下载成果,并提供笔记本库与来源管理。
主要功能
- 01基于来源提问并附引用
- 02生成幻灯片、音频和视频
- 03创建思维导图与学习材料
- 04生成报告、信息图和数据表
- 05管理笔记本、来源与笔记
适用场景
- 01汇总笔记本资料并追问细节
- 02将研究内容导出为多种成果
- 03管理笔记本来源和个人笔记
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ proyecto26/ notebooklm-ai-plugin --skill notebooklm安装后在 Claude Code 中输入/notebooklm确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
scripts/artifact-generator.tsauth.tschat.tsconstants.tscookie-store.tsget-cookie.tsmain.tsnotebook-manager.tsnotes-manager.tspaths.tsresearch-manager.tsrpc-client.tsrpc-types.tssource-manager.tstypes.ts详细介绍
NotebookLM AI Plugin
通过终端操作 Google NotebookLM(https://notebook.google.com)。支持
notebook.google.com 和 notebooklm.google.com 两种笔记本 URL。
支持:
- 与 Notebook AI 聊天(基于来源的问答,带引用)
- 生成幻灯片(PPTX/PDF)
- 音频概览(M4A——深度探讨、简报、评析、辩论格式)
- 视频概览(MP4——自动、经典、白板、可爱风、动漫、水彩、复古印刷、传统、纸艺风格)
- 思维导图(JSON 树)
- 闪卡 / 测验(交互式 HTML)
- 信息图(PNG——横向、纵向、正方形;11 种视觉风格)
- 报告(Markdown——简报文档、学习指南、博客文章、自定义提示词)
- 数据表格(CSV)
- 来源管理(添加 URL、YouTube、文件、粘贴的文本;列出、删除)
- 快速 / 深度网络研究并自动导入
- 笔记管理(创建、更新、删除、列出)
- 笔记本库管理(添加、列出、搜索、激活)+ 列出账户中的笔记本
所有命令均在此技能目录下运行:
cd <skill-dir> # the folder containing SKILL.md
npx -y bun scripts/main.ts <command> [options]
快速开始
# 1. Authenticate (opens Chrome for Google login; cookies are cached)
npx -y bun scripts/main.ts login
# 2. Check the session and see your notebooks (ids + source counts)
npx -y bun scripts/main.ts notebooks remote
# 3. Save one as the default
npx -y bun scripts/main.ts notebooks add https://notebook.google.com/notebook/<id> --name "My Research"
# 4. Use it
npx -y bun scripts/main.ts chat --question "What are the key findings?"
npx -y bun scripts/main.ts generate slide_deck --output slides.pdf
npx -y bun scripts/main.ts generate audio --format deep_dive --length long
npx -y bun scripts/main.ts generate quiz --difficulty medium --quantity more --output quiz.html
npx -y bun scripts/main.ts generate data_table --instructions "Compare the frameworks" --output table.csv
身份验证
login 会启动 Chrome(使用数据目录下的专用配置文件),等待你在
notebook.google.com 登录,然后捕获 Google 会话 Cookie。
Cookie 会在几周后过期;如果任何命令遇到登录重定向,系统会提示你运行
login --force。
npx -y bun scripts/main.ts login # reuse cached cookies if still valid
npx -y bun scripts/main.ts login --force # always re-open Chrome
npx -y bun scripts/main.ts notebooks remote # fast auth check: lists notebooks from your account
每次 RPC 调用都会从应用页面获取新的 CSRF 令牌(SNlM0e)和会话 ID(FdrFJe),因此无需刷新其他内容。如果源站再次更改,请设置
NOTEBOOKLM_BASE_URL(或编辑 scripts/constants.ts)。
命令
笔记本管理
npx -y bun scripts/main.ts notebooks remote # notebooks on your Google account (live)
npx -y bun scripts/main.ts notebooks list # local library
npx -y bun scripts/main.ts notebooks add <url> [--name <name>] [--description <desc>] [--topics <t1,t2>]
npx -y bun scripts/main.ts notebooks remove <id>
npx -y bun scripts/main.ts notebooks activate <id> # default for every other command
npx -y bun scripts/main.ts notebooks search <query>
与 Notebook AI 聊天
npx -y bun scripts/main.ts chat --question "What are the key findings?" --notebook <url|id>
npx -y bun scripts/main.ts chat --question "Tell me more about that" --conversation-id <id>
npx -y bun scripts/main.ts chat --question "Summarize the methodology" --json # answer + citations
聊天会使用笔记本中所有 ready 状态的来源。引用会指向来源 ID(参见 sources list)。
来源管理
npx -y bun scripts/main.ts sources list --notebook <url|id> # id, title, type, status, url
npx -y bun scripts/main.ts sources add-url https://example.com/article
npx -y bun scripts/main.ts sources add-youtube https://youtube.com/watch?v=xxx
npx -y bun scripts/main.ts sources add-text --title "My Notes" --content "Important findings..."
npx -y bun scripts/main.ts sources add-file ./paper.pdf
npx -y bun scripts/main.ts sources delete <sourceId>
新来源会在一段时间内显示 status: processing;生成和聊天只会使用状态为 ready 的来源。支持的文件:PDF、TXT、MD、DOCX、PPTX、CSV、EPUB、
图片(PNG、JPG、WEBP)、音频 / 视频。
研究
npx -y bun scripts/main.ts research fast --query "latest AI agent frameworks" # ~1–3 min
npx -y bun scripts/main.ts research deep --query "state of LLM reasoning" # ~5–10 min, produces a report
npx -y bun scripts/main.ts research fast --query "topic" --import # import found sources
npx -y bun scripts/main.ts research status
笔记
npx -y bun scripts/main.ts notes list
npx -y bun scripts/main.ts notes create --title "Key Takeaways" --content "1. Finding one..."
npx -y bun scripts/main.ts notes update <noteId> --title "Updated" --content "New content"
npx -y bun scripts/main.ts notes delete <noteId>
生成内容
npx -y bun scripts/main.ts artifacts list # everything in the Studio panel, with status
npx -y bun scripts/main.ts generate <type> [options]
类型:slide_deck、audio、video、mind_map、flashcards、quiz、infographic、report、data_table
生成任务会在 Google 端异步执行:命令会创建生成内容,并轮询 Studio 列表,直到内容完成 且 下载 URL 可用(音频 / 视频可能需要 10–20 分钟),然后下载文件。如果自动下载失败,系统会打印 URL,可在浏览器中打开。
选项
全局选项
| 选项 | 说明 |
|---|---|
--notebook <url|id> | 笔记本 URL 或库 ID(默认为当前激活的笔记本) |
--output <path> | 输出文件路径(若省略,则在数据目录下自动命名) |
--instructions <text> | 自定义生成指令 / 关注重点 |
--language <code> | 输出语言(默认 en) |
--json | 机器可读输出 |
按类型设置的选项
| 类型 | 选项 |
|---|---|
audio | --format deep_dive|brief|critique|debate、--length short|default|long |
video | --style auto|classic|whiteboard|kawaii|anime|watercolor|retro_print|heritage|paper_craft、--format explainer|brief|cinematic|short |
slide_deck | --format detailed|presenter|pdf|pptx、--length default|short(默认输出 PPTX;--format pdf 或 .pdf 输出路径会选择 PDF) |
quiz, flashcards | --difficulty easy|medium|hard、--quantity fewer|standard|more |
infographic | --orientation landscape|portrait|square、--detail concise|standard|detailed、--style auto|sketch_note|professional|bento_grid|editorial|instructional|bricks|clay|anime|kawaii|scientific |
report | --format briefing|study_guide|blog_post|custom、--prompt "<full prompt>"(自定义格式) |
mind_map | 仅支持 --instructions |
data_table | --instructions(指定要制成表格的内容) |
输出格式
| 类型 | 输出 |
|---|---|
slide_deck | PPTX(或 PDF) |
audio | M4A |
video | MP4 |
mind_map | JSON 树 { name, children: [...] } |
flashcards、quiz | 自包含交互式 HTML |
infographic | PNG |
report | Markdown |
data_table | CSV(标题行 + 数据行) |
环境变量
| 变量 | 描述 |
|---|---|
NOTEBOOKLM_BASE_URL | 应用源地址覆盖值(默认 https://notebook.google.com) |
NOTEBOOKLM_DATA_DIR | 数据目录(cookies、库、Chrome 配置文件、输出文件) |
NOTEBOOKLM_COOKIE_PATH | Cookie 文件路径 |
NOTEBOOKLM_CHROME_PATH / NOTEBOOKLM_CHROME_PROFILE_DIR | Chrome 可执行文件 / 配置文件 |
NOTEBOOKLM_OUTPUT_DIR | 默认输出目录 |
NOTEBOOKLM_BL | 聊天请求中发送的构建标签(服务器不会验证) |
速率限制(免费版)
| 资源 | 限制 |
|---|---|
| 音频/视频概览 | 每天 3 个 |
| 报告/闪卡/测验 | 每天 10 个 |
| 每日聊天 | 50 次 |
| 笔记本 | 100 个,每个 50 个来源 |
配额拒绝会以 RPCError 的 rate_limit 类型返回。
故障排除
| 症状 | 含义 / 修复方法 |
|---|---|
redirected (302) to …/login | Cookie 已过期 → login --force |
redirected … The app origin may have changed | Google 再次更改了应用 → 设置 NOTEBOOKLM_BASE_URL |
RPC xxxx not present in response … method ID may have changed | Google 更换了 RPC ID → 更新 scripts/rpc-types.ts(与 notebooklm-py 对比) |
INVALID_ARGUMENT / FAILED_PRECONDITION | 负载格式不被接受——运行 npx -y bun test,并将 scripts/*-manager.ts 与参考项目进行差异对比 |
did not return an artifact ID | 笔记本没有 ready 来源,或者该账号未启用此类制品 |
测试
cd test
npx -y bun install # dev deps only (typescript, types)
npx -y bun x tsc --noEmit # type-check
npx -y bun test unit # offline: payload shapes + decoders against recorded responses
npx -y bun test live.test.ts # live: auth + read endpoints (skips without a session)
NOTEBOOKLM_LIVE_WRITE=1 npx -y bun test live.test.ts # + add/delete a text source and a note
NOTEBOOKLM_LIVE_GENERATE=quiz npx -y bun test live.test.ts # + generate one artifact end-to-end
技能级评估(用于 skill-creator 测试框架的提示词 + 断言)位于 test/evals.json 中。