nlm-skill

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

NotebookLM CLI & MCP Expert

NotebookLM CLI & MCP 专家指南

This skill provides comprehensive guidance for using NotebookLM via both the
nlm
CLI and MCP tools.
本技能提供通过
nlm
CLI和MCP工具使用NotebookLM的全面指导。

Tool Detection (CRITICAL - Read First!)

工具检测(关键内容 - 请先阅读!)

ALWAYS check which tools are available before proceeding:
  1. Check for MCP tools: Look for tools starting with
    mcp__notebooklm-mcp__*
    or
    mcp_notebooklm_*
  2. If BOTH MCP tools AND CLI are available: ASK the user which they prefer to use before proceeding
  3. If only MCP tools are available: Use them directly (refer to tool docstrings for parameters)
  4. If only CLI is available: Use
    nlm
    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.
操作前请务必先检查可用的工具:
  1. 检查MCP工具:查找以
    mcp__notebooklm-mcp__*
    mcp_notebooklm_*
    开头的工具
  2. 如果同时有MCP工具和CLI可用:操作前询问用户偏好使用哪种方式
  3. 如果只有MCP工具可用:直接使用(参数参考工具文档字符串)
  4. 如果只有CLI可用:通过Bash执行
    nlm
    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")
本技能同时记录了两种使用方式,请根据工具可用性和用户偏好选择合适的方案。

Quick Reference

快速参考

Run
nlm --ai
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
执行
nlm --ai
获取AI优化的完整文档
- 可以查看所有CLI能力的完整说明。
bash
nlm --help              # 列出所有命令
nlm <command> --help    # 查看特定命令的帮助信息
nlm --ai                # AI优化的完整文档(推荐)
nlm --version           # 检查安装版本

Critical Rules (Read First!)

核心规则(请先阅读!)

  1. Always authenticate first: Run
    nlm login
    before any operations
  2. Sessions expire in ~20 minutes: Re-run
    nlm login
    if commands start failing
  3. ⚠️ 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.
  4. --confirm
    is REQUIRED
    : All generation and delete commands need
    --confirm
    or
    -y
    (CLI) or
    confirm=True
    (MCP)
  5. Research requires
    --notebook-id
    : The flag is mandatory, not positional
  6. Capture IDs from output: Create/start commands return IDs needed for subsequent operations
  7. Use aliases: Simplify long UUIDs with
    nlm alias set <name> <uuid>
  8. Check aliases before creating: Run
    nlm alias list
    before creating a new alias to avoid conflicts with existing names.
  9. DO NOT launch REPL: Never use
    nlm chat start
    - it opens an interactive REPL that AI tools cannot control. Use
    nlm notebook query
    for one-shot Q&A instead.
  10. Choose output format wisely: Default output (no flags) is compact and token-efficient—use it for status checks. Use
    --quiet
    to capture IDs for piping. Only use
    --json
    when you need to parse specific fields programmatically.
  11. Use
    --help
    when unsure
    : Run
    nlm <command> --help
    to see available options and flags for any command.
  1. 始终先完成身份认证:执行任何操作前先运行
    nlm login
  2. 会话有效期约20分钟:如果命令执行失败,请重新运行
    nlm login
  3. ⚠️ 删除操作前必须询问用户:执行任何删除命令前,必须获得用户的明确确认。删除操作不可撤销,请告知用户将删除的内容并警告永久数据丢失风险。
  4. --confirm
    为必填参数
    :所有生成和删除命令都需要添加
    --confirm
    -y
    (CLI)或
    confirm=True
    (MCP)
  5. 调研功能需要
    --notebook-id
    参数
    :该标志是必填项,不是位置参数
  6. 从输出中捕获ID:创建/启动命令会返回后续操作需要的ID
  7. 使用别名:通过
    nlm alias set <name> <uuid>
    简化过长的UUID
  8. 创建别名前先检查:创建新别名前运行
    nlm alias list
    避免与现有名称冲突
  9. 不要启动REPL:禁止使用
    nlm chat start
    ,它会打开AI工具无法控制的交互式REPL,请使用
    nlm notebook query
    进行单轮问答
  10. 合理选择输出格式:默认输出(无标志)紧凑且节省token,适用于状态检查。使用
    --quiet
    捕获ID用于管道操作。仅当你需要程序化解析特定字段时才使用
    --json
  11. 不确定时使用
    --help
    :运行
    nlm <command> --help
    查看任意命令的可用选项和标志

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

