| name | nlm-cli-skill |
| description | Expert guide for the NotebookLM CLI (`nlm`) - a command-line interface 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. |
NotebookLM CLI Expert
This skill provides comprehensive guidance for using the nlm CLI to automate Google NotebookLM workflows.
Quick Reference
nlm --help
nlm <command> --help
nlm --ai
nlm --version
Critical Rules (Read First!)
- Always authenticate first: Run
nlm login before any operations
- Sessions expire in ~20 minutes: Re-run
nlm login if commands start failing
--confirm is REQUIRED: All generation and delete commands need --confirm or -y
- Research requires
--notebook-id: 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>
- ⚠️ 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
nlm alias list before creating a new alias to avoid conflicts with existing names.
- 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.
- 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.
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
Command Categories
1. Authentication
nlm login
nlm login --check
nlm login --profile work
nlm auth status
nlm auth list
Session lifetime: ~20 minutes. Re-authenticate when commands fail with auth errors.
2. Notebook Management
nlm notebook list
nlm notebook list --json
nlm notebook list --quiet
nlm notebook create "Title"
nlm notebook get <id>
nlm notebook describe <id>
nlm notebook query <id> "question"
nlm notebook rename <id> "New Title"
nlm notebook delete <id> --confirm
3. Source Management
nlm source add <nb-id> --url "https://..."
nlm source add <nb-id> --url "https://youtube.com/..."
nlm source add <nb-id> --text "content" --title "X"
nlm source add <nb-id> --drive <doc-id>
nlm source add <nb-id> --drive <doc-id> --type slides
nlm source list <nb-id>
nlm source list <nb-id> --drive
nlm source list <nb-id> --drive -S
nlm source get <source-id>
nlm source describe <source-id>
nlm source content <source-id>
nlm source content <source-id> -o file.txt
nlm source stale <nb-id>
nlm source sync <nb-id> --confirm
nlm source sync <nb-id> --source-ids <ids> --confirm
nlm source delete <source-id> --confirm
Drive types: doc, slides, sheets, pdf
4. Research (Source Discovery)
Research finds NEW sources from the web or Google Drive:
nlm research start "query" --notebook-id <id>
nlm research start "query" --notebook-id <id> --mode deep
nlm research start "query" --notebook-id <id> --source drive
nlm research status <nb-id>
nlm research status <nb-id> --max-wait 0
nlm research status <nb-id> --task-id <tid>
nlm research status <nb-id> --full
nlm research import <nb-id> <task-id>
nlm research import <nb-id> <task-id> --indices 0,2,5
Modes: fast (~30s, ~10 sources) | deep (~5min, ~40+ sources, web only)
5. Content Generation (Studio)
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 <id> --confirm
nlm audio create <id> --format deep_dive --length default --confirm
nlm audio create <id> --format brief --focus "key topic" --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
nlm quiz create <id> --confirm
nlm quiz create <id> --count 5 --difficulty 3 --confirm
nlm flashcards create <id> --confirm
nlm flashcards create <id> --difficulty hard --confirm
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 infographic create <id> --confirm
nlm infographic create <id> --orientation portrait --detail detailed --confirm
nlm video create <id> --confirm
nlm video create <id> --format brief --style whiteboard --confirm
nlm data-table create <id> "Extract all dates and events" --confirm
6. Studio (Artifact Management)
Check and manage generated content:
nlm studio status <nb-id>
nlm studio status <nb-id> --json
nlm studio delete <nb-id> <artifact-id> --confirm
Status values: completed (✓), in_progress (●), failed (✗)
7. Interactive Chat (Human Users Only)
⚠️ 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 <nb-id>
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 <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
8. Aliases (UUID Shortcuts)
Simplify long UUIDs:
nlm alias set myproject abc123-def456...
nlm alias get myproject
nlm alias list
nlm alias delete myproject
nlm notebook get myproject
nlm source list myproject
nlm audio create myproject --confirm
9. Configuration
nlm config show
nlm config get <key>
nlm config set <key> <value>
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"
nlm alias set ai <notebook-id>
nlm research start "agentic AI trends" --notebook-id ai --mode deep
nlm research status ai --max-wait 300
nlm research import ai <task-id>
nlm audio create ai --format deep_dive --confirm
nlm studio status ai
Pattern 2: Quick Content Ingestion
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
nlm report create <id> --format "Study Guide" --confirm
nlm quiz create <id> --count 10 --difficulty 3 --confirm
nlm flashcards create <id> --difficulty medium --confirm
Pattern 4: Drive Document Workflow
nlm source add <id> --drive 1KQH3eW0hMBp7WK... --type slides
nlm source stale <id>
nlm source sync <id> --confirm
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 |
| 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
Advanced Reference
For detailed information, see: