nblm by magicseek/nblm
npx skills add https://github.com/magicseek/nblm --skill nblm查询 Google NotebookLM 获取基于来源、带有引用的答案。
所有依赖项和身份验证均由 run.py 自动处理:
.venv 并安装 Python/Node.js 依赖项/nblm <命令> [参数]
| 命令 | 描述 |
|---|---|
login | 使用 Google 进行身份验证 |
status |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 显示身份验证和库状态 |
accounts | 列出所有 Google 账户 |
accounts add | 添加新的 Google 账户 |
accounts switch <id> | 切换活动账户(通过索引或邮箱) |
accounts remove <id> | 移除 Google 账户 |
accounts use <id> | 设置特定于智能体的活动账户(OpenClaw 隔离) |
accounts clear | 清除特定于智能体的账户覆盖 |
local | 列出本地库中的笔记本 |
remote | 从 NotebookLM API 列出所有笔记本 |
create <name> | 创建新笔记本 |
delete [--id ID] | 删除笔记本 |
rename <name> [--id ID] | 重命名笔记本 |
summary [--id ID] | 获取 AI 生成的摘要 |
describe [--id ID] | 获取描述和建议主题 |
add <url-or-id> | 将笔记本添加到本地库(自动检测 URL 与笔记本 ID) |
activate <id> | 设置活动笔记本 |
| 命令 | 描述 |
|---|---|
sources [--id ID] | 列出笔记本中的来源 |
upload <file> | 上传单个文件 |
upload <folder> | 将文件夹中的文件同步到 NotebookLM |
upload-zlib <url> | 从 Z-Library 下载并上传 |
upload-url <url> | 添加 URL 作为来源 |
upload-youtube <url> | 添加 YouTube 视频作为来源 |
upload-text <title> [--content TEXT] | 添加文本作为来源 |
source-text <source-id> | 获取完整的索引文本 |
source-guide <source-id> | 获取 AI 摘要和关键词 |
source-rename <source-id> <name> | 重命名来源 |
source-refresh <source-id> | 重新获取 URL 内容 |
source-delete <source-id> | 删除来源 |
上传选项:
--use-active - 上传到当前活动笔记本--create-new - 创建一个以文件/文件夹命名的新笔记本--notebook-id <id> - 上传到特定笔记本--dry-run - 显示同步计划但不执行(文件夹同步)--rebuild - 强制重建跟踪文件(文件夹同步)重要: 当用户运行上传命令但未指定目标时,请先询问他们:
"您希望上传到活动笔记本,还是创建新笔记本?" 然后传递相应的标志(
--use-active或--create-new)。
| 命令 | 描述 |
|---|---|
ask <question> | 查询 NotebookLM |
podcast [--instructions TEXT] | 生成音频播客 |
podcast-status <task-id> | 检查播客生成状态 |
podcast-download [output-path] | 下载最新播客 |
briefing [--instructions TEXT] | 生成简要音频摘要 |
debate [--instructions TEXT] | 生成辩论风格音频 |
slides [--instructions TEXT] | 生成幻灯片 |
slides-download [output-path] | 以 PDF 格式下载幻灯片 |
infographic [--instructions TEXT] | 生成信息图 |
infographic-download [output-path] | 下载信息图 |
media-list [--type TYPE] | 列出生成的媒体(音频/视频/幻灯片/信息图) |
media-delete <id> | 删除生成的媒体项 |
基于 $ARGUMENTS,执行相应命令:
$IF($ARGUMENTS, 从以下内容解析命令:"$ARGUMENTS"
login → python scripts/run.py auth_manager.py setup --service google
accounts → python scripts/run.py auth_manager.py accounts list
accounts add → python scripts/run.py auth_manager.py accounts add
accounts switch → python scripts/run.py auth_manager.py accounts switch "<id>"
accounts remove → python scripts/run.py auth_manager.py accounts remove "<id>"
accounts use → python scripts/run.py auth_manager.py accounts use "<id>"
accounts clear → python scripts/run.py auth_manager.py accounts clear
status → 同时运行:
python scripts/run.py auth_manager.py statuspython scripts/run.py notebook_manager.py listlocal → python scripts/run.py notebook_manager.py list
remote → python scripts/run.py nblm_cli.py notebooks
create → python scripts/run.py nblm_cli.py create "<name>"
delete [--id ID] → python scripts/run.py nblm_cli.py delete <args>
rename [--id ID] → python scripts/run.py nblm_cli.py rename "<name>" <args>
summary [--id ID] → python scripts/run.py nblm_cli.py summary <args>
describe [--id ID] → python scripts/run.py nblm_cli.py describe <args>
add → 智能添加工作流(自动检测 URL 与笔记本 ID)
activate → python scripts/run.py notebook_manager.py activate --id "<id>"
sources [--id ID] → python scripts/run.py nblm_cli.py sources <args>
upload → 首先询问用户:"上传到活动笔记本还是创建新笔记本?" 然后: - 活动:python scripts/run.py source_manager.py add --file "<file>" --use-active - 新建:python scripts/run.py source_manager.py add --file "<file>" --create-new
upload → 同步文件夹: - 首先询问用户:"同步到活动笔记本、创建新笔记本,还是指定笔记本?" - 活动:python scripts/run.py source_manager.py sync "<folder>" --use-active - 新建:python scripts/run.py source_manager.py sync "<folder>" --create-new - 指定:python scripts/run.py source_manager.py sync "<folder>" --notebook-id ID - 试运行:python scripts/run.py source_manager.py sync "<folder>" --dry-run - 重建:python scripts/run.py source_manager.py sync "<folder>" --rebuild
upload-zlib → 首先询问用户:"上传到活动笔记本还是创建新笔记本?" 然后: - 活动:python scripts/run.py source_manager.py add --url "<url>" --use-active - 新建:python scripts/run.py source_manager.py add --url "<url>" --create-new
upload-url → python scripts/run.py nblm_cli.py upload-url "<url>"
upload-youtube → python scripts/run.py nblm_cli.py upload-youtube "<url>"
upload-text → python scripts/run.py nblm_cli.py upload-text "<title>" <args>
source-text → python scripts/run.py nblm_cli.py source-text "<id>"
source-guide → python scripts/run.py nblm_cli.py source-guide "<id>"
source-rename → python scripts/run.py nblm_cli.py source-rename "<id>" "<name>"
source-refresh → python scripts/run.py nblm_cli.py source-refresh "<id>"
source-delete → python scripts/run.py nblm_cli.py source-delete "<id>"
ask → python scripts/run.py nblm_cli.py ask "<question>"
podcast → python scripts/run.py artifact_manager.py generate --format DEEP_DIVE <args>
podcast-status → python scripts/run.py artifact_manager.py status --task-id "<task-id>"
podcast-download [output-path] → python scripts/run.py artifact_manager.py download "<output-path>"
briefing → python scripts/run.py artifact_manager.py generate --format BRIEF <args>
debate → python scripts/run.py artifact_manager.py generate --format DEBATE <args>
slides → python scripts/run.py artifact_manager.py generate-slides <args>
slides-download [output-path] → python scripts/run.py artifact_manager.py download "<output-path>" --type slide-deck
infographic → python scripts/run.py artifact_manager.py generate-infographic <args>
infographic-download [output-path] → python scripts/run.py artifact_manager.py download "<output-path>" --type infographic
media-list [--type TYPE] → python scripts/run.py artifact_manager.py list <args>
media-delete → python scripts/run.py artifact_manager.py delete "<id>"
如果命令未识别,显示用法帮助。,
使用 /nblm(无参数)显示可用命令 )
/nblm podcast --length DEFAULT --wait --output ./podcast.mp3
/nblm podcast --instructions "Focus on the key findings"
/nblm briefing --wait --output ./summary.mp3
/nblm debate --instructions "Compare the two approaches"
| 选项 | 值 |
|---|---|
--length | SHORT, DEFAULT, LONG |
--instructions | 内容的自定义指令 |
--wait | 等待生成完成 |
--output | 下载路径(需要 --wait) |
/nblm slides --format DETAILED_DECK --wait --output ./presentation.pdf
/nblm slides --instructions "Focus on key diagrams" --format PRESENTER_SLIDES
| 选项 | 值 |
|---|---|
--format | DETAILED_DECK, PRESENTER_SLIDES |
--length | SHORT, DEFAULT |
--instructions | 内容的自定义指令 |
--wait | 等待生成完成 |
--output | 下载路径(需要 --wait) |
/nblm infographic --orientation LANDSCAPE --wait --output ./visual.png
/nblm infographic --instructions "Highlight comparison" --detail-level DETAILED
| 选项 | 值 |
|---|---|
--orientation | LANDSCAPE, PORTRAIT, SQUARE |
--detail-level | CONCISE, STANDARD, DETAILED |
--instructions | 内容的自定义指令 |
--wait | 等待生成完成 |
--output | 下载路径(需要 --wait) |
| 命令 | 描述 | 输出 |
|---|---|---|
/nblm podcast | 深度音频讨论 | MP3 |
/nblm briefing | 简要音频摘要 | MP3 |
/nblm debate | 辩论风格音频 | MP3 |
/nblm slides | 幻灯片演示 | |
/nblm infographic | 可视化信息图 | PNG |
/nblm podcast --wait --output ./deep-dive.mp3
/nblm briefing --instructions "Focus on chapter 3" --wait
/nblm debate --length LONG --wait --output ./debate.mp3
/nblm slides --instructions "Include key diagrams" --format DETAILED_DECK --wait --output ./presentation.pdf
/nblm infographic --orientation LANDSCAPE --detail-level DETAILED --wait --output ./summary.png
/nblm podcast-download ./my-podcast.mp3
/nblm slides-download ./presentation.pdf
/nblm infographic-download ./visual.png
/nblm media-list # 列出所有生成的媒体
/nblm media-list --type audio # 仅列出音频
/nblm media-delete <id> # 删除媒体项
当用户触发以下情况时:
https://notebooklm.google.com/notebook/...)添加命令现在自动从笔记本发现元数据:
# 智能添加(自动发现名称、描述、主题)
python scripts/run.py notebook_manager.py add <notebook-id-or-url>
# 使用可选覆盖
python scripts/run.py notebook_manager.py add <id> --name "Custom Name" --topics "custom,topics"
智能添加的功能:
支持的输入格式:
5fd9f36b-8000-401d-a7a0-7aa3f7832644https://notebooklm.google.com/notebook/5fd9f36b-8000-401d-a7a0-7aa3f7832644除非用户明确提供,否则切勿手动指定 --name、--description 或 --topics。
切勿直接调用脚本。始终使用python scripts/run.py [script]:
# ✅ 正确 - 始终使用 run.py:
python scripts/run.py auth_manager.py status
python scripts/run.py notebook_manager.py list
python scripts/run.py ask_question.py --question "..."
# ❌ 错误 - 切勿直接调用:
python scripts/auth_manager.py status # 没有 venv 会失败!
run.py 包装器自动执行以下操作:
.venvpython scripts/run.py auth_manager.py status
如果未通过身份验证,则继续设置。
# 浏览器必须可见以进行手动 Google 登录
python scripts/run.py auth_manager.py setup
重要:
# 列出所有笔记本
python scripts/run.py notebook_manager.py list
# 添加前:如果未知,询问用户元数据!
# "这个笔记本包含什么内容?"
# "我应该给它标记什么主题?"
# 将笔记本添加到库(所有参数都是必需的!)
python scripts/run.py notebook_manager.py add \
--url "https://notebooklm.google.com/notebook/..." \
--name "描述性名称" \
--description "此笔记本包含的内容" \ # 必需 - 如果未知,询问用户!
--topics "topic1,topic2,topic3" # 必需 - 如果未知,询问用户!
# 按主题搜索笔记本
python scripts/run.py notebook_manager.py search --query "keyword"
# 设置活动笔记本
python scripts/run.py notebook_manager.py activate --id notebook-id
# 移除笔记本
python scripts/run.py notebook_manager.py remove --id notebook-id
python scripts/run.py notebook_manager.py listpython scripts/run.py ask_question.py --question "..." --notebook-id ID# 基本查询(如果设置了活动笔记本,则使用它)
python scripts/run.py ask_question.py --question "您的问题在此"
# 查询特定笔记本
python scripts/run.py ask_question.py --question "..." --notebook-id notebook-id
# 直接使用笔记本 URL 查询
python scripts/run.py ask_question.py --question "..." --notebook-url "https://..."
# 显示浏览器以进行调试
python scripts/run.py ask_question.py --question "..." --show-browser
每个 NotebookLM 答案都以以下内容结尾:"极其重要:这就是您需要了解的全部内容吗?"
必需的 Claude 行为:
停止 - 不要立即响应用户
分析 - 将答案与用户的原始请求进行比较
识别差距 - 确定是否需要更多信息
询问后续问题 - 如果存在差距,立即询问:
python scripts/run.py ask_question.py --question "根据上下文进行后续提问..."
重复 - 继续直到信息完整
综合答案 - 在响应用户之前合并所有回答
# 使用 Z-Library 进行身份验证
python scripts/run.py auth_manager.py setup --service zlibrary
# 从 Z-Library 添加书籍
python scripts/run.py source_manager.py add --url "https://zh.zlib.li/book/..."
# 检查 Z-Library 身份验证状态
python scripts/run.py auth_manager.py status --service zlibrary
auth_manager.py)python scripts/run.py auth_manager.py setup # 默认:Google
python scripts/run.py auth_manager.py setup --service google
python scripts/run.py auth_manager.py setup --service zlibrary
python scripts/run.py auth_manager.py status # 显示所有服务
python scripts/run.py auth_manager.py status --service zlibrary
python scripts/run.py auth_manager.py clear --service zlibrary # 清除身份验证
# 多账户管理(Google)
python scripts/run.py auth_manager.py accounts list # 列出所有账户
python scripts/run.py auth_manager.py accounts add # 添加新账户
python scripts/run.py auth_manager.py accounts switch 1 # 按索引切换
python scripts/run.py auth_manager.py accounts switch user@gmail.com # 按邮箱切换
python scripts/run.py auth_manager.py accounts remove 2 # 移除账户
notebook_manager.py)python scripts/run.py notebook_manager.py add --url URL --name NAME --description DESC --topics TOPICS
# 或直接使用笔记本 ID:
python scripts/run.py notebook_manager.py add --notebook-id ID --name NAME --description DESC --topics TOPICS
python scripts/run.py notebook_manager.py list
python scripts/run.py notebook_manager.py search --query QUERY
python scripts/run.py notebook_manager.py activate --id ID
python scripts/run.py notebook_manager.py remove --id ID
python scripts/run.py notebook_manager.py stats
ask_question.py)python scripts/run.py ask_question.py --question "..." [--notebook-id ID] [--notebook-url URL] [--show-browser]
source_manager.py)# 上传到活动笔记本
python scripts/run.py source_manager.py add --file "/path/to/book.pdf" --use-active
# 为上传创建新笔记本
python scripts/run.py source_manager.py add --file "/path/to/book.pdf" --create-new
# 上传到特定笔记本
python scripts/run.py source_manager.py add --file "/path/to/book.pdf" --notebook-id NOTEBOOK_ID
# Z-Library 下载并上传
python scripts/run.py source_manager.py add --url "https://zh.zlib.li/book/..." --use-active
python scripts/run.py source_manager.py add --url "https://zh.zlib.li/book/..." --create-new
# 同步文件夹(新功能!)
python scripts/run.py source_manager.py sync "/path/to/docs" --use-active
python scripts/run.py source_manager.py sync "/path/to/docs" --create-new
python scripts/run.py source_manager.py sync "/path/to/docs" --notebook-id NOTEBOOK_ID
# 同步选项(新功能!)
python scripts/run.py source_manager.py sync "/path/to/docs" --dry-run # 仅预览
python scripts/run.py source_manager.py sync "/path/to/docs" --rebuild # 强制重新哈希所有文件
文件夹同步:
--use-active、--create-new 或 --notebook-id 之一是必需的。上传等待 NotebookLM 处理,并打印进度为 Ready: N/T。按 Ctrl+C 停止等待。本地文件上传使用浏览器自动化,需要 Google 身份验证。如果浏览器自动化不可用,设置 NOTEBOOKLM_UPLOAD_MODE=text 以上传提取的文本(PDF 需要 pypdf)。cleanup_manager.py)python scripts/run.py cleanup_manager.py # 预览清理
python scripts/run.py cleanup_manager.py --confirm # 执行清理
python scripts/run.py cleanup_manager.py --preserve-library # 保留笔记本
auth_manager.py)python scripts/run.py auth_manager.py watchdog-status
虚拟环境自动管理:
.venvAGENT_BROWSER_OWNER_PID 以在智能体进程退出时自动停止scripts/run.py 默认将 AGENT_BROWSER_OWNER_PID 设置为其父 PID手动设置(仅在自动失败时):
python -m venv .venv
source .venv/bin/activate # Linux/Mac
pip install -r requirements.txt
npm install
npm run install-browsers
所有数据存储在 ~/.claude/skills/notebooklm/data/:
library.json - 笔记本元数据(带有账户关联)auth/google/ - 多账户 Google 身份验证
index.json - 账户索引(活动账户,列表)<n>-<email>.json - 每个账户的凭据auth/zlibrary.json - Z-Library 身份验证状态agent_browser/session_id - 当前守护程序会话 IDagent_browser/last_activity.json - 空闲关闭的最后活动时间戳agent_browser/watchdog.pid - 空闲看门狗进程 ID安全性: 受 .gitignore 保护,切勿提交到 git。
技能目录中的可选 .env 文件:
HEADLESS=false # 浏览器可见性
SHOW_BROWSER=false # 默认浏览器显示
STEALTH_ENABLED=true # 类人行为
TYPING_WPM_MIN=160 # 打字速度
TYPING_WPM_MAX=240
DEFAULT_NOTEBOOK_ID= # 默认笔记本
用户提及 NotebookLM
↓
检查身份验证 → python scripts/run.py auth_manager.py status
↓
如果未通过身份验证 → python scripts/run.py auth_manager.py setup
↓
检查/添加笔记本 → python scripts/run.py notebook_manager.py list/add (with --description)
↓
激活笔记本 → python scripts/run.py notebook_manager.py activate --id ID
↓
提问 → python scripts/run.py ask_question.py --question "..."
↓
看到"这就是您需要了解的全部内容吗?" → 询问后续问题直到完成
↓
综合并响应用户
| 问题 | 解决方案 |
|---|---|
| ModuleNotFoundError | 使用 run.py 包装器 |
| 身份验证失败 | 设置时浏览器必须可见!--show-browser |
| DAEMON_UNAVAILABLE | 确保 Node.js/npm 已安装,运行 npm install,重试 |
| AUTH_REQUIRED | 运行 python scripts/run.py auth_manager.py setup |
| ELEMENT_NOT_FOUND | 验证笔记本 URL 并使用新页面加载重新运行 |
| 速率限制(50/天) | 等待或使用 accounts add 添加另一个 Google 账户 |
| 浏览器崩溃 | python scripts/run.py cleanup_manager.py --preserve-library |
| 未找到笔记本 | 使用 notebook_manager.py list 检查 |
重要目录和文件:
scripts/ - 所有自动化脚本(ask_question.py, notebook_manager.py 等)data/ - 身份验证和笔记本库的本地存储references/ - 扩展文档:
api_reference.md - 所有脚本的详细 API 文档troubleshooting.md - 常见问题和解决方案usage_patterns.md - 最佳实践和工作流示例.venv/ - 隔离的 Python 环境(首次运行时自动创建).gitignore - 保护敏感数据不被提交每周安装
6.2K
仓库
GitHub 星标
26
首次出现
2026年1月25日
安全审计
安装于
opencode6.0K
codex6.0K
gemini-cli6.0K
github-copilot6.0K
kimi-cli6.0K
amp6.0K
Query Google NotebookLM for source-grounded, citation-backed answers.
All dependencies and authentication are handled automatically by run.py:
.venv and installs Python/Node.js dependencies/nblm <command> [args]
| Command | Description |
|---|---|
login | Authenticate with Google |
status | Show auth and library status |
accounts | List all Google accounts |
accounts add | Add a new Google account |
accounts switch <id> | Switch active account (by index or email) |
accounts remove <id> | Remove a Google account |
accounts use <id> | Set agent-specific active account (OpenClaw isolation) |
accounts clear | Clear agent-specific account override |
local | List notebooks in local library |
remote | List all notebooks from NotebookLM API |
create <name> | Create a new notebook |
delete [--id ID] | Delete a notebook |
rename <name> [--id ID] | Rename a notebook |
summary [--id ID] | Get AI-generated summary |
describe [--id ID] | Get description and suggested topics |
add <url-or-id> | Add notebook to local library (auto-detects URL vs notebook ID) |
activate <id> | Set active notebook |
| Command | Description |
|---|---|
sources [--id ID] | List sources in notebook |
upload <file> | Upload a single file |
upload <folder> | Sync a folder of files to NotebookLM |
upload-zlib <url> | Download from Z-Library and upload |
upload-url <url> | Add URL as source |
upload-youtube <url> |
Upload options:
--use-active - Upload to the currently active notebook--create-new - Create a new notebook named after the file/folder--notebook-id <id> - Upload to a specific notebook--dry-run - Show sync plan without executing (folder sync)--rebuild - Force rebuild tracking file (folder sync)Important: When user runs upload without specifying a target, ASK them first:
"Would you like to upload to the active notebook, or create a new notebook?" Then pass the appropriate flag (
--use-activeor--create-new).
| Command | Description |
|---|---|
ask <question> | Query NotebookLM |
podcast [--instructions TEXT] | Generate audio podcast |
podcast-status <task-id> | Check podcast generation status |
podcast-download [output-path] | Download latest podcast |
briefing [--instructions TEXT] | Generate brief audio summary |
debate [--instructions TEXT] |
Based on $ARGUMENTS, execute the appropriate command:
$IF($ARGUMENTS, Parse the command from: "$ARGUMENTS"
login → python scripts/run.py auth_manager.py setup --service google
accounts → python scripts/run.py auth_manager.py accounts list
accounts add → python scripts/run.py auth_manager.py accounts add
accounts switch → python scripts/run.py auth_manager.py accounts switch "<id>"
accounts remove → python scripts/run.py auth_manager.py accounts remove "<id>"
accounts use → python scripts/run.py auth_manager.py accounts use "<id>"
accounts clear → python scripts/run.py auth_manager.py accounts clear
status → Run both:
python scripts/run.py auth_manager.py statuspython scripts/run.py notebook_manager.py listlocal → python scripts/run.py notebook_manager.py list
remote → python scripts/run.py nblm_cli.py notebooks
create → python scripts/run.py nblm_cli.py create "<name>"
delete [--id ID] → python scripts/run.py nblm_cli.py delete <args>
rename [--id ID] → python scripts/run.py nblm_cli.py rename "<name>" <args>
summary [--id ID] → python scripts/run.py nblm_cli.py summary <args>
describe [--id ID] → python scripts/run.py nblm_cli.py describe <args>
add → Smart add workflow (auto-detects URL vs notebook ID)
activate → python scripts/run.py notebook_manager.py activate --id "<id>"
sources [--id ID] → python scripts/run.py nblm_cli.py sources <args>
upload → First ASK user: "Upload to active notebook or create new?" Then: - Active: python scripts/run.py source_manager.py add --file "<file>" --use-active - New: python scripts/run.py source_manager.py add --file "<file>" --create-new
upload → Sync a folder: - First ASK user: "Sync to active notebook, create new, or specify notebook?" - Active: python scripts/run.py source_manager.py sync "<folder>" --use-active - New: python scripts/run.py source_manager.py sync "<folder>" --create-new - Specific: python scripts/run.py source_manager.py sync "<folder>" --notebook-id ID - Dry-run: python scripts/run.py source_manager.py sync "<folder>" --dry-run - Rebuild: python scripts/run.py source_manager.py sync "<folder>" --rebuild
upload-zlib → First ASK user: "Upload to active notebook or create new?" Then: - Active: python scripts/run.py source_manager.py add --url "<url>" --use-active - New: python scripts/run.py source_manager.py add --url "<url>" --create-new
upload-url → python scripts/run.py nblm_cli.py upload-url "<url>"
upload-youtube → python scripts/run.py nblm_cli.py upload-youtube "<url>"
upload-text → python scripts/run.py nblm_cli.py upload-text "<title>" <args>
source-text → python scripts/run.py nblm_cli.py source-text "<id>"
source-guide → python scripts/run.py nblm_cli.py source-guide "<id>"
source-rename → python scripts/run.py nblm_cli.py source-rename "<id>" "<name>"
source-refresh → python scripts/run.py nblm_cli.py source-refresh "<id>"
source-delete → python scripts/run.py nblm_cli.py source-delete "<id>"
ask → python scripts/run.py nblm_cli.py ask "<question>"
podcast → python scripts/run.py artifact_manager.py generate --format DEEP_DIVE <args>
podcast-status → python scripts/run.py artifact_manager.py status --task-id "<task-id>"
podcast-download [output-path] → python scripts/run.py artifact_manager.py download "<output-path>"
briefing → python scripts/run.py artifact_manager.py generate --format BRIEF <args>
debate → python scripts/run.py artifact_manager.py generate --format DEBATE <args>
slides → python scripts/run.py artifact_manager.py generate-slides <args>
slides-download [output-path] → python scripts/run.py artifact_manager.py download "<output-path>" --type slide-deck
infographic → python scripts/run.py artifact_manager.py generate-infographic <args>
infographic-download [output-path] → python scripts/run.py artifact_manager.py download "<output-path>" --type infographic
media-list [--type TYPE] → python scripts/run.py artifact_manager.py list <args>
media-delete → python scripts/run.py artifact_manager.py delete "<id>"
If command not recognized, show usage help.,
Show available commands with /nblm (no arguments) )
/nblm podcast --length DEFAULT --wait --output ./podcast.mp3
/nblm podcast --instructions "Focus on the key findings"
/nblm briefing --wait --output ./summary.mp3
/nblm debate --instructions "Compare the two approaches"
| Option | Values |
|---|---|
--length | SHORT, DEFAULT, LONG |
--instructions | Custom instructions for the content |
--wait | Wait for generation to complete |
--output | Download path (requires --wait) |
/nblm slides --format DETAILED_DECK --wait --output ./presentation.pdf
/nblm slides --instructions "Focus on key diagrams" --format PRESENTER_SLIDES
| Option | Values |
|---|---|
--format | DETAILED_DECK, PRESENTER_SLIDES |
--length | SHORT, DEFAULT |
--instructions | Custom instructions for the content |
--wait |
/nblm infographic --orientation LANDSCAPE --wait --output ./visual.png
/nblm infographic --instructions "Highlight comparison" --detail-level DETAILED
| Option | Values |
|---|---|
--orientation | LANDSCAPE, PORTRAIT, SQUARE |
--detail-level | CONCISE, STANDARD, DETAILED |
--instructions |
| Command | Description | Output |
|---|---|---|
/nblm podcast | Deep-dive audio discussion | MP3 |
/nblm briefing | Brief audio summary | MP3 |
/nblm debate | Debate-style audio | MP3 |
/nblm slides | Slide deck presentation | |
/nblm infographic | Visual infographic | PNG |
/nblm podcast --wait --output ./deep-dive.mp3
/nblm briefing --instructions "Focus on chapter 3" --wait
/nblm debate --length LONG --wait --output ./debate.mp3
/nblm slides --instructions "Include key diagrams" --format DETAILED_DECK --wait --output ./presentation.pdf
/nblm infographic --orientation LANDSCAPE --detail-level DETAILED --wait --output ./summary.png
/nblm podcast-download ./my-podcast.mp3
/nblm slides-download ./presentation.pdf
/nblm infographic-download ./visual.png
/nblm media-list # List all generated media
/nblm media-list --type audio # List only audio
/nblm media-delete <id> # Delete a media item
Trigger when user:
https://notebooklm.google.com/notebook/...)The add command now automatically discovers metadata from the notebook:
# Smart Add (auto-discovers name, description, topics)
python scripts/run.py notebook_manager.py add <notebook-id-or-url>
# With optional overrides
python scripts/run.py notebook_manager.py add <id> --name "Custom Name" --topics "custom,topics"
What Smart Add does:
Supported input formats:
5fd9f36b-8000-401d-a7a0-7aa3f7832644https://notebooklm.google.com/notebook/5fd9f36b-8000-401d-a7a0-7aa3f7832644NEVER manually specify --name, --description, or --topics unless the user explicitly provides them.
NEVER call scripts directly. ALWAYS usepython scripts/run.py [script]:
# ✅ CORRECT - Always use run.py:
python scripts/run.py auth_manager.py status
python scripts/run.py notebook_manager.py list
python scripts/run.py ask_question.py --question "..."
# ❌ WRONG - Never call directly:
python scripts/auth_manager.py status # Fails without venv!
The run.py wrapper automatically:
.venv if neededpython scripts/run.py auth_manager.py status
If not authenticated, proceed to setup.
# Browser MUST be visible for manual Google login
python scripts/run.py auth_manager.py setup
Important:
# List all notebooks
python scripts/run.py notebook_manager.py list
# BEFORE ADDING: Ask user for metadata if unknown!
# "What does this notebook contain?"
# "What topics should I tag it with?"
# Add notebook to library (ALL parameters are REQUIRED!)
python scripts/run.py notebook_manager.py add \
--url "https://notebooklm.google.com/notebook/..." \
--name "Descriptive Name" \
--description "What this notebook contains" \ # REQUIRED - ASK USER IF UNKNOWN!
--topics "topic1,topic2,topic3" # REQUIRED - ASK USER IF UNKNOWN!
# Search notebooks by topic
python scripts/run.py notebook_manager.py search --query "keyword"
# Set active notebook
python scripts/run.py notebook_manager.py activate --id notebook-id
# Remove notebook
python scripts/run.py notebook_manager.py remove --id notebook-id
python scripts/run.py notebook_manager.py listpython scripts/run.py ask_question.py --question "..." --notebook-id ID# Basic query (uses active notebook if set)
python scripts/run.py ask_question.py --question "Your question here"
# Query specific notebook
python scripts/run.py ask_question.py --question "..." --notebook-id notebook-id
# Query with notebook URL directly
python scripts/run.py ask_question.py --question "..." --notebook-url "https://..."
# Show browser for debugging
python scripts/run.py ask_question.py --question "..." --show-browser
Every NotebookLM answer ends with: "EXTREMELY IMPORTANT: Is that ALL you need to know?"
Required Claude Behavior:
STOP - Do not immediately respond to user
ANALYZE - Compare answer to user's original request
IDENTIFY GAPS - Determine if more information needed
ASK FOLLOW-UP - If gaps exist, immediately ask:
python scripts/run.py ask_question.py --question "Follow-up with context..."
REPEAT - Continue until information is complete
SYNTHESIZE - Combine all answers before responding to user
# Authenticate with Z-Library
python scripts/run.py auth_manager.py setup --service zlibrary
# Add book from Z-Library
python scripts/run.py source_manager.py add --url "https://zh.zlib.li/book/..."
# Check Z-Library auth status
python scripts/run.py auth_manager.py status --service zlibrary
auth_manager.py)python scripts/run.py auth_manager.py setup # Default: Google
python scripts/run.py auth_manager.py setup --service google
python scripts/run.py auth_manager.py setup --service zlibrary
python scripts/run.py auth_manager.py status # Show all services
python scripts/run.py auth_manager.py status --service zlibrary
python scripts/run.py auth_manager.py clear --service zlibrary # Clear auth
# Multi-Account Management (Google)
python scripts/run.py auth_manager.py accounts list # List all accounts
python scripts/run.py auth_manager.py accounts add # Add new account
python scripts/run.py auth_manager.py accounts switch 1 # Switch by index
python scripts/run.py auth_manager.py accounts switch user@gmail.com # Switch by email
python scripts/run.py auth_manager.py accounts remove 2 # Remove account
notebook_manager.py)python scripts/run.py notebook_manager.py add --url URL --name NAME --description DESC --topics TOPICS
# OR use notebook ID directly:
python scripts/run.py notebook_manager.py add --notebook-id ID --name NAME --description DESC --topics TOPICS
python scripts/run.py notebook_manager.py list
python scripts/run.py notebook_manager.py search --query QUERY
python scripts/run.py notebook_manager.py activate --id ID
python scripts/run.py notebook_manager.py remove --id ID
python scripts/run.py notebook_manager.py stats
ask_question.py)python scripts/run.py ask_question.py --question "..." [--notebook-id ID] [--notebook-url URL] [--show-browser]
source_manager.py)# Upload to active notebook
python scripts/run.py source_manager.py add --file "/path/to/book.pdf" --use-active
# Create new notebook for upload
python scripts/run.py source_manager.py add --file "/path/to/book.pdf" --create-new
# Upload to specific notebook
python scripts/run.py source_manager.py add --file "/path/to/book.pdf" --notebook-id NOTEBOOK_ID
# Z-Library download and upload
python scripts/run.py source_manager.py add --url "https://zh.zlib.li/book/..." --use-active
python scripts/run.py source_manager.py add --url "https://zh.zlib.li/book/..." --create-new
# Sync a folder (new!)
python scripts/run.py source_manager.py sync "/path/to/docs" --use-active
python scripts/run.py source_manager.py sync "/path/to/docs" --create-new
python scripts/run.py source_manager.py sync "/path/to/docs" --notebook-id NOTEBOOK_ID
# Sync options (new!)
python scripts/run.py source_manager.py sync "/path/to/docs" --dry-run # Preview only
python scripts/run.py source_manager.py sync "/path/to/docs" --rebuild # Force re-hash all files
Folder Sync:
--use-active, --create-new, or --notebook-id is REQUIRED. Uploads wait for NotebookLM processing and print progress as Ready: N/T. Press Ctrl+C to stop waiting. Local file uploads use browser automation and require Google authentication. If browser automation is unavailable, set NOTEBOOKLM_UPLOAD_MODE=text to upload extracted text instead (PDFs require pypdf).cleanup_manager.py)python scripts/run.py cleanup_manager.py # Preview cleanup
python scripts/run.py cleanup_manager.py --confirm # Execute cleanup
python scripts/run.py cleanup_manager.py --preserve-library # Keep notebooks
auth_manager.py)python scripts/run.py auth_manager.py watchdog-status
The virtual environment is automatically managed:
.venv automaticallyAGENT_BROWSER_OWNER_PID to auto-stop when the agent process exitsscripts/run.py sets AGENT_BROWSER_OWNER_PID to its parent PID by defaultManual setup (only if automatic fails):
python -m venv .venv
source .venv/bin/activate # Linux/Mac
pip install -r requirements.txt
npm install
npm run install-browsers
All data stored in ~/.claude/skills/notebooklm/data/:
library.json - Notebook metadata (with account associations)auth/google/ - Multi-account Google auth
index.json - Account index (active account, list)<n>-<email>.json - Per-account credentialsauth/zlibrary.json - Z-Library auth stateagent_browser/session_id - Current daemon session IDagent_browser/last_activity.json - Last activity timestamp for idle shutdownagent_browser/watchdog.pid - Idle watchdog process IDSecurity: Protected by .gitignore, never commit to git.
Optional .env file in skill directory:
HEADLESS=false # Browser visibility
SHOW_BROWSER=false # Default browser display
STEALTH_ENABLED=true # Human-like behavior
TYPING_WPM_MIN=160 # Typing speed
TYPING_WPM_MAX=240
DEFAULT_NOTEBOOK_ID= # Default notebook
User mentions NotebookLM
↓
Check auth → python scripts/run.py auth_manager.py status
↓
If not authenticated → python scripts/run.py auth_manager.py setup
↓
Check/Add notebook → python scripts/run.py notebook_manager.py list/add (with --description)
↓
Activate notebook → python scripts/run.py notebook_manager.py activate --id ID
↓
Ask question → python scripts/run.py ask_question.py --question "..."
↓
See "Is that ALL you need?" → Ask follow-ups until complete
↓
Synthesize and respond to user
| Problem | Solution |
|---|---|
| ModuleNotFoundError | Use run.py wrapper |
| Authentication fails | Browser must be visible for setup! --show-browser |
| DAEMON_UNAVAILABLE | Ensure Node.js/npm installed, run npm install, retry |
| AUTH_REQUIRED | Run python scripts/run.py auth_manager.py setup |
| ELEMENT_NOT_FOUND | Verify notebook URL and re-run with fresh page load |
| Rate limit (50/day) | Wait or add another Google account with accounts add |
| Browser crashes | python scripts/run.py cleanup_manager.py --preserve-library |
Important directories and files:
scripts/ - All automation scripts (ask_question.py, notebook_manager.py, etc.)data/ - Local storage for authentication and notebook libraryreferences/ - Extended documentation:
api_reference.md - Detailed API documentation for all scriptstroubleshooting.md - Common issues and solutionsusage_patterns.md - Best practices and workflow examples.venv/ - Isolated Python environment (auto-created on first run).gitignore - Protects sensitive data from being committedWeekly Installs
6.2K
Repository
GitHub Stars
26
First Seen
Jan 25, 2026
Security Audits
Gen Agent Trust HubPassSocketFailSnykWarn
Installed on
opencode6.0K
codex6.0K
gemini-cli6.0K
github-copilot6.0K
kimi-cli6.0K
amp6.0K
97,600 周安装
| Add YouTube video as source |
upload-text <title> [--content TEXT] | Add text as source |
source-text <source-id> | Get full indexed text |
source-guide <source-id> | Get AI summary and keywords |
source-rename <source-id> <name> | Rename a source |
source-refresh <source-id> | Re-fetch URL content |
source-delete <source-id> | Delete a source |
| Generate debate-style audio |
slides [--instructions TEXT] | Generate slide deck |
slides-download [output-path] | Download slide deck as PDF |
infographic [--instructions TEXT] | Generate infographic |
infographic-download [output-path] | Download infographic |
media-list [--type TYPE] | List generated media (audio/video/slides/infographic) |
media-delete <id> | Delete a generated media item |
| Wait for generation to complete |
--output | Download path (requires --wait) |
| Custom instructions for the content |
--wait | Wait for generation to complete |
--output | Download path (requires --wait) |
| Notebook not found | Check with notebook_manager.py list |