NotebookLM CLI & MCP Expert
NotebookLM CLI & MCP 专家指南
This skill provides comprehensive guidance for using NotebookLM via both the
CLI and MCP tools.
本技能提供通过
CLI和MCP工具使用NotebookLM的全面指导。
Tool Detection (CRITICAL - Read First!)
工具检测(关键内容 - 请先阅读!)
ALWAYS check which tools are available before proceeding:
- Check for MCP tools: Look for tools starting with or
- If BOTH MCP tools AND CLI are available: ASK the user which they prefer to use before proceeding
- If only MCP tools are available: Use them directly (refer to tool docstrings for parameters)
- If only CLI is available: Use CLI commands via Bash
Decision Logic:
has_mcp_tools = check_available_tools() # Look for mcp__notebooklm-mcp__* or mcp_notebooklm_*
has_cli = check_bash_available() # Can run nlm commands
if has_mcp_tools and has_cli:
# ASK USER: "I can use either MCP tools or the nlm CLI. Which do you prefer?"
user_preference = ask_user()
else if has_mcp_tools:
# Use MCP tools directly
mcp__notebooklm-mcp__notebook_list()
else:
# Use CLI via Bash
bash("nlm notebook list")
This skill documents BOTH approaches. Choose the appropriate one based on tool availability and user preference.
操作前请务必先检查可用的工具:
- 检查MCP工具:查找以或开头的工具
- 如果同时有MCP工具和CLI可用:操作前询问用户偏好使用哪种方式
- 如果只有MCP工具可用:直接使用(参数参考工具文档字符串)
- 如果只有CLI可用:通过Bash执行 CLI命令
决策逻辑:
has_mcp_tools = check_available_tools() # Look for mcp__notebooklm-mcp__* or mcp_notebooklm_*
has_cli = check_bash_available() # Can run nlm commands
if has_mcp_tools and has_cli:
# ASK USER: "I can use either MCP tools or the nlm CLI. Which do you prefer?"
user_preference = ask_user()
else if has_mcp_tools:
# Use MCP tools directly
mcp__notebooklm-mcp__notebook_list()
else:
# Use CLI via Bash
bash("nlm notebook list")
本技能同时记录了两种使用方式,请根据工具可用性和用户偏好选择合适的方案。
Run to get comprehensive AI-optimized documentation - this provides a complete view of all CLI capabilities.
bash
nlm --help # List all commands
nlm <command> --help # Help for specific command
nlm --ai # Full AI-optimized documentation (RECOMMENDED)
nlm --version # Check installed version
执行获取AI优化的完整文档 - 可以查看所有CLI能力的完整说明。
bash
nlm --help # 列出所有命令
nlm <command> --help # 查看特定命令的帮助信息
nlm --ai # AI优化的完整文档(推荐)
nlm --version # 检查安装版本
Critical Rules (Read First!)
核心规则(请先阅读!)
- Always authenticate first: Run before any operations
- Sessions expire in ~20 minutes: Re-run if commands start failing
- ⚠️ ALWAYS ASK USER BEFORE DELETE: Before executing ANY delete command, ask the user for explicit confirmation. Deletions are irreversible. Show what will be deleted and warn about permanent data loss.
- is REQUIRED: All generation and delete commands need or (CLI) or (MCP)
- Research requires : The flag is mandatory, not positional
- Capture IDs from output: Create/start commands return IDs needed for subsequent operations
- Use aliases: Simplify long UUIDs with
nlm alias set <name> <uuid>
- Check aliases before creating: Run before creating a new alias to avoid conflicts with existing names.
- DO NOT launch REPL: Never use - it opens an interactive REPL that AI tools cannot control. Use for one-shot Q&A instead.
- Choose output format wisely: Default output (no flags) is compact and token-efficient—use it for status checks. Use to capture IDs for piping. Only use when you need to parse specific fields programmatically.
- Use when unsure: Run to see available options and flags for any command.
- 始终先完成身份认证:执行任何操作前先运行
- 会话有效期约20分钟:如果命令执行失败,请重新运行
- ⚠️ 删除操作前必须询问用户:执行任何删除命令前,必须获得用户的明确确认。删除操作不可撤销,请告知用户将删除的内容并警告永久数据丢失风险。
- 为必填参数:所有生成和删除命令都需要添加或(CLI)或(MCP)
- 调研功能需要参数:该标志是必填项,不是位置参数
- 从输出中捕获ID:创建/启动命令会返回后续操作需要的ID
- 使用别名:通过
nlm alias set <name> <uuid>
简化过长的UUID
- 创建别名前先检查:创建新别名前运行避免与现有名称冲突
- 不要启动REPL:禁止使用,它会打开AI工具无法控制的交互式REPL,请使用进行单轮问答
- 合理选择输出格式:默认输出(无标志)紧凑且节省token,适用于状态检查。使用捕获ID用于管道操作。仅当你需要程序化解析特定字段时才使用
- 不确定时使用:运行查看任意命令的可用选项和标志
Workflow Decision Tree
工作流决策树
Use this to determine the right sequence of commands:
User wants to...
│
├─► Work with NotebookLM for the first time
│ └─► nlm login → nlm notebook create "Title"
│
├─► Add content to a notebook
│ ├─► From a URL/webpage → nlm source add <nb-id> --url "https://..."
│ ├─► From YouTube → nlm source add <nb-id> --url "https://youtube.com/..."
│ ├─► From pasted text → nlm source add <nb-id> --text "content" --title "Title"
│ ├─► From Google Drive → nlm source add <nb-id> --drive <doc-id> --type doc
│ └─► Discover new sources → nlm research start "query" --notebook-id <nb-id>
│
├─► Generate content from sources
│ ├─► Podcast/Audio → nlm audio create <nb-id> --confirm
│ ├─► Written summary → nlm report create <nb-id> --confirm
│ ├─► Study materials → nlm quiz/flashcards create <nb-id> --confirm
│ ├─► Visual content → nlm mindmap/slides/infographic create <nb-id> --confirm
│ ├─► Video → nlm video create <nb-id> --confirm
│ └─► Extract data → nlm data-table create <nb-id> "description" --confirm
│
├─► Ask questions about sources
│ └─► nlm notebook query <nb-id> "question"
│ (Use --conversation-id for follow-ups)
│ ⚠️ Do NOT use `nlm chat start` - it's a REPL for humans only
│
├─► Check generation status
│ └─► nlm studio status <nb-id>
│
└─► Manage/cleanup
├─► List notebooks → nlm notebook list
├─► List sources → nlm source list <nb-id>
├─► Delete source → nlm source delete <source-id> --confirm
└─► Delete notebook → nlm notebook delete <nb-id> --confirm
使用以下决策树确定正确的命令序列:
User wants to...
│
├─► 首次使用NotebookLM
│ └─► nlm login → nlm notebook create "Title"
│
├─► 向笔记本添加内容
│ ├─► 从URL/网页添加 → nlm source add <nb-id> --url "https://..."
│ ├─► 从YouTube添加 → nlm source add <nb-id> --url "https://youtube.com/..."
│ ├─► 从粘贴文本添加 → nlm source add <nb-id> --text "content" --title "Title"
│ ├─► 从Google Drive添加 → nlm source add <nb-id> --drive <doc-id> --type doc
│ └─► 发现新素材源 → nlm research start "query" --notebook-id <nb-id>
│
├─► 从素材源生成内容
│ ├─► 播客/音频 → nlm audio create <nb-id> --confirm
│ ├─► 文字摘要 → nlm report create <nb-id> --confirm
│ ├─► 学习资料 → nlm quiz/flashcards create <nb-id> --confirm
│ ├─► 可视化内容 → nlm mindmap/slides/infographic create <nb-id> --confirm
│ ├─► 视频 → nlm video create <nb-id> --confirm
│ └─► 提取数据 → nlm data-table create <nb-id> "description" --confirm
│
├─► 针对素材源提问
│ └─► nlm notebook query <nb-id> "question"
│ (追问使用--conversation-id参数)
│ ⚠️ 不要使用`nlm chat start` - 它是仅面向人类的REPL
│
├─► 检查生成状态
│ └─► nlm studio status <nb-id>
│
└─► 管理/清理资源
├─► 列出笔记本 → nlm notebook list
├─► 列出素材源 → nlm source list <nb-id>
├─► 删除素材源 → nlm source delete <source-id> --confirm
└─► 删除笔记本 → nlm notebook delete <nb-id> --confirm
MCP Authentication
MCP身份认证
If using MCP tools and encountering authentication errors:
Run the CLI authentication (works for both CLI and MCP)
运行CLI身份认证(同时适用于CLI和MCP)
Then reload tokens in MCP
然后在MCP中重新加载令牌
mcp__notebooklm-mcp__refresh_auth()
Or manually save cookies via MCP (fallback):
```python
mcp__notebooklm-mcp__refresh_auth()
或通过MCP手动保存cookie( fallback方案):
```python
Extract cookies from Chrome DevTools and save
从Chrome开发者工具提取cookie并保存
mcp__notebooklm-mcp__save_auth_tokens(cookies="<cookie_header>")
mcp__notebooklm-mcp__save_auth_tokens(cookies="<cookie_header>")
CLI Authentication
CLI身份认证
bash
nlm login # Launch browser, extract cookies (primary method)
nlm login --check # Validate current session
nlm login --profile work # Use named profile for multiple accounts
nlm login --provider openclaw --cdp-url http://127.0.0.1:18800 # External CDP provider
nlm login switch <profile> # Switch the default profile
nlm login profile list # List all profiles with email addresses
nlm login profile delete <name> # Delete a profile
nlm login profile rename <old> <new> # Rename a profile
Multi-Profile Support: Each profile gets its own isolated browser session (supports Chrome, Arc, Brave, Edge, Chromium, and more), so you can be logged into multiple Google accounts simultaneously.
Session lifetime: ~20 minutes. Re-authenticate when commands fail with auth errors.
Switching MCP Accounts: The MCP server always uses the active default profile. If you need to switch which Google account the MCP server is communicating with, you MUST use the CLI: run
. Your next MCP tool call will instantly use the new account.
Note: Both MCP and CLI share the same authentication backend, so authenticating with one works for both.
bash
nlm login # 启动浏览器,提取cookie(主要方式)
nlm login --check # 验证当前会话
nlm login --profile work # 使用命名配置文件支持多账户
nlm login --provider openclaw --cdp-url http://127.0.0.1:18800 # 外部CDP提供商
nlm login switch <profile> # 切换默认配置文件
nlm login profile list # 列出所有配置文件及关联邮箱
nlm login profile delete <name> # 删除配置文件
nlm login profile rename <old> <new> # 重命名配置文件
多配置文件支持:每个配置文件都有独立的浏览器会话(支持Chrome、Arc、Brave、Edge、Chromium等),因此你可以同时登录多个Google账户。
会话有效期:约20分钟。如果命令返回认证错误,请重新认证。
切换MCP账户:MCP服务器始终使用当前活跃的默认配置文件。如果你需要切换MCP服务器使用的Google账户,必须通过CLI执行
,下次MCP工具调用会立即使用新账户。
注意:MCP和CLI共享同一套身份认证后端,因此对其中一个完成认证后两者都可以使用。
2. Notebook Management
2. 笔记本管理
Use tools:
,
,
,
,
,
,
. All accept
parameter. Delete requires
.
使用工具:
、
、
、
、
、
、
。所有工具都接受
参数,删除操作需要
。
bash
nlm notebook list # List all notebooks
nlm notebook list --json # JSON output for parsing
nlm notebook list --quiet # IDs only (for scripting)
nlm notebook create "Title" # Create notebook, returns ID
nlm notebook get <id> # Get notebook details
nlm notebook describe <id> # AI-generated summary + suggested topics
nlm notebook query <id> "question" # One-shot Q&A with sources
nlm notebook rename <id> "New Title" # Rename notebook
nlm notebook delete <id> --confirm # PERMANENT deletion
bash
nlm notebook list # 列出所有笔记本
nlm notebook list --json # JSON格式输出用于解析
nlm notebook list --quiet # 仅输出ID(用于脚本)
nlm notebook create "Title" # 创建笔记本,返回ID
nlm notebook get <id> # 获取笔记本详情
nlm notebook describe <id> # AI生成的摘要+建议主题
nlm notebook query <id> "question" # 针对素材源的单轮问答
nlm notebook rename <id> "New Title" # 重命名笔记本
nlm notebook delete <id> --confirm # 永久删除
3. Source Management
3. 素材源管理
- - Web page or YouTube URL ( param)
- - Pasted content ( + params)
- - Local file upload ( param)
- - Google Drive doc ( + params)
Other tools:
,
,
,
,
(requires
),
(requires
).
- - 网页或YouTube URL(参数)
- - 粘贴的内容( + 参数)
- - 本地文件上传(参数)
- - Google Drive文档( + 参数)
nlm source add <nb-id> --url "https://..." # Web page
nlm source add <nb-id> --url "
https://youtube.com/..." # YouTube video
nlm source add <nb-id> --text "content" --title "X" # Pasted text
nlm source add <nb-id> --drive <doc-id> # Drive doc (auto-detect type)
nlm source add <nb-id> --drive <doc-id> --type slides # Explicit type
nlm source add <nb-id> --url "https://..." # 网页
nlm source add <nb-id> --url "
https://youtube.com/..." # YouTube视频
nlm source add <nb-id> --text "content" --title "X" # 粘贴文本
nlm source add <nb-id> --drive <doc-id> # Drive文档(自动检测类型)
nlm source add <nb-id> --drive <doc-id> --type slides # 显式指定类型
Listing and viewing
列出和查看素材源
nlm source list <nb-id> # Table of sources
nlm source list <nb-id> --drive # Show Drive sources with freshness
nlm source list <nb-id> --drive -S # Skip freshness checks (faster)
nlm source get <source-id> # Source metadata
nlm source describe <source-id> # AI summary + keywords
nlm source content <source-id> # Raw text content
nlm source content <source-id> -o file.txt # Export to file
nlm source list <nb-id> # 素材源表格
nlm source list <nb-id> --drive # 展示Drive素材源及新鲜度
nlm source list <nb-id> --drive -S # 跳过新鲜度检查(更快)
nlm source get <source-id> # 素材源元数据
nlm source describe <source-id> # AI摘要+关键词
nlm source content <source-id> # 原始文本内容
nlm source content <source-id> -o file.txt # 导出到文件
Drive sync (for stale sources)
Drive同步(用于过时素材源)
nlm source stale <nb-id> # List outdated Drive sources
nlm source sync <nb-id> --confirm # Sync all stale sources
nlm source sync <nb-id> --source-ids <ids> --confirm # Sync specific
nlm source stale <nb-id> # 列出过时的Drive素材源
nlm source sync <nb-id> --confirm # 同步所有过时素材源
nlm source sync <nb-id> --source-ids <ids> --confirm # 同步指定素材源
nlm source rename <source-id> "New Title" --notebook <nb-id>
nlm rename source <source-id> "New Title" --notebook <nb-id> # verb-first
nlm source rename <source-id> "New Title" --notebook <nb-id>
nlm rename source <source-id> "New Title" --notebook <nb-id> # 动词优先写法
nlm source delete <source-id> --confirm
**Drive types**: `doc`, `slides`, `sheets`, `pdf`
nlm source delete <source-id> --confirm
**Drive类型**:`doc`、`slides`、`sheets`、`pdf`
4. Research (Source Discovery)
4. 调研(素材源发现)
Research finds NEW sources from the web or Google Drive.
调研功能可以从网页或Google Drive查找新的素材源。
- : or
- : (~30s) or (~5min, web only)
Start research (--notebook-id is REQUIRED)
启动调研(--notebook-id为必填项)
nlm research start "query" --notebook-id <id> # Fast web (~30s)
nlm research start "query" --notebook-id <id> --mode deep # Deep web (~5min)
nlm research start "query" --notebook-id <id> --source drive # Drive search
nlm research start "query" --notebook-id <id> # 快速网页调研(约30秒)
nlm research start "query" --notebook-id <id> --mode deep # 深度网页调研(约5分钟)
nlm research start "query" --notebook-id <id> --source drive # Drive搜索
nlm research status <nb-id> # Poll until done (5min max)
nlm research status <nb-id> --max-wait 0 # Single check, no waiting
nlm research status <nb-id> --task-id <tid> # Check specific task
nlm research status <nb-id> --full # Full details
nlm research status <nb-id> # 轮询直到完成(最多5分钟)
nlm research status <nb-id> --max-wait 0 # 单次检查,不等待
nlm research status <nb-id> --task-id <tid> # 检查指定任务
nlm research status <nb-id> --full # 完整详情
Import discovered sources
导入发现的素材源
nlm research import <nb-id> <task-id> # Import all
nlm research import <nb-id> <task-id> --indices 0,2,5 # Import specific
**Modes**: `fast` (~30s, ~10 sources) | `deep` (~5min, ~40+ sources, web only)
nlm research import <nb-id> <task-id> # 导入全部
nlm research import <nb-id> <task-id> --indices 0,2,5 # 导入指定索引的素材源
**模式**:`fast`(约30秒,约10个素材源) | `deep`(约5分钟,约40+个素材源,仅网页支持)
5. Content Generation (Studio)
5. 内容生成(工作室)
MCP Tools (Unified Creation)
MCP工具(统一创建接口)
Use
with
and type-specific options. All require
.
| artifact_type | Key Options |
|---|
| : deep_dive/brief/critique/debate, : short/default/long |
| : explainer/brief, : auto_select/classic/whiteboard/kawaii/anime/watercolor/retro_print/heritage/paper_craft |
| : Briefing Doc/Study Guide/Blog Post/Create Your Own, |
| , : easy/medium/hard |
| : easy/medium/hard |
| |
| : detailed_deck/presenter_slides, : short/default |
| : landscape/portrait/square, : concise/standard/detailed, : auto_select/sketch_note/professional/bento_grid/editorial/instructional/bricks/clay/anime/kawaii/scientific |
| (REQUIRED) |
Common options:
,
(BCP-47 code),
Revise Slides: Use
to revise individual slides in an existing slide deck.
- Requires (from ) and
- Creates a NEW artifact — the original is not modified
- Slide numbers are 1-based (slide 1 = first slide)
- Poll after calling to check when the new deck is ready
| 产物类型 | 核心选项 |
|---|
| : deep_dive/brief/critique/debate, : short/default/long |
| : explainer/brief, : auto_select/classic/whiteboard/kawaii/anime/watercolor/retro_print/heritage/paper_craft |
| : Briefing Doc/Study Guide/Blog Post/Create Your Own, |
| , : easy/medium/hard |
| : easy/medium/hard |
| |
| : detailed_deck/presenter_slides, : short/default |
| : landscape/portrait/square, : concise/standard/detailed, : auto_select/sketch_note/professional/bento_grid/editorial/instructional/bricks/clay/anime/kawaii/scientific |
| (必填) |
- 需要(从获取)和参数
- 会生成新的产物,原始产物不会被修改
- 幻灯片编号从1开始(slide 1 = 第一页)
- 调用后轮询检查新幻灯片的生成进度
All generation commands share these flags:
- or : REQUIRED to execute
- : Limit to specific sources
- : BCP-47 code (en, es, fr, de, ja)
所有生成命令都支持以下标志:
- 或:执行必填
- :仅使用指定素材源
- :BCP-47编码(en、es、fr、de、ja)
nlm audio create <id> --confirm
nlm audio create <id> --format deep_dive --length default --confirm
nlm audio create <id> --format brief --focus "key topic" --confirm
nlm audio create <id> --confirm
nlm audio create <id> --format deep_dive --length default --confirm
nlm audio create <id> --format brief --focus "key topic" --confirm
Formats: deep_dive, brief, critique, debate
格式:deep_dive, brief, critique, debate
Lengths: short, default, long
时长:short, default, long
nlm report create <id> --confirm
nlm report create <id> --format "Study Guide" --confirm
nlm report create <id> --format "Create Your Own" --prompt "Custom..." --confirm
nlm report create <id> --confirm
nlm report create <id> --format "Study Guide" --confirm
nlm report create <id> --format "Create Your Own" --prompt "Custom..." --confirm
Formats: "Briefing Doc", "Study Guide", "Blog Post", "Create Your Own"
格式:"Briefing Doc", "Study Guide", "Blog Post", "Create Your Own"
nlm quiz create <id> --confirm
nlm quiz create <id> --count 5 --difficulty 3 --confirm
nlm quiz create <id> --count 10 --difficulty 3 --focus "Focus on key concepts" --confirm
nlm quiz create <id> --confirm
nlm quiz create <id> --count 5 --difficulty 3 --confirm
nlm quiz create <id> --count 10 --difficulty 3 --focus "Focus on key concepts" --confirm
Count: number of questions (default: 2)
数量:题目数量(默认:2)
Difficulty: 1-5 (1=easy, 5=hard)
难度:1-5(1=简单,5=困难)
Focus: optional text to guide quiz generation
焦点:可选文本,指导测验生成方向
nlm flashcards create <id> --confirm
nlm flashcards create <id> --difficulty hard --confirm
nlm flashcards create <id> --difficulty medium --focus "Focus on definitions" --confirm
nlm flashcards create <id> --confirm
nlm flashcards create <id> --difficulty hard --confirm
nlm flashcards create <id> --difficulty medium --focus "Focus on definitions" --confirm
Difficulty: easy, medium, hard
难度:easy, medium, hard
Focus: optional text to guide flashcard generation
焦点:可选文本,指导抽认卡生成方向
nlm mindmap create <id> --confirm
nlm mindmap create <id> --title "Topic Overview" --confirm
nlm mindmap list <id> # List existing mind maps
nlm mindmap create <id> --confirm
nlm mindmap create <id> --title "Topic Overview" --confirm
nlm mindmap list <id> # 列出现有思维导图
nlm slides create <id> --confirm
nlm slides create <id> --format presenter --length short --confirm
nlm slides create <id> --confirm
nlm slides create <id> --format presenter --length short --confirm
Formats: detailed, presenter | Lengths: short, default
格式:detailed, presenter | 长度:short, default
nlm slides revise <artifact-id> --slide '1 Make the title larger' --confirm
nlm slides revise <artifact-id> --slide '1 Make the title larger' --confirm
Creates a NEW deck with revisions. Original unchanged.
生成包含修改内容的新幻灯片,原幻灯片保持不变
nlm infographic create <id> --confirm
nlm infographic create <id> --orientation portrait --detail detailed --style professional --confirm
nlm infographic create <id> --confirm
nlm infographic create <id> --orientation portrait --detail detailed --style professional --confirm
Orientations: landscape, portrait, square
方向:landscape, portrait, square
Detail: concise, standard, detailed
详情度:concise, standard, detailed
Styles: auto_select, sketch_note, professional, bento_grid, editorial, instructional, bricks, clay, anime, kawaii, scientific
风格:auto_select, sketch_note, professional, bento_grid, editorial, instructional, bricks, clay, anime, kawaii, scientific
nlm video create <id> --confirm
nlm video create <id> --format brief --style whiteboard --confirm
nlm video create <id> --confirm
nlm video create <id> --format brief --style whiteboard --confirm
Formats: explainer, brief
格式:explainer, brief
Styles: auto_select, classic, whiteboard, kawaii, anime, watercolor, retro_print, heritage, paper_craft
风格:auto_select, classic, whiteboard, kawaii, anime, watercolor, retro_print, heritage, paper_craft
nlm data-table create <id> "Extract all dates and events" --confirm
nlm data-table create <id> "Extract all dates and events" --confirm
DESCRIPTION is required as second argument
描述为必填的第二个参数
6. Studio (Artifact Management)
6. 工作室(产物管理)
Use
to check progress (or rename with
). Use
with
and
. Use
with
: docs/sheets. Delete with
(requires
).
使用
检查进度(或使用
重命名)。使用
并指定
和
下载产物。使用
并指定
:docs/sheets导出到Google文档/表格。使用
删除产物(需要
)。
nlm studio status <nb-id> # List all artifacts
nlm studio status <nb-id> --full # Show full details (including custom prompts)
nlm studio status <nb-id> --json # JSON output
nlm studio status <nb-id> # 列出所有产物
nlm studio status <nb-id> --full # 展示完整详情(包括自定义提示词)
nlm studio status <nb-id> --json # JSON输出
nlm download audio <nb-id> --output podcast.mp3
nlm download video <nb-id> --output video.mp4
nlm download report <nb-id> --output report.md
nlm download slide-deck <nb-id> --output slides.pdf # PDF (default)
nlm download slide-deck <nb-id> --output slides.pptx --format pptx # PPTX
nlm download quiz <nb-id> --output quiz.json --format json
nlm download audio <nb-id> --output podcast.mp3
nlm download video <nb-id> --output video.mp4
nlm download report <nb-id> --output report.md
nlm download slide-deck <nb-id> --output slides.pdf # PDF(默认)
nlm download slide-deck <nb-id> --output slides.pptx --format pptx # PPTX
nlm download quiz <nb-id> --output quiz.json --format json
Export to Google Docs/Sheets
导出到Google Docs/Sheets
nlm export sheets <nb-id> <artifact-id> --title "My Data Table"
nlm export docs <nb-id> <artifact-id> --title "My Report"
nlm export sheets <nb-id> <artifact-id> --title "My Data Table"
nlm export docs <nb-id> <artifact-id> --title "My Report"
nlm studio delete <nb-id> <artifact-id> --confirm
**Status values**: `completed` (✓), `in_progress` (●), `failed` (✗)
**Prompt Extraction**: The `studio_status` tool returns a `custom_instructions` field for each artifact. This contains the original focus prompt or custom instructions used to generate that artifact (e.g., the prompt for a "Create Your Own" report, or the focus topic for an Audio Overview). This is useful for retrieving the exact prompt that generated a successful artifact.
nlm studio delete <nb-id> <artifact-id> --confirm
**状态值**:`completed`(✓)、`in_progress`(●)、`failed`(✗)
**提示词提取**:`studio_status`工具会返回每个产物的`custom_instructions`字段,包含生成该产物时使用的原始焦点提示词或自定义指令(例如“自定义”报告的提示词,或音频概览的焦点主题)。该字段可用于检索生成成功产物的精确提示词。
MCP Tool: source_rename(notebook_id, source_id, new_title)
CLI:
bash
nlm source rename <source-id> "New Title" --notebook <notebook-id>
nlm rename source <source-id> "New Title" --notebook <notebook-id> # verb-first
MCP工具:
source_rename(notebook_id, source_id, new_title)
CLI:
bash
nlm source rename <source-id> "New Title" --notebook <notebook-id>
nlm rename source <source-id> "New Title" --notebook <notebook-id> # 动词优先写法
Rename a Studio Artifact
重命名工作室产物
bash
nlm studio rename <artifact-id> "New Title"
nlm rename studio <artifact-id> "New Title" # verb-first alternative
bash
nlm studio rename <artifact-id> "New Title"
nlm rename studio <artifact-id> "New Title" # 动词优先替代写法
Server Info (Version Check)
服务器信息(版本检查)
Use
to get version and check for updates:
python
mcp__notebooklm-mcp__server_info()
python
mcp__notebooklm-mcp__server_info()
Returns: version, latest_version, update_available, update_command
返回:version, latest_version, update_available, update_command
bash
nlm --version # Shows version and update availability
bash
nlm --version # 展示版本和更新可用性
7. Chat Configuration and Notes
7. 聊天配置和笔记
Use
with
: default/learning_guide/custom. Use
with
: create/list/update/delete. Delete requires
.
使用
并指定
:default/learning_guide/custom。使用
并指定
:create/list/update/delete,删除操作需要
。
⚠️
AI TOOLS: DO NOT USE - It launches an interactive REPL that cannot be controlled programmatically. Use
for one-shot Q&A instead.
For human users at a terminal:
bash
nlm chat start <nb-id> # Launch interactive REPL
REPL Commands:
- - List available sources
- - Reset conversation context
- - Show commands
- - Exit REPL
Configure chat behavior (works for both REPL and query):
bash
nlm chat configure <id> --goal default
nlm chat configure <id> --goal learning_guide
nlm chat configure <id> --goal custom --prompt "Act as a tutor..."
nlm chat configure <id> --response-length longer # longer, default, shorter
Notes management:
bash
nlm note create <nb-id> "Content" --title "Title"
nlm note list <nb-id>
nlm note update <nb-id> <note-id> --content "New content"
nlm note delete <nb-id> <note-id> --confirm
⚠️
AI工具请勿使用 - 它会启动无法被程序化控制的交互式REPL,请使用
进行单轮问答。
面向终端人类用户的命令:
bash
nlm chat start <nb-id> # 启动交互式REPL
REPL命令:
- - 列出可用素材源
- - 重置会话上下文
- - 展示命令
- - 退出REPL
配置聊天行为(同时适用于REPL和query命令):
bash
nlm chat configure <id> --goal default
nlm chat configure <id> --goal learning_guide
nlm chat configure <id> --goal custom --prompt "Act as a tutor..."
nlm chat configure <id> --response-length longer # longer, default, shorter
笔记管理:
bash
nlm note create <nb-id> "Content" --title "Title"
nlm note list <nb-id>
nlm note update <nb-id> <note-id> --content "New content"
nlm note delete <nb-id> <note-id> --confirm
8. Notebook Sharing
8. 笔记本共享
Use
to check,
to enable/disable public link,
with
and
: viewer/editor.
使用
检查共享状态,
启用/禁用公开链接,
邀请协作者,指定
和
:viewer/editor。
Check sharing status
检查共享状态
Enable/disable public link
启用/禁用公开链接
nlm share public <nb-id> # Enable
nlm share public <nb-id> --off # Disable
nlm share public <nb-id> # 启用
nlm share public <nb-id> --off # 禁用
nlm share invite <nb-id> user@example.com
nlm share invite <nb-id> user@example.com --role editor
nlm share invite <nb-id> user@example.com
nlm share invite <nb-id> user@example.com --role editor
9. Aliases (UUID Shortcuts)
9. 别名(UUID快捷方式)
Simplify long UUIDs:
bash
nlm alias set myproject abc123-def456... # Create alias (auto-detects type)
nlm alias get myproject # Resolve to UUID
nlm alias list # List all aliases
nlm alias delete myproject # Remove alias
简化过长的UUID:
bash
nlm alias set myproject abc123-def456... # 创建别名(自动检测类型)
nlm alias get myproject # 解析为UUID
nlm alias list # 列出所有别名
nlm alias delete myproject # 删除别名
Use aliases anywhere
任意位置都可以使用别名
nlm notebook get myproject
nlm source list myproject
nlm audio create myproject --confirm
nlm notebook get myproject
nlm source list myproject
nlm audio create myproject --confirm
CLI-only commands for managing settings:
bash
nlm config show # Show current config
nlm config get <key> # Get specific setting
nlm config set <key> <value> # Update setting
nlm config set output.format json # Change default output
仅CLI支持的设置管理命令:
bash
nlm config show # 展示当前配置
nlm config get <key> # 获取指定设置
nlm config set <key> <value> # 更新设置
nlm config set output.format json # 修改默认输出格式
For switching profiles, prefer the simpler command:
切换配置文件推荐使用更简单的命令:
nlm login switch work # Switch default profile
**Available Settings:**
| Key | Default | Description |
|-----|---------|-------------|
| `output.format` | `table` | Default output format (table, json) |
| `output.color` | `true` | Enable colored output |
| `output.short_ids` | `true` | Show shortened IDs |
| `auth.browser` | `auto` | Preferred browser for login (auto, chrome, arc, brave, edge, chromium, vivaldi, opera) |
| `auth.default_profile` | `default` | Profile to use when `--profile` not specified |
nlm login switch work # 切换默认配置文件
**可用设置**:
| 键 | 默认值 | 描述 |
|-----|---------|-------------|
| `output.format` | `table` | 默认输出格式(table、json) |
| `output.color` | `true` | 启用彩色输出 |
| `output.short_ids` | `true` | 展示缩短的ID |
| `auth.browser` | `auto` | 登录首选浏览器(auto、chrome、arc、brave、edge、chromium、vivaldi、opera) |
| `auth.default_profile` | `default` | 未指定`--profile`时使用的配置文件 |
11. Skill Management
11. 技能管理
Manage the NotebookLM skill installation for various AI assistants:
bash
nlm skill list # Show installation status
nlm skill update # Update all outdated skills
nlm skill update <tool> # Update specific skill (e.g., claude-code)
nlm skill install <tool> # Install skill
nlm skill uninstall <tool> # Uninstall skill
管理各类AI助手的NotebookLM技能安装:
bash
nlm skill list # 展示安装状态
nlm skill update # 更新所有过时技能
nlm skill update <tool> # 更新指定技能(例如claude-code)
nlm skill install <tool> # 安装技能
nlm skill uninstall <tool> # 卸载技能
Most list commands support multiple formats:
| Flag | Description |
|---|
| (none) | Rich table (human-readable) |
| JSON output (for parsing) |
| IDs only (for piping) |
| "ID: Title" format |
| "ID: URL" format (sources only) |
| All columns/details |
大多数列表命令支持多种格式:
| 标志 | 描述 |
|---|
| (无) | 富表格(人类可读) |
| JSON输出(用于解析) |
| 仅输出ID(用于管道) |
| "ID: 标题"格式 |
| "ID: URL"格式(仅素材源) |
| 所有列/完整详情 |
Pattern 1: Research → Podcast Pipeline
模式1:调研→播客流水线
bash
nlm notebook create "AI Research 2026" # Capture ID
nlm alias set ai <notebook-id>
nlm research start "agentic AI trends" --notebook-id ai --mode deep
nlm research status ai --max-wait 300 # Wait up to 5 min
nlm research import ai <task-id> # Import all sources
nlm audio create ai --format deep_dive --confirm
nlm studio status ai # Check generation progress
bash
nlm notebook create "AI Research 2026" # 捕获返回的ID
nlm alias set ai <notebook-id>
nlm research start "agentic AI trends" --notebook-id ai --mode deep
nlm research status ai --max-wait 300 # 最多等待5分钟
nlm research import ai <task-id> # 导入所有素材源
nlm audio create ai --format deep_dive --confirm
nlm studio status ai # 检查生成进度
Pattern 2: Quick Content Ingestion
模式2:快速内容摄入
bash
nlm source add <id> --url "https://example1.com"
nlm source add <id> --url "https://example2.com"
nlm source add <id> --text "My notes..." --title "Notes"
nlm source list <id>
bash
nlm source add <id> --url "https://example1.com"
nlm source add <id> --url "https://example2.com"
nlm source add <id> --text "My notes..." --title "Notes"
nlm source list <id>
Pattern 3: Study Materials Generation
模式3:学习资料生成
bash
nlm report create <id> --format "Study Guide" --confirm
nlm quiz create <id> --count 10 --difficulty 3 --focus "Exam prep" --confirm
nlm flashcards create <id> --difficulty medium --focus "Core terms" --confirm
bash
nlm report create <id> --format "Study Guide" --confirm
nlm quiz create <id> --count 10 --difficulty 3 --focus "Exam prep" --confirm
nlm flashcards create <id> --difficulty medium --focus "Core terms" --confirm
Pattern 4: Drive Document Workflow
模式4:Drive文档工作流
bash
nlm source add <id> --drive 1KQH3eW0hMBp7WK... --type slides
bash
nlm source add <id> --drive 1KQH3eW0hMBp7WK... --type slides
... time passes, document is edited ...
... 时间流逝,文档被编辑 ...
nlm source stale <id> # Check freshness
nlm source sync <id> --confirm # Sync if stale
nlm source stale <id> # 检查新鲜度
nlm source sync <id> --confirm # 如果过时则同步
| Error | Cause | Solution |
|---|
| "Cookies have expired" | Session timeout | |
| "authentication may have expired" | Session timeout | |
| "Notebook not found" | Invalid ID | |
| "Source not found" | Invalid ID | |
| "Rate limit exceeded" | Too many calls | Wait 30s, retry |
| "Research already in progress" | Pending research | Use or import first |
| Browser doesn't launch | Port conflict | Close browser, retry |
| 错误信息 | 原因 | 解决方案 |
|---|
| "Cookies have expired" | 会话超时 | |
| "authentication may have expired" | 会话超时 | |
| "Notebook not found" | 无效ID | |
| "Source not found" | 无效ID | |
| "Rate limit exceeded" | 调用次数过多 | 等待30秒后重试 |
| "Research already in progress" | 已有进行中的调研任务 | 使用参数或先导入现有调研结果 |
| 浏览器未启动 | 端口冲突 | 关闭浏览器后重试 |
Wait between operations to avoid rate limits:
- Source operations: 2 seconds
- Content generation: 5 seconds
- Research operations: 2 seconds
- Query operations: 2 seconds
操作之间请等待一定时间避免触发速率限制:
- 素材源操作:2秒
- 内容生成:5秒
- 调研操作:2秒
- 查询操作:2秒
For detailed information, see:
- references/command_reference.md: Complete command signatures
- references/troubleshooting.md: Detailed error handling
- references/workflows.md: End-to-end task sequences
详细信息请查看:
- references/command_reference.md:完整命令签名
- references/troubleshooting.md:详细错误处理说明
- references/workflows.md:端到端任务序列