NotebookLM Skill
by @hewenqiang
Expert guide for the NotebookLM CLI (`nlm`) and MCP server - interfaces for Google NotebookLM. Use this skill when users want to interact with NotebookLM pro...
clawhub install nlm-notebooklmπ About This Skill
name: nlm-skill description: "Expert guide for the NotebookLM CLI (
nlm) and MCP server - interfaces for Google NotebookLM. Use this skill when users want to interact with NotebookLM programmatically, including: creating/managing notebooks, adding sources (URLs, YouTube, text, Google Drive), generating content (podcasts, reports, quizzes, flashcards, mind maps, slides, infographics, videos, data tables), conducting research, chatting with sources, or automating NotebookLM workflows. Triggers on mentions of \"nlm\", \"notebooklm\", \"notebook lm\", \"podcast generation\", \"audio overview\", or any NotebookLM-related automation task."
version: "0.3.19"
NotebookLM CLI & MCP Expert
This skill provides comprehensive guidance for using NotebookLM via both the nlm CLI and MCP tools.
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 commandsif 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.
Quick Reference
Run nlm --ai to get comprehensive AI-optimized documentation - this provides a complete view of all CLI capabilities.
nlm --help # List all commands
nlm --help # Help for specific command
nlm --ai # Full AI-optimized documentation (RECOMMENDED)
nlm --version # Check installed 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
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 to see available options and flags for any command.
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 --url "https://..."
β βββΊ From YouTube β nlm source add --url "https://youtube.com/..."
β βββΊ From pasted text β nlm source add --text "content" --title "Title"
β βββΊ From Google Drive β nlm source add --drive --type doc
β βββΊ Discover new sources β nlm research start "query" --notebook-id
β
βββΊ Generate content from sources
β βββΊ Podcast/Audio β nlm audio create --confirm
β βββΊ Written summary β nlm report create --confirm
β βββΊ Study materials β nlm quiz/flashcards create --confirm
β βββΊ Visual content β nlm mindmap/slides/infographic create --confirm
β βββΊ Video β nlm video create --confirm
β βββΊ Extract data β nlm data-table create "description" --confirm
β
βββΊ Ask questions about sources
β βββΊ nlm notebook query "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
β
βββΊ Manage/cleanup
βββΊ List notebooks β nlm notebook list
βββΊ List sources β nlm source list
βββΊ Delete source β nlm source delete --confirm
βββΊ Delete notebook β nlm notebook delete --confirm
Command Categories
1. Authentication
#### MCP Authentication
If using MCP tools and encountering authentication errors:
# Run the CLI authentication (works for both CLI and MCP)
nlm loginThen reload tokens in MCP
mcp__notebooklm-mcp__refresh_auth()
Or manually save cookies via MCP (fallback):
# Extract cookies from Chrome DevTools and save
mcp__notebooklm-mcp__save_auth_tokens(cookies="")
#### CLI Authenticationbash
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
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 . 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.
2. Notebook Management
#### MCP Tools
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.
#### CLI Commands
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
3. Source Management
#### MCP Tools
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).
#### CLI Commands
bash
Adding sources
nlm source addListing and viewing
nlm source listDrive sync (for stale sources)
nlm source staleRename
nlm source renameDeletion
nlm source delete
Drive types: doc, slides, sheets, pdf4. Research (Source Discovery)
Research finds NEW sources from the web or Google Drive.
#### MCP Tools
Use research_start with:
source: web or drive
mode: fast (~30s) or deep (~5min, web only)Workflow: research_start β poll research_status β research_import
#### CLI Commands
bash
Start research (--notebook-id is REQUIRED)
nlm research start "query" --notebook-idCheck progress
nlm research statusImport discovered sources
nlm research import
Modes: fast (~30s, ~10 sources) | deep (~5min, ~40+ sources, web only)5. Content Generation (Studio)
#### MCP Tools (Unified Creation)
Use studio_create with artifact_type and type-specific options. All require confirm=True.
| artifact_type | Key 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 #### CLI Commands
All generation commands share these flags:
--confirm or -y: REQUIRED to execute
--source-ids : Limit to specific sources
--language : BCP-47 code (en, es, fr, de, ja)bash
Audio (Podcast)
nlm audio createFormats: deep_dive, brief, critique, debate
Lengths: short, default, long
Report
nlm report createFormats: "Briefing Doc", "Study Guide", "Blog Post", "Create Your Own"
Quiz
nlm quiz createCount: number of questions (default: 2)
Difficulty: 1-5 (1=easy, 5=hard)
Focus: optional text to guide quiz generation
Flashcards
nlm flashcards createDifficulty: easy, medium, hard
Focus: optional text to guide flashcard generation
Mind Map
nlm mindmap createSlides
nlm slides createFormats: detailed, presenter | Lengths: short, default
nlm slides reviseCreates a NEW deck with revisions. Original unchanged.
Infographic
nlm infographic createOrientations: landscape, portrait, square
Detail: concise, standard, detailed
Styles: auto_select, sketch_note, professional, bento_grid, editorial, instructional, bricks, clay, anime, kawaii, scientific
Video
nlm video createFormats: explainer, brief
Styles: auto_select, classic, whiteboard, kawaii, anime, watercolor, retro_print, heritage, paper_craft
Data Table
nlm data-table createDESCRIPTION is required as second argument
6. Studio (Artifact Management)
#### MCP Tools
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).
#### CLI Commands
bash
Check status
nlm studio statusDownload artifacts
nlm download audioExport to Google Docs/Sheets
nlm export sheetsDelete artifact
nlm studio delete
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.
Renaming Resources
#### Rename a Source
MCP Tool: source_rename(notebook_id, source_id, new_title)
CLI:
bash
nlm source rename
#### Rename a Studio Artifact#### MCP Tools
Use studio_status with action="rename", artifact_id, and new_title.
#### CLI Commands
bash
nlm studio rename
Server Info (Version Check)
#### MCP Tools
Use server_info to get version and check for updates:
python
mcp__notebooklm-mcp__server_info()
Returns: version, latest_version, update_available, update_command
#### CLI Commands
bash
nlm --version # Shows version and update availability
7. Chat Configuration and Notes
#### MCP Tools
Use chat_configure with goal: default/learning_guide/custom. Use note with action: create/list/update/delete. Delete requires confirm=True.
#### CLI Commands
> β οΈ 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
REPL Commands:
/sources - List available sources
/clear - Reset conversation context
/help - Show commands
/exit - Exit REPLConfigure chat behavior (works for both REPL and query):
bash
nlm chat configure
Notes management:
bash
nlm note create
8. Notebook Sharing
#### MCP Tools
Use notebook_share_status to check, notebook_share_public to enable/disable public link, notebook_share_invite with email and role: viewer/editor.
#### CLI Commands
bash
Check sharing status
nlm share statusEnable/disable public link
nlm share publicInvite collaborator
nlm share invite
9. Aliases (UUID Shortcuts)
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 aliasUse aliases anywhere
nlm notebook get myproject nlm source list myproject nlm audio create myproject --confirm
10. Configuration
CLI-only commands for managing settings:
bash
nlm config show # Show current config
nlm config get 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 |
11. Skill Management
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
Verb-first aliases: nlm update skill, nlm list skills, nlm install skillOutput Formats
Most list commands support multiple formats:
| Flag | Description |
|------|-------------|
| (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 |
Common Patterns
Pattern 1: Research β Podcast Pipeline
bash
nlm notebook create "AI Research 2026" # Capture ID
nlm alias set ai
Pattern 2: Quick Content Ingestion
bash
nlm source add
Pattern 3: Study Materials Generation
bash
nlm report create
Pattern 4: Drive Document Workflow
bash
nlm source add ... time passes, document is edited ...
nlm source staleError Recovery
| Error | Cause | Solution |
|-------|-------|----------|
| "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 |
| "Rate limit exceeded" | Too many calls | Wait 30s, retry |
| "Research already in progress" | Pending research | Use --force` or import first |
| Browser doesn't launch | Port conflict | Close browser, retry |Rate Limiting
Wait between operations to avoid rate limits:
Advanced Reference
For detailed information, see: