This skill provides comprehensive guidance for using NotebookLM via both the nlm CLI and MCP tools.
ALWAYS check which tools are available before proceeding:
mcp__notebooklm-mcp__ or mcp_notebooklm_nlm CLI commands via BashDecision 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.
Run nlm --ai to get comprehensive AI-optimized documentation - this provides a complete view of all CLI capabilities.
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 login before any operationsnlm login if commands start failing--confirm is REQUIRED: All generation and delete commands need --confirm or -y (CLI) or confirm=True (MCP)--notebook-id: The flag is mandatory, not positionalnlm alias set nlm alias list before creating a new alias to avoid conflicts with existing names.nlm chat start - it opens an interactive REPL that AI tools cannot control. Use nlm notebook query for one-shot Q&A instead.--quiet to capture IDs for piping. Only use --json when you need to parse specific fields programmatically.--help when unsure: Run nlm --help to see available options and flags for any command.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
If using MCP tools and encountering authentication errors:
# Run the CLI authentication (works for both CLI and MCP)
nlm login
# Then 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="<cookie_header>")
#### CLI Authentication
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
nlm login profile list # List all profiles with email addresses
nlm login profile delete
nlm login profile rename
**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.
### 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
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
nlm notebook describe
nlm notebook query
nlm notebook rename
nlm notebook delete
### 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
nlm source add
nlm source add
nlm source add
nlm source add
nlm source add
nlm source list
nlm source list
nlm source list
nlm source get
nlm source describe
nlm source content
nlm source content
nlm source stale
nlm source sync
nlm source sync
nlm source rename
nlm rename source
nlm source delete
**Drive types**: `doc`, `slides`, `sheets`, `pdf`
### 4. 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
nlm research start "query" --notebook-id
nlm research start "query" --notebook-id
nlm research start "query" --notebook-id
nlm research status
nlm research status
nlm research status
nlm research status
nlm research import
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 <id1,id2>`: Limit to specific sources
- `--language <code>`: BCP-47 code (en, es, fr, de, ja)
nlm audio create
nlm audio create
nlm audio create
nlm report create
nlm report create
nlm report create
nlm quiz create
nlm quiz create
nlm quiz create
nlm flashcards create
nlm flashcards create
nlm flashcards create
nlm mindmap create
nlm mindmap create
nlm mindmap list
nlm slides create
nlm slides create
nlm slides revise
nlm infographic create
nlm infographic create
nlm video create
nlm video create
nlm data-table create
### 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
nlm studio status
nlm studio status
nlm studio status
nlm download audio
nlm download video
nlm download report
nlm download slide-deck
nlm download slide-deck
nlm download quiz
nlm export sheets
nlm export docs
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:**
nlm source rename
nlm rename source
#### Rename a Studio Artifact
#### MCP Tools
Use `studio_status` with `action="rename"`, `artifact_id`, and `new_title`.
#### CLI Commands
nlm studio rename
nlm rename studio
### Server Info (Version Check)
#### MCP Tools
Use `server_info` to get version and check for updates:
mcp__notebooklm-mcp__server_info()
#### CLI Commands
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:
nlm chat start
**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):
nlm chat configure
nlm chat configure
nlm chat configure
nlm chat configure
**Notes management**:
nlm note create
nlm note list
nlm note update
nlm note delete
### 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
nlm share status
nlm share public
nlm share public
nlm share invite
nlm share invite
### 9. Aliases (UUID Shortcuts)
Simplify long UUIDs:
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
nlm notebook get myproject
nlm source list myproject
nlm audio create myproject --confirm
### 10. Configuration
CLI-only commands for managing settings:
nlm config show # Show current config
nlm config get
nlm config set
nlm config set output.format json # Change default output
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:
nlm skill list # Show installation status
nlm skill update # Update all outdated skills
nlm skill update
nlm skill install
nlm skill uninstall
**Verb-first aliases**: `nlm update skill`, `nlm list skills`, `nlm install skill`
## Output 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
nlm notebook create "AI Research 2026" # Capture ID
nlm alias set ai
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
nlm audio create ai --format deep_dive --confirm
nlm studio status ai # Check generation progress
### Pattern 2: Quick Content Ingestion
nlm source add
nlm source add
nlm source add
nlm source list
### Pattern 3: Study Materials Generation
nlm report create
nlm quiz create
nlm flashcards create
### Pattern 4: Drive Document Workflow
nlm source add
nlm source stale
nlm source sync
## Error 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 <nb-id>` |
| "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:
- Source operations: 2 seconds
- Content generation: 5 seconds
- Research operations: 2 seconds
- Query operations: 2 seconds
## Advanced Reference
For detailed information, see:
- **[references/command_reference.md](references/command_reference.md)**: Complete command signatures
- **[references/troubleshooting.md](references/troubleshooting.md)**: Detailed error handling
- **[references/workflows.md](references/workflows.md)**: End-to-end task sequences
共 1 个版本