| name | notebooklm |
| description | Complete API for Google NotebookLM - full programmatic access including features not in the web UI. Create notebooks, add sources, generate all artifact types, download in multiple formats. Activates on explicit /notebooklm or intent like "create a podcast about X", "install notebooklm", "add notebooklm to cowork" |
| metadata | {"version":"1.0.0","author":"sametbrr@gmail.com"} |
NotebookLM Automation
Complete programmatic access to Google NotebookLM—including capabilities not exposed in the web UI. Create notebooks, add sources (URLs, YouTube, PDFs, audio, video, images), chat with content, generate all artifact types, and download results in multiple formats.
This skill covers the local Claude Code path: install the notebooklm-py CLI on your Mac and authenticate. Fast, direct, no network overhead.
Roadmap (not yet implemented): a Cowork integration — wrapping the CLI in an MCP server, tunneling it via Cloudflare, and connecting Cowork to the public HTTPS endpoint — is planned but not part of this skill yet. Until then, NotebookLM access is only available in local terminal sessions.
Step 0: Local Setup (Run Automatically on First Use)
When this skill is triggered and notebooklm is not yet installed or authenticated, complete setup first.
Pre-flight: Check Python Version
notebooklm-py requires Python 3.10+. Check the available version before installing:
python3 --version
If Python is below 3.10 (e.g. 3.9.x which is the macOS default), install a compatible version:
macOS (Homebrew):
brew install python@3.12
Then use /opt/homebrew/bin/python3.12 (Apple Silicon) or /usr/local/bin/python3.12 (Intel) for the venv below.
Linux (apt):
sudo apt update && sudo apt install -y python3.12 python3.12-venv
Install the CLI
Always use a virtual environment to avoid "externally-managed-environment" errors and PATH issues.
Determine which Python to use — if the system python3 is 3.10+, use it directly. Otherwise use the one you just installed (e.g. python3.12):
PYTHON=$(command -v python3.12 2>/dev/null || command -v python3.11 2>/dev/null || command -v python3.10 2>/dev/null || command -v python3)
$PYTHON -c "import sys; assert sys.version_info >= (3,10), f'Python {sys.version} is too old — need 3.10+'; print(f'Using Python {sys.version}')"
$PYTHON -m venv ~/.notebooklm-venv
source ~/.notebooklm-venv/bin/activate
pip install "notebooklm-py[browser]"
playwright install chromium
Then symlink so it's always on PATH:
mkdir -p ~/bin
ln -sf ~/.notebooklm-venv/bin/notebooklm ~/bin/notebooklm
export PATH="$HOME/bin:$PATH"
grep -q 'HOME/bin' ~/.zshrc 2>/dev/null || echo 'export PATH="$HOME/bin:$PATH"' >> ~/.zshrc
Verify the CLI works:
notebooklm --help
Authenticate
IMPORTANT: The built-in notebooklm login command requires interactive terminal input (pressing Enter after sign-in). Claude Code's bash tool does NOT support interactive input, so notebooklm login will fail — the browser opens and closes instantly. Instead, use this custom login script.
Tell the user:
I'm going to open a browser window — just sign into your Google account and navigate to notebooklm.google.com. Take your time, I'll wait for you to confirm before closing it.
Then write and run this login script:
cat > /tmp/nlm_login.py << 'PYEOF'
import json, os, time
from pathlib import Path
from playwright.sync_api import sync_playwright
STORAGE_PATH = Path.home() / ".notebooklm" / "storage_state.json"
PROFILE_PATH = Path.home() / ".notebooklm" / "browser_profile"
SIGNAL_FILE = Path("/tmp/nlm_save_signal")
TIMEOUT_SECONDS = 300
SIGNAL_FILE.unlink(missing_ok=True)
STORAGE_PATH.parent.mkdir(parents=True, exist_ok=True)
os.chmod(STORAGE_PATH.parent, 0o700)
print("Opening browser for Google login...")
print("Sign in to Google and navigate to notebooklm.google.com")
with sync_playwright() as p:
browser = p.chromium.launch_persistent_context(
user_data_dir=str(PROFILE_PATH),
headless=False,
args=["--disable-blink-features=AutomationControlled"],
)
page = browser.pages[0] if browser.pages else browser.new_page()
page.goto("https://notebooklm.google.com/")
print("Browser is open. Waiting for save signal...")
waited = 0
while not SIGNAL_FILE.exists():
if waited >= TIMEOUT_SECONDS:
browser.close()
print(f"ERROR: no save signal within {TIMEOUT_SECONDS}s — browser closed, nothing saved.")
print("Re-run the login script and confirm sign-in before the timeout.")
raise SystemExit(1)
time.sleep(1)
waited += 1
print("Save signal received! Capturing session...")
storage = browser.storage_state()
with open(STORAGE_PATH, "w") as f:
json.dump(storage, f)
os.chmod(STORAGE_PATH, 0o600)
cookie_names = [c["name"] for c in storage.get("cookies", [])]
print(f"Saved {len(cookie_names)} cookies: {cookie_names}")
if not any(n in ("SID", "__Secure-1PSID") for n in cookie_names):
print("WARNING: no Google session cookie (SID / __Secure-1PSID) captured — login likely incomplete.")
print("Delete ~/.notebooklm/storage_state.json and ~/.notebooklm/browser_profile, then retry.")
browser.close()
SIGNAL_FILE.unlink(missing_ok=True)
print(f"Authentication saved to: {STORAGE_PATH}")
PYEOF
source ~/.notebooklm-venv/bin/activate
python3 /tmp/nlm_login.py > /tmp/nlm_login_output.txt 2>&1 &
echo "Login started (PID=$!). Browser should open in a few seconds..."
Wait ~10 seconds for the browser to open, then ask the user if they can see the browser and are signed in.
Once the user confirms they are on the NotebookLM homepage, save the session:
touch /tmp/nlm_save_signal
sleep 8
cat /tmp/nlm_login_output.txt
Then verify authentication:
export PATH="$HOME/bin:$PATH"
notebooklm auth check
notebooklm list
If auth passes (SID cookie present), confirm to the user that NotebookLM is set up and ready. Clean up the temp script:
rm -f /tmp/nlm_login.py /tmp/nlm_login_output.txt /tmp/nlm_save_signal
If auth fails (SID cookie missing), the user may not have fully signed in. Delete the browser profile and retry:
rm -rf ~/.notebooklm/browser_profile ~/.notebooklm/storage_state.json
Then run the login script again from the top.
When This Skill Activates
Explicit: User says "/notebooklm", "use notebooklm", "install notebooklm", or mentions the tool by name.
Intent detection: Recognize requests like:
- "Create a podcast about [topic]"
- "Summarize these URLs/documents"
- "Generate a quiz from my research"
- "Turn this into an audio overview"
- "Create flashcards for studying"
- "Generate a video explainer"
- "Make an infographic"
- "Create a mind map of the concepts"
- "Download the quiz as markdown"
- "Add these sources to NotebookLM"
Autonomy Rules
Run automatically (no confirmation):
notebooklm status - check context
notebooklm auth check - diagnose auth issues
notebooklm list - list notebooks
notebooklm source list - list sources
notebooklm artifact list - list artifacts
notebooklm language list - list supported languages
notebooklm language get - get current language
notebooklm language set - set language (global setting)
notebooklm artifact wait - wait for artifact completion
notebooklm source wait - wait for source processing
notebooklm research status - check research status
notebooklm research wait - wait for research
notebooklm use <id> - set context
notebooklm create - create notebook
notebooklm ask "..." - chat queries (without --save-as-note)
notebooklm history - display conversation history (read-only)
notebooklm source add - add sources
Ask before running:
notebooklm delete - destructive
notebooklm generate * - long-running, may fail
notebooklm download * - writes to filesystem
notebooklm ask "..." --save-as-note - writes a note
notebooklm history --save - writes a note
Quick Reference
| Task | Command |
|---|
| List notebooks | notebooklm list |
| Create notebook | notebooklm create "Title" |
| Set context | notebooklm use <notebook_id> |
| Show context | notebooklm status |
| Add URL source | notebooklm source add "https://..." |
| Add file | notebooklm source add ./file.pdf |
| Add YouTube | notebooklm source add "https://youtube.com/..." |
| List sources | notebooklm source list |
| Wait for source processing | notebooklm source wait <source_id> |
| Web research (fast) | notebooklm source add-research "query" |
| Web research (deep) | notebooklm source add-research "query" --mode deep --no-wait |
| Check research status | notebooklm research status |
| Wait for research | notebooklm research wait --import-all |
| Chat | notebooklm ask "question" |
| Chat (specific sources) | notebooklm ask "question" -s src_id1 -s src_id2 |
| Chat (with references) | notebooklm ask "question" --json |
| Chat (save answer as note) | notebooklm ask "question" --save-as-note |
| Show conversation history | notebooklm history |
| Save all history as note | notebooklm history --save |
| Get source fulltext | notebooklm source fulltext <source_id> |
| Generate podcast | notebooklm generate audio "instructions" |
| Generate video | notebooklm generate video "instructions" |
| Generate report | notebooklm generate report --format briefing-doc |
| Generate quiz | notebooklm generate quiz |
| Generate flashcards | notebooklm generate flashcards |
| Generate infographic | notebooklm generate infographic |
| Generate mind map | notebooklm generate mind-map |
| Generate slide deck | notebooklm generate slide-deck |
| Revise a slide | notebooklm generate revise-slide "prompt" --artifact <id> --slide 0 |
| Check artifact status | notebooklm artifact list |
| Wait for completion | notebooklm artifact wait <artifact_id> |
| Download audio | notebooklm download audio ./output.mp3 |
| Download video | notebooklm download video ./output.mp4 |
| Download slide deck (PDF) | notebooklm download slide-deck ./slides.pdf |
| Download slide deck (PPTX) | notebooklm download slide-deck ./slides.pptx --format pptx |
| Download report | notebooklm download report ./report.md |
| Download mind map | notebooklm download mind-map ./map.json |
| Download data table | notebooklm download data-table ./data.csv |
| Download quiz | notebooklm download quiz quiz.json |
| Download flashcards | notebooklm download flashcards cards.json |
| List languages | notebooklm language list |
| Set language | notebooklm language set zh_Hans |
Generation Types
All generate commands support:
-s, --source to use specific source(s) instead of all sources
--language to set output language (defaults to 'en')
--json for machine-readable output
--retry N to automatically retry on rate limits
| Type | Command | Options | Download |
|---|
| Podcast | generate audio | --format [deep-dive|brief|critique|debate], --length [short|default|long] | .mp3 |
| Video | generate video | --format [explainer|brief], --style [auto|classic|whiteboard|kawaii|anime|watercolor|retro-print|heritage|paper-craft] | .mp4 |
| Slide Deck | generate slide-deck | --format [detailed|presenter], --length [default|short] | .pdf / .pptx |
| Slide Revision | generate revise-slide "prompt" --artifact <id> --slide N | --wait, --notebook | (re-downloads parent deck) |
| Infographic | generate infographic | --orientation [landscape|portrait|square], --detail [concise|standard|detailed] | .png |
| Report | generate report | --format [briefing-doc|study-guide|blog-post|custom], --append "extra instructions" | .md |
| Mind Map | generate mind-map | (sync, instant) | .json |
| Data Table | generate data-table | description required | .csv |
| Quiz | generate quiz | --difficulty [easy|medium|hard], --quantity [fewer|standard|more] | .json/.md/.html |
| Flashcards | generate flashcards | --difficulty [easy|medium|hard], --quantity [fewer|standard|more] | .json/.md/.html |
Common Workflows
Research to Podcast
notebooklm create "Research: [topic]"
notebooklm source add for each URL/document
- Wait for sources:
notebooklm source list --json until all status=READY
notebooklm generate audio "Focus on [specific angle]"
- Check
notebooklm artifact list for status
notebooklm download audio ./podcast.mp3 when complete
Document Analysis
notebooklm create "Analysis: [project]"
notebooklm source add ./doc.pdf (or URLs)
notebooklm ask "Summarize the key points"
- Continue chatting as needed
Second-Brain Pattern (the "AI Brain" workflow)
- Create one permanent notebook called something like "AI Brain"
- After every working session, append a summary as a new source
- Add a project instruction: "Whenever answering questions about strategy, business context, or project history, always consult my NotebookLM AI Brain notebook first."
- Claude now checks your second brain before answering — perfect recall of everything you've ever worked on
Output Formats (--json)
{"notebooks": [{"id": "...", "title": "...", "created_at": "..."}]}
{"sources": [{"id": "...", "title": "...", "status": "ready|processing|error"}]}
{"artifacts": [{"id": "...", "title": "...", "type": "Audio Overview", "status": "in_progress|pending|completed|unknown"}]}
Error Handling
| Error | Cause | Action |
|---|
| Auth/cookie error | Session expired | Re-run the login script from Step 0 |
| "No notebook context" | Context not set | Run notebooklm use <id> |
| Rate limiting | Google throttle | Wait 5-10 min, retry |
| Download fails | Generation incomplete | Check artifact list for status |
Known Limitations
- Audio, video, quiz, flashcard, infographic, and slide deck generation may fail due to Google rate limits
- Generation times: audio 10-20 min, video 15-45 min, quiz/flashcards 5-15 min
- This is an unofficial API — Google can change things without warning
- The CLI binary is at
~/bin/notebooklm — ensure ~/bin is in PATH or call with full path