nlm-cli-skill
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNotebookLM CLI Expert
NotebookLM CLI 专家指南
This skill provides comprehensive guidance for using the CLI to automate Google NotebookLM workflows.
nlm本技能为使用 CLI自动化Google NotebookLM工作流提供全面指导。
nlmQuick Reference
快速参考
bash
nlm --help # List all commands
nlm <command> --help # Help for specific command
nlm --ai # Full AI-optimized documentation
nlm --version # Check installed versionbash
nlm --help # List all commands
nlm <command> --help # Help for specific command
nlm --ai # Full AI-optimized documentation
nlm --version # Check installed versionCritical Rules (Read First!)
重要规则(请先阅读!)
- Always authenticate first: Run before any operations
nlm login - Sessions expire in ~20 minutes: Re-run if commands start failing
nlm login - is REQUIRED: All generation and delete commands need
--confirmor--confirm-y - Research requires : The flag is mandatory, not positional
--notebook-id - Capture IDs from output: Create/start commands return IDs needed for subsequent operations
- Use aliases: Simplify long UUIDs with
nlm alias set <name> <uuid> - ⚠️ 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.
- Check aliases before creating: Run before creating a new alias to avoid conflicts with existing names.
nlm alias list - DO NOT launch REPL: Never use - it opens an interactive REPL that AI tools cannot control. Use
nlm chat startfor one-shot Q&A instead.nlm notebook query - 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
--quietwhen you need to parse specific fields programmatically.--json
- 务必先认证:执行任何操作前运行
nlm login - 会话约20分钟后过期:如果命令开始失败,请重新运行
nlm login - 必须使用:所有生成和删除命令都需要
--confirm或--confirm-y - 研究需要:该参数是必填项,不能省略
--notebook-id - 从输出中捕获ID:创建/启动命令会返回后续操作所需的ID
- 使用别名:通过简化冗长的UUID
nlm alias set <name> <uuid> - ⚠️ 删除前务必询问用户:在执行任何删除命令前,务必获得用户的明确确认。删除操作不可撤销。需告知用户将删除的内容,并警告数据会永久丢失。
- 创建前检查别名:创建新别名前运行,避免与现有名称冲突。
nlm alias list - 请勿启动REPL:永远不要使用——它会打开AI工具无法控制的交互式REPL。请使用
nlm chat start进行一次性问答。nlm notebook query - 明智选择输出格式:默认输出(无参数)简洁且高效利用令牌——用于状态检查。使用捕获ID以便管道传输。仅当需要程序化解析特定字段时才使用
--quiet。--json
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...
│
├─► 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> --confirmCommand Categories
命令分类
1. Authentication
1. 认证
bash
nlm login # Launch Chrome, extract cookies (primary method)
nlm login --check # Validate current session
nlm login --profile work # Use named profile for multiple accounts
nlm auth status # Check if authenticated
nlm auth list # List all profilesSession lifetime: ~20 minutes. Re-authenticate when commands fail with auth errors.
bash
nlm login # Launch Chrome, extract cookies (primary method)
nlm login --check # Validate current session
nlm login --profile work # Use named profile for multiple accounts
nlm auth status # Check if authenticated
nlm auth list # List all profiles会话有效期:约20分钟。当命令因认证错误失败时,请重新认证。
2. Notebook Management
2. 笔记本管理
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 deletionbash
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 deletion3. Source Management
3. 来源管理
bash
undefinedbash
undefinedAdding sources
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://..." # 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
Listing and viewing
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> # 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
Drive sync (for stale sources)
Drive sync (for stale sources)
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> # 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
Deletion
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:
bash
undefined研究功能可从网页或Google Drive中查找新来源:
bash
undefinedStart research (--notebook-id is REQUIRED)
Start research (--notebook-id is REQUIRED)
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> # 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
Check progress
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> # 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
Import discovered sources
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> # Import all
nlm research import <nb-id> <task-id> --indices 0,2,5 # Import specific
**模式**:`fast`(约30秒,约10个来源)| `deep`(约5分钟,40+个来源,仅网页)5. Content Generation (Studio)
5. 内容生成(工作室)
All generation commands share these flags:
- or
--confirm: REQUIRED to execute-y - : Limit to specific sources
--source-ids <id1,id2> - : BCP-47 code (en, es, fr, de, ja)
--language <code>
bash
undefined所有生成命令共享以下参数:
- 或
--confirm:必填参数,用于执行命令-y - :限制为特定来源
--source-ids <id1,id2> - :BCP-47代码(en、es、fr、de、ja)
--language <code>
bash
undefinedAudio (Podcast)
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
Formats: deep_dive, brief, critique, debate
Lengths: short, default, long
Lengths: short, default, long
Report
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"
Formats: "Briefing Doc", "Study Guide", "Blog Post", "Create Your Own"
Quiz
Quiz
nlm quiz create <id> --confirm
nlm quiz create <id> --count 5 --difficulty 3 --confirm
nlm quiz create <id> --confirm
nlm quiz create <id> --count 5 --difficulty 3 --confirm
Count: number of questions (default: 2)
Count: number of questions (default: 2)
Difficulty: 1-5 (1=easy, 5=hard)
Difficulty: 1-5 (1=easy, 5=hard)
Flashcards
Flashcards
nlm flashcards create <id> --confirm
nlm flashcards create <id> --difficulty hard --confirm
nlm flashcards create <id> --confirm
nlm flashcards create <id> --difficulty hard --confirm
Difficulty: easy, medium, hard
Difficulty: easy, medium, hard
Mind Map
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> # List existing mind maps
Slides
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
Formats: detailed, presenter | Lengths: short, default
Infographic
Infographic
nlm infographic create <id> --confirm
nlm infographic create <id> --orientation portrait --detail detailed --confirm
nlm infographic create <id> --confirm
nlm infographic create <id> --orientation portrait --detail detailed --confirm
Orientations: landscape, portrait, square
Orientations: landscape, portrait, square
Detail: concise, standard, detailed
Detail: concise, standard, detailed
Video
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
Formats: explainer, brief
Styles: auto_select, classic, whiteboard, kawaii, anime, watercolor, retro_print, heritage, paper_craft
Styles: auto_select, classic, whiteboard, kawaii, anime, watercolor, retro_print, heritage, paper_craft
Data Table
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
DESCRIPTION is required as second argument
undefinedundefined6. Studio (Artifact Management)
6. 工作室(成果管理)
Check and manage generated content:
bash
nlm studio status <nb-id> # List all artifacts
nlm studio status <nb-id> --json # JSON output
nlm studio delete <nb-id> <artifact-id> --confirm # Delete artifactStatus values: (✓), (●), (✗)
completedin_progressfailed检查和管理生成的内容:
bash
nlm studio status <nb-id> # List all artifacts
nlm studio status <nb-id> --json # JSON output
nlm studio delete <nb-id> <artifact-id> --confirm # Delete artifact状态值:(✓)、(●)、(✗)
completedin_progressfailed7. Interactive Chat (Human Users Only)
7. 交互式聊天(仅适用于人类用户)
⚠️ AI TOOLS: DO NOT USE- It launches an interactive REPL that cannot be controlled programmatically. Usenlm chat startfor one-shot Q&A instead.nlm notebook query
For human users at a terminal:
bash
nlm chat start <nb-id> # Launch interactive REPLREPL Commands:
- - List available sources
/sources - - Reset conversation context
/clear - - Show commands
/help - - Exit REPL
/exit
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⚠️ AI工具:请勿使用——它会启动一个无法通过程序化方式控制的交互式REPL。请使用nlm chat start进行一次性问答。nlm notebook query
适用于终端中的人类用户:
bash
nlm chat start <nb-id> # Launch interactive REPLREPL命令:
- - 列出可用来源
/sources - - 重置对话上下文
/clear - - 显示命令
/help - - 退出REPL
/exit
配置聊天行为(适用于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, shorter8. Aliases (UUID Shortcuts)
8. 别名(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... # Create alias (auto-detects type)
nlm alias get myproject # Resolve to UUID
nlm alias list # List all aliases
nlm alias delete myproject # Remove aliasUse aliases anywhere
Use aliases anywhere
nlm notebook get myproject
nlm source list myproject
nlm audio create myproject --confirm
undefinednlm notebook get myproject
nlm source list myproject
nlm audio create myproject --confirm
undefined9. Configuration
9. 配置
bash
nlm config show # Show current config
nlm config get <key> # Get specific setting
nlm config set <key> <value> # Update settingbash
nlm config show # Show current config
nlm config get <key> # Get specific setting
nlm config set <key> <value> # Update settingOutput Formats
输出格式
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 |
大多数列表命令支持多种格式:
| 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 |
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 progressbash
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 progressPattern 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 --confirm
nlm flashcards create <id> --difficulty medium --confirmbash
nlm report create <id> --format "Study Guide" --confirm
nlm quiz create <id> --count 10 --difficulty 3 --confirm
nlm flashcards create <id> --difficulty medium --confirmPattern 4: Drive Document Workflow
模式4:Drive文档工作流
bash
nlm source add <id> --drive 1KQH3eW0hMBp7WK... --type slidesbash
nlm source add <id> --drive 1KQH3eW0hMBp7WK... --type slides... time passes, document is edited ...
... time passes, document is edited ...
nlm source stale <id> # Check freshness
nlm source sync <id> --confirm # Sync if stale
undefinednlm source stale <id> # Check freshness
nlm source sync <id> --confirm # Sync if stale
undefinedError Recovery
错误恢复
| 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 |
| Chrome doesn't launch | Port conflict | Close Chrome, retry |
| 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 |
| Chrome doesn't launch | Port conflict | Close Chrome, retry |
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: 端到端任务序列