Generating Slides with NotebookLM
The open notebooklm-py CLI turns your documents into slide decks (PPTX/PDF), infographics (PNG), and mind maps using Google NotebookLM. Generation happens server-side inside your own Google account; the CLI drives a headless browser and retrieves the output.
Everything below is self-contained — you can do it from scratch on any machine with Python and a Google account. No special repository or checkout is required.
Our machines are Windows, some with WSL. All commands run in a terminal: use PowerShell or Command Prompt on native Windows, or your WSL shell if you work in Linux. Where a file path differs between the two, both are shown.
Prerequisites
| Requirement | Notes |
|---|---|
Python 3.10+ and pip | Check python --version. Install from python.org (Windows) or your WSL distro's package manager. |
| A Google account with NotebookLM access | Slides are generated in your Google account, so you sign in as yourself. |
Steps
1. Install the CLI (one-time)
pip install notebooklm-py
playwright install chromium
This installs the notebooklm CLI plus a Chromium browser for it to drive. (If you prefer an isolated install, pipx install notebooklm-py works too — just run playwright install chromium afterward.)
2. Authenticate with NotebookLM
notebooklm login
This opens a browser for Google sign-in. Your session is saved to a local file:
| Environment | Path |
|---|---|
| Windows | %USERPROFILE%\.notebooklm\storage_state.json |
| WSL / Linux | ~/.notebooklm/storage_state.json |
The auth token has roughly a 24-hour TTL. When it expires, just re-run notebooklm login.
3. Create a notebook and add your sources
# Create a notebook and make it the active context
notebooklm create "Onboarding Deck"
notebooklm use "Onboarding" # partial name/ID match is fine
# Add sources — files, inline text, or URLs (auto-detected)
notebooklm source add ./overview.md
notebooklm source add "Key points I want covered in the deck"
notebooklm source add https://example.com/reference
.mdx filesNotebookLM's upload API rejects the .mdx extension. If your source is .mdx, copy its contents into a .md or .txt file first (or paste the text inline with source add "..."). .md, .txt, .pdf, and .docx add directly.
4. Generate the slide deck
notebooklm generate slide-deck "executive summary for new-hire onboarding" --format detailed --wait
--format detailed(full content slides) or--format presenter(speaker-friendly with notes)--waitblocks until it's done. Prefer to run other things meanwhile? Omit--wait, then poll withnotebooklm artifact wait <artifact-id>.
Slides are built server-side in your Google account and take 10–15 minutes. Keep the terminal/session alive for the duration — don't let the machine sleep.
5. Download the deck
notebooklm download slide-deck onboarding.pptx --format pptx
Use a .pdf filename (and --format pdf) if you'd rather have a PDF.
6. Clean up
Notebooks have no auto-expiry, so remove the one you created when you're done:
notebooklm delete -n "Onboarding" --yes
Tips & Constraints
- Timing varies by output type: infographics take 2–5 minutes each, mind maps about 5 seconds, slides 10–15 minutes.
- Other artifact types use the same pattern — swap
slide-deckforinfographic,mind-map,report,quiz,flashcards,data-table,audio, orvideo:notebooklm generate infographic "one-page architecture overview" --wait
notebooklm download infographic overview.png - Discover what you've made:
notebooklm artifact listshows every artifact in the active notebook. - Machine-readable output: add
--jsonto most commands for scripting.
Optional: Claude Code slash-command integration
If you use Claude Code, the CLI can register itself as a skill so you can generate visuals conversationally instead of by hand:
notebooklm skill --help
This is optional — the plain CLI above works everywhere without it.
Frequently Asked Questions
Q: Why does slide generation take so long?
The rendering happens server-side inside NotebookLM in your Google account — it's not local. Budget 10–15 minutes and keep the session open (or use --no-wait and poll with notebooklm artifact wait).
Q: My .mdx file won't add as a source.
NotebookLM rejects the .mdx extension. Copy the contents into a .md/.txt file, or paste them inline with notebooklm source add "...".
Q: Do notebooks clean themselves up?
No — there's no auto-expiry. Delete them yourself with notebooklm delete -n <partial-id> --yes.
Q: My auth stopped working mid-week.
The token TTL is ~24 hours. Re-run notebooklm login to refresh it.