# CLI Guide Complete command reference for the `nlm` command-line interface. ## Installation ```bash # Using uv (recommended) uv tool install notebooklm-mcp-cli # Using pip pip install notebooklm-mcp-cli ``` ## Authentication ```bash nlm login # Opens Chrome, extracts cookies automatically nlm login --profile work # Named profile for multiple accounts nlm login --check # Check if authenticated nlm login switch # Switch default profile nlm login profile list # List all profiles with email addresses nlm login profile delete # Delete a profile nlm login profile rename # Rename a profile # External CDP provider (e.g., OpenClaw-managed browser) nlm login --provider openclaw --cdp-url http://127.0.0.1:18800 ``` Each profile gets its own isolated Chrome session, so you can stay logged into multiple Google accounts simultaneously. ## Command Structure The CLI supports **two styles** - use whichever feels natural: ```bash # Noun-first (resource-oriented) nlm notebook create "Title" nlm source add --url # Verb-first (action-oriented) nlm create notebook "Title" nlm add url ``` --- ## Command Reference ### Notebooks ```bash nlm notebook list # List all notebooks nlm notebook list --json # JSON output nlm notebook create "Title" # Create notebook nlm notebook get # Get details nlm notebook describe # AI summary nlm notebook rename "New Title" # Rename nlm notebook delete --confirm # Delete (IRREVERSIBLE) nlm notebook query "question" # Chat with sources ``` ### Sources ```bash nlm source list # List sources nlm source add --url "https://..." # Add URL nlm source add --url "https://..." --wait # Add and wait until ready nlm source add --text "content" --title "Notes" # Add text nlm source add --file document.pdf --wait # Upload file nlm source add --youtube "https://..." # Add YouTube nlm source add --drive # Add Drive doc nlm source get # Get content nlm source describe # AI summary nlm source stale # Check stale Drive sources nlm source sync --confirm # Sync stale sources nlm source delete --confirm # Delete (IRREVERSIBLE) ``` ### Studio Content Creation ```bash # Audio (podcasts) nlm audio create --confirm nlm audio create --format deep_dive --length long --confirm # Formats: deep_dive, brief, critique, debate # Lengths: short, default, long # Video nlm video create --confirm nlm video create --format explainer --style classic --confirm # Formats: explainer, brief # Styles: auto_select, classic, whiteboard, kawaii, anime, watercolor, retro_print, heritage, paper_craft # Reports nlm report create --format "Briefing Doc" --confirm # Formats: "Briefing Doc", "Study Guide", "Blog Post", "Create Your Own" # Quiz & Flashcards nlm quiz create --count 10 --difficulty medium --focus "Focus on key concepts" --confirm nlm flashcards create --difficulty hard --focus "Focus on definitions" --confirm # Other nlm mindmap create --confirm nlm slides create --confirm nlm infographic create --orientation landscape --confirm nlm data-table create --description "Sales by region" --confirm ``` ### Downloads ```bash nlm download audio --output podcast.mp3 nlm download video --output video.mp4 nlm download report --output report.md nlm download mind-map --output mindmap.json nlm download slide-deck --output slides.pdf nlm download infographic --output infographic.png nlm download data-table --output data.csv # Interactive formats (quiz/flashcards) nlm download quiz --format html --output quiz.html nlm download flashcards --format markdown --output cards.md ``` ### Research ```bash nlm research start "query" --notebook-id --mode fast # Quick search nlm research start "query" --notebook-id --mode deep # Extended research nlm research start "query" --notebook-id --source drive # Search Drive nlm research status --max-wait 300 # Poll until done nlm research import # Import sources ``` ### Studio Status ```bash nlm studio status # Check artifact generation status nlm studio delete --confirm # Delete artifact ``` ### Sharing ```bash nlm share status # View sharing settings nlm share public # Enable public link nlm share private # Disable public link nlm share invite email@example.com # Invite viewer nlm share invite email --role editor # Invite editor ``` ### Chat Configuration ```bash nlm chat configure --goal default --length default nlm chat configure --goal learning_guide --length longer nlm chat configure --goal custom --prompt "You are an expert..." ``` ### Configuration ```bash nlm config show # Show all settings nlm config get auth.default_profile # Get a specific value nlm config set auth.default_profile work # Set default profile nlm config set output.format json # Change default output format ``` **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` | Browser for login (auto, chrome, chromium) | | `auth.default_profile` | `default` | Profile to use when `--profile` not specified | ### Aliases (Shortcuts) ```bash nlm alias set myproject # Create alias nlm alias list # List all aliases nlm alias get myproject # Resolve to UUID nlm alias delete myproject # Remove alias # Use aliases anywhere nlm notebook get myproject nlm source list myproject ``` ### Skills (AI Assistant Integration) ```bash nlm skill list # Show installation status nlm skill install claude-code # Install for Claude Code nlm skill install cursor # Install for Cursor AI nlm skill install gemini-cli # Install for Gemini CLI nlm skill install --level project # Install at project level nlm skill uninstall # Remove skill nlm skill show # View skill content # Verb-first alternatives nlm install skill claude-code nlm list skills ``` **Supported Tools:** `claude-code`, `cursor`, `codex`, `opencode`, `gemini-cli`, `antigravity`, `other` ### Setup (MCP Server Configuration) Configure the NotebookLM MCP server for AI tools in one command: ```bash nlm setup add claude-code # Configure via `claude mcp add` nlm setup add claude-desktop # Write claude_desktop_config.json nlm setup add gemini # Write ~/.gemini/settings.json nlm setup add cursor # Write ~/.cursor/mcp.json nlm setup add windsurf # Write mcp_config.json nlm setup remove claude-desktop # Remove MCP configuration nlm setup remove gemini # Remove from Gemini CLI nlm setup list # Show all clients and config status ``` **Supported Clients:** `claude-code`, `claude-desktop`, `gemini`, `cursor`, `windsurf` > **Note:** `nlm setup` configures the MCP server transport. Use `nlm skill install` to install skill/reference docs for AI tools that don't use MCP. ### Doctor (Diagnostics) Run diagnostics to troubleshoot installation, authentication, and configuration issues: ```bash nlm doctor # Run all checks nlm doctor --verbose # Include additional details (Python version, paths, etc.) ``` **Checks performed:** | Category | What it checks | |----------|---------------| | Installation | Package version, `nlm` and `notebooklm-mcp` binary paths | | Authentication | Profile status, cookies present, CSRF token, account email | | Chrome | Browser installed, saved Chrome profiles for headless auth | | AI Tools | MCP configuration status for each supported client | Each issue includes a suggested fix (e.g., "Run `nlm login` to authenticate"). --- ## Output Formats | Flag | Description | |------|-------------| | (none) | Rich table format | | `--json` | JSON output | | `--quiet` | IDs only | | `--title` | "ID: Title" format | | `--full` | All columns | --- ## Complete Workflow Example ```bash # 1. Authenticate and configure nlm login nlm setup add claude-code # One-time MCP setup # 2. Create notebook and set alias nlm notebook create "AI Research" nlm alias set ai # 3. Add sources (with --wait to ensure ready) nlm source add ai --url "https://example.com/article" --wait nlm source add ai --file research.pdf --wait # 4. Generate podcast nlm audio create ai --format deep_dive --confirm # 5. Wait for generation nlm studio status ai # 6. Download when ready nlm download audio ai --output podcast.mp3 ``` --- ## Tips - Session lasts ~20 minutes; run `nlm login` if operations fail - Use `--confirm` for all create/delete commands in scripts - Use `--wait` when adding sources to ensure they're ready before querying - Use aliases for frequently-used notebooks - Audio/video takes 1-5 minutes; poll with `nlm studio status` - Use `nlm login switch ` to change the default profile - Run `nlm login profile list` to see all profiles with their associated email addresses - Run `nlm doctor` to diagnose installation, auth, or config issues - Use `nlm setup add ` to quickly configure MCP for your AI tool