Command Categories

命令分类

1. Authentication

1. 身份认证

MCP Authentication

MCP身份认证

If using MCP tools and encountering authentication errors:
bash
undefined
如果使用MCP工具时遇到认证错误:
bash
undefined

Run the CLI authentication (works for both CLI and MCP)

运行CLI身份认证(同时适用于CLI和MCP)

nlm login
nlm login

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>")
undefined
mcp__notebooklm-mcp__save_auth_tokens(cookies="<cookie_header>")
undefined

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
nlm login switch <name>
. 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执行
nlm login switch <name>
,下次MCP工具调用会立即使用新账户。
注意:MCP和CLI共享同一套身份认证后端,因此对其中一个完成认证后两者都可以使用。

2. Notebook Management

2. 笔记本管理

MCP Tools

MCP工具

Use tools:
notebook_list
,
notebook_create
,
notebook_get
,
notebook_describe
,
notebook_query
,
notebook_rename
,
notebook_delete
. All accept
notebook_id
parameter. Delete requires
confirm=True
.
使用工具:
notebook_list
notebook_create
notebook_get
notebook_describe
notebook_query
notebook_rename
notebook_delete
。所有工具都接受
notebook_id
参数,删除操作需要
confirm=True

CLI Commands

CLI命令

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. 素材源管理

MCP Tools

MCP工具

Use
source_add
with these
source_type
values:
  • url
    - Web page or YouTube URL (
    url
    param)
  • text
    - Pasted content (
    text
    +
    title
    params)
  • file
    - Local file upload (
    file_path
    param)
  • drive
    - Google Drive doc (
    document_id
    +
    doc_type
    params)
Other tools:
source_list_drive
,
source_describe
,
source_get_content
,
source_rename
,
source_sync_drive
(requires
confirm=True
),
source_delete
(requires
confirm=True
).
使用
source_add
工具,支持以下
source_type
值:
  • url
    - 网页或YouTube URL(
    url
    参数)
  • text
    - 粘贴的内容(
    text
    +
    title
    参数)
  • file
    - 本地文件上传(
    file_path
    参数)
  • drive
    - Google Drive文档(
    document_id
    +
    doc_type
    参数)
其他工具:
source_list_drive
source_describe
source_get_content
source_rename
source_sync_drive
(需要
confirm=True
)、
source_delete
(需要
confirm=True
)。

CLI Commands

CLI命令

bash
undefined
bash
undefined

Adding sources

添加素材源

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 # 同步指定素材源

Rename

重命名

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> # 动词优先写法

Deletion

删除

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查找新的素材源。

MCP Tools

MCP工具

Use
research_start
with:
  • source
    :
    web
    or
    drive
  • mode
    :
    fast
    (~30s) or
    deep
    (~5min, web only)
Workflow:
research_start
→ poll
research_status
research_import
使用
research_start
工具,参数包括:
  • source
    web
    drive
  • mode
    fast
    (约30秒)或
    deep
    (约5分钟,仅网页支持)
工作流:
research_start
→ 轮询
research_status
research_import

CLI Commands

CLI命令

bash
undefined
bash
undefined

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搜索

Check progress

检查进度

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
studio_create
with
artifact_type
and type-specific options. All require
confirm=True
.
artifact_typeKey Options
audio
audio_format
: deep_dive/brief/critique/debate,
audio_length
: short/default/long
video
video_format
: explainer/brief,
visual_style
: auto_select/classic/whiteboard/kawaii/anime/watercolor/retro_print/heritage/paper_craft
report
report_format
: Briefing Doc/Study Guide/Blog Post/Create Your Own,
custom_prompt
quiz
question_count
,
difficulty
: easy/medium/hard
flashcards
difficulty
: easy/medium/hard
mind_map
title
slide_deck
slide_format
: detailed_deck/presenter_slides,
slide_length
: short/default
infographic
orientation
: landscape/portrait/square,
detail_level
: concise/standard/detailed,
infographic_style
: auto_select/sketch_note/professional/bento_grid/editorial/instructional/bricks/clay/anime/kawaii/scientific
data_table
description
(REQUIRED)
Common options:
source_ids
,
language
(BCP-47 code),
focus_prompt
Revise Slides: Use
studio_revise
to revise individual slides in an existing slide deck.
  • Requires
    artifact_id
    (from
    studio_status
    ) and
    slide_instructions
  • Creates a NEW artifact — the original is not modified
  • Slide numbers are 1-based (slide 1 = first slide)
  • Poll
    studio_status
    after calling to check when the new deck is ready
使用
studio_create
工具,指定
artifact_type
和类型特定选项,所有调用都需要
confirm=True
产物类型核心选项
audio
audio_format
: deep_dive/brief/critique/debate,
audio_length
: short/default/long
video
video_format
: explainer/brief,
visual_style
: auto_select/classic/whiteboard/kawaii/anime/watercolor/retro_print/heritage/paper_craft
report
report_format
: Briefing Doc/Study Guide/Blog Post/Create Your Own,
custom_prompt
quiz
question_count
,
difficulty
: easy/medium/hard
flashcards
difficulty
: easy/medium/hard
mind_map
title
slide_deck
slide_format
: detailed_deck/presenter_slides,
slide_length
: short/default
infographic
orientation
: landscape/portrait/square,
detail_level
: concise/standard/detailed,
infographic_style
: auto_select/sketch_note/professional/bento_grid/editorial/instructional/bricks/clay/anime/kawaii/scientific
data_table
description
(必填)
通用选项
source_ids
language
(BCP-47编码)、
focus_prompt
修改幻灯片:使用
studio_revise
修改现有幻灯片中的单页幻灯片。
  • 需要
    artifact_id
    (从
    studio_status
    获取)和
    slide_instructions
    参数
  • 会生成新的产物,原始产物不会被修改
  • 幻灯片编号从1开始(slide 1 = 第一页)
  • 调用后轮询
    studio_status
    检查新幻灯片的生成进度

CLI Commands

CLI命令

All generation commands share these flags:
  • --confirm
    or
    -y
    : REQUIRED to execute
  • --source-ids <id1,id2>
    : Limit to specific sources
  • --language <code>
    : BCP-47 code (en, es, fr, de, ja)
bash
undefined
所有生成命令都支持以下标志:
  • --confirm
    -y
    执行必填
  • --source-ids <id1,id2>
    :仅使用指定素材源
  • --language <code>
    :BCP-47编码(en、es、fr、de、ja)
bash
undefined

Audio (Podcast)

音频(播客)

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

Report

报告

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"

Quiz

测验

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

焦点:可选文本,指导测验生成方向

Flashcards

抽认卡

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

焦点:可选文本,指导抽认卡生成方向

Mind Map

思维导图

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> # 列出现有思维导图

Slides

幻灯片

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.

生成包含修改内容的新幻灯片,原幻灯片保持不变

Infographic

信息图

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

Video

视频

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

Data Table

数据表

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

描述为必填的第二个参数

undefined
undefined

6. Studio (Artifact Management)

6. 工作室(产物管理)

MCP Tools

MCP工具

Use
studio_status
to check progress (or rename with
action="rename"
). Use
download_artifact
with
artifact_type
and
output_path
. Use
export_artifact
with
export_type
: docs/sheets. Delete with
studio_delete
(requires
confirm=True
).
使用
studio_status
检查进度(或使用
action="rename"
重命名)。使用
download_artifact
并指定
artifact_type
output_path
下载产物。使用
export_artifact
并指定
export_type
:docs/sheets导出到Google文档/表格。使用
studio_delete
删除产物(需要
confirm=True
)。

CLI Commands

CLI命令

bash
undefined
bash
undefined

Check status

检查状态

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输出

Download artifacts

下载产物

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"

Delete artifact

删除产物

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`字段,包含生成该产物时使用的原始焦点提示词或自定义指令(例如“自定义”报告的提示词,或音频概览的焦点主题)。该字段可用于检索生成成功产物的精确提示词。

Renaming Resources

重命名资源

Rename a Source

重命名素材源

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

重命名工作室产物

MCP Tools

MCP工具

Use
studio_status
with
action="rename"
,
artifact_id
, and
new_title
.
使用
studio_status
并指定
action="rename"
artifact_id
new_title

CLI Commands

CLI命令

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)

服务器信息(版本检查)

MCP Tools

MCP工具

Use
server_info
to get version and check for updates:
python
mcp__notebooklm-mcp__server_info()
使用
server_info
获取版本并检查更新:
python
mcp__notebooklm-mcp__server_info()

Returns: version, latest_version, update_available, update_command

返回:version, latest_version, update_available, update_command

undefined
undefined

CLI Commands

CLI命令

bash
nlm --version  # Shows version and update availability
bash
nlm --version  # 展示版本和更新可用性

7. Chat Configuration and Notes

7. 聊天配置和笔记

MCP Tools

MCP工具

Use
chat_configure
with
goal
: default/learning_guide/custom. Use
note
with
action
: create/list/update/delete. Delete requires
confirm=True
.
使用
chat_configure
并指定
goal
:default/learning_guide/custom。使用
note
并指定
action
:create/list/update/delete,删除操作需要
confirm=True

CLI Commands

CLI命令

⚠️ AI TOOLS: DO NOT USE
nlm chat start
- It launches an interactive REPL that cannot be controlled programmatically. Use
nlm notebook query
for one-shot Q&A instead.
For human users at a terminal:
bash
nlm chat start <nb-id>  # Launch interactive REPL
REPL Commands:
  • /sources
    - List available sources
  • /clear
    - Reset conversation context
  • /help
    - Show commands
  • /exit
    - 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工具请勿使用
nlm chat start
- 它会启动无法被程序化控制的交互式REPL,请使用
nlm notebook query
进行单轮问答。
面向终端人类用户的命令:
bash
nlm chat start <nb-id>  # 启动交互式REPL
REPL命令
  • /sources
    - 列出可用素材源
  • /clear
    - 重置会话上下文
  • /help
    - 展示命令
  • /exit
    - 退出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. 笔记本共享

MCP Tools

MCP工具

Use
notebook_share_status
to check,
notebook_share_public
to enable/disable public link,
notebook_share_invite
with
email
and
role
: viewer/editor.
使用
notebook_share_status
检查共享状态,
notebook_share_public
启用/禁用公开链接,
notebook_share_invite
邀请协作者,指定
email
role
:viewer/editor。

CLI Commands

CLI命令

bash
undefined
bash
undefined

Check sharing status

检查共享状态

nlm share status <nb-id>
nlm share status <nb-id>

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 # 禁用

Invite collaborator

邀请协作者

nlm share invite <nb-id> user@example.com nlm share invite <nb-id> user@example.com --role editor
undefined
nlm share invite <nb-id> user@example.com nlm share invite <nb-id> user@example.com --role editor
undefined

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
undefined
nlm notebook get myproject nlm source list myproject nlm audio create myproject --confirm
undefined

10. Configuration

10. 配置

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
Verb-first aliases:
nlm update skill
,
nlm list skills
,
nlm install skill
管理各类AI助手的NotebookLM技能安装:
bash
nlm skill list                              # 展示安装状态
nlm skill update                            # 更新所有过时技能
nlm skill update <tool>                     # 更新指定技能(例如claude-code)
nlm skill install <tool>                    # 安装技能
nlm skill uninstall <tool>                  # 卸载技能
动词优先别名
nlm update skill
nlm list skills
nlm install skill

Output Formats

输出格式

Most list commands support multiple formats:
FlagDescription
(none)Rich table (human-readable)
--json
JSON output (for parsing)
--quiet
IDs only (for piping)
--title
"ID: Title" format
--url
"ID: URL" format (sources only)
--full
All columns/details
大多数列表命令支持多种格式:
标志描述
(无)富表格(人类可读)
--json
JSON输出(用于解析)
--quiet
仅输出ID(用于管道)
--title
"ID: 标题"格式
--url
"ID: URL"格式(仅素材源)
--full
所有列/完整详情

Common Patterns

常用模式

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
undefined
nlm source stale <id> # 检查新鲜度 nlm source sync <id> --confirm # 如果过时则同步
undefined

Error Recovery

错误恢复

ErrorCauseSolution
"Cookies have expired"Session timeout
nlm login
"authentication may have expired"Session timeout
nlm login
"Notebook not found"Invalid ID
nlm notebook list
"Source not found"Invalid ID
nlm source list <nb-id>
"Rate limit exceeded"Too many callsWait 30s, retry
"Research already in progress"Pending researchUse
--force
or import first
Browser doesn't launchPort conflictClose browser, retry
错误信息原因解决方案
"Cookies have expired"会话超时
nlm login
"authentication may have expired"会话超时
nlm login
"Notebook not found"无效ID
nlm notebook list
"Source not found"无效ID
nlm source list <nb-id>
"Rate limit exceeded"调用次数过多等待30秒后重试
"Research already in progress"已有进行中的调研任务使用
--force
参数或先导入现有调研结果
浏览器未启动端口冲突关闭浏览器后重试

Rate Limiting

速率限制

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秒

Advanced Reference

高级参考

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:端到端任务序列