# Notebooklm

> Programmatic Google NotebookLM via the `nlm` CLI. Create notebooks, ingest sources (URLs, YouTube, PDFs, Drive, text), generate AI artifacts (audio overview/podcast, video, briefing doc, study guide, mind map, slide deck, infographic, quiz, flashcards), download artifacts, run cross-notebook queries. Use whenever user mentions NotebookLM, audio overview, deep-dive podcast, or wants to turn documents into a NotebookLM artifact.

- Skill: `buzzmatic/notebooklm` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add buzzmatic/notebooklm`
- Raw SKILL.md: https://api.skillmd.com/api/skills/buzzmatic/notebooklm/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: Buzzmatic (https://skillmd.com/u/buzzmatic)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/buzzmatic/notebooklm

---


# NotebookLM CLI

Wraps Google NotebookLM through the `nlm` command-line tool (`notebooklm-mcp-cli` package, installed via `uv tool install`). Talks to NotebookLM's internal API using cookies from a real browser login - no API key required.

## Authentication (check first)

Sessions last ~20 minutes. Before any operation, verify:

```bash
nlm login --check
```

If it reports "not authenticated" or "cookies expired", **the user has to run `nlm login` themselves in their terminal** - it opens a browser for Google sign-in and extracts cookies. Tell them to type `! nlm login` in the prompt (the `!` runs it in the live shell so output lands here). Do not try to launch it from a sub-agent or background bash - it needs an interactive browser.

Profiles for multiple Google accounts: `nlm login --profile work`, then `nlm login switch work` to make it default. List with `nlm login profile list`.

Auth state and cookies live in `~/.notebooklm-mcp-cli/`.

## Command structure

Two equivalent forms - pick whichever reads cleaner:

```bash
nlm notebook create "My Project"        # noun-first
nlm create notebook "My Project"        # verb-first
```

`--json` or `--quiet` for machine-readable output. `--confirm` skips destructive-action prompts (required for any non-interactive call).

## Common workflows

**Ingest URLs and generate a deep-dive podcast**

```bash
# `notebook create` prints "ID: <uuid>" - extract it:
NB=$(nlm notebook create "Topic XYZ" | awk '/^  ID:/ {print $2}')
nlm source add $NB --url "https://example.com/article-1" --wait
nlm source add $NB --url "https://example.com/article-2" --wait
nlm audio create $NB --format deep_dive --length long --confirm
# Poll until ready, then download (artifact ID goes via --id, NOT positional):
nlm studio status $NB
nlm download audio $NB --id <artifact-id> --output podcast.mp3
```

`nlm download <type> <notebook>` alone grabs the latest artifact of that type. Pass `--id` to pick a specific one.

`--wait` matters - sources must finish processing before any artifact generation will use them. Note: `--json` works on `list`-type commands (`nlm notebook list --json`) but not on `create`; parse stdout for the ID, or alias the notebook with `nlm alias set my-nb <id>` once you have it.

**Briefing doc / study guide / blog post from existing notebook**

```bash
nlm report create $NB --format "Briefing Doc" --confirm
nlm report create $NB --format "Study Guide" --confirm
nlm download report $NB --id <artifact-id> --output briefing.md
```

Report formats: `"Briefing Doc"`, `"Study Guide"`, `"Blog Post"`, `"Create Your Own"` (pass with `--description "..."`).

**One-shot pipeline (ingest + multiple artifacts)**

```bash
nlm pipeline list                                                # see built-ins
nlm pipeline run $NB ingest-and-podcast --url "https://..."
nlm pipeline run $NB research-and-report --url "https://..."
nlm pipeline run $NB multi-format
```

Custom pipelines: drop YAML in `~/.notebooklm-mcp-cli/pipelines/`.

**Query / chat across notebooks**

```bash
nlm notebook query $NB "What are the three biggest risks?"
nlm cross query "Compare approaches" --notebooks "id1,id2"
nlm cross query "Summarize all" --tags "ai,research"
```

**Aliases for IDs you reuse**

```bash
nlm alias set my-research <notebook-id>
nlm notebook query my-research "..."
```

## Studio artifact types (cheat sheet)

| Type | Command | Key flags |
|---|---|---|
| Audio (podcast) | `nlm audio create $NB` | `--format deep_dive\|brief\|critique\|debate`, `--length short\|default\|long` |
| Video | `nlm video create $NB` | `--format explainer\|brief\|cinematic`, `--style classic\|whiteboard\|kawaii\|...` |
| Report | `nlm report create $NB` | `--format "Briefing Doc"\|"Study Guide"\|"Blog Post"\|"Create Your Own"` |
| Mind map | `nlm mindmap create $NB` | |
| Slide deck | `nlm slides create $NB` | `nlm slides revise <art-id> --slide '1 Make title bigger'` to edit |
| Infographic | `nlm infographic create $NB` | `--orientation landscape\|portrait`, `--style professional\|...` |
| Quiz | `nlm quiz create $NB` | `--count 10 --difficulty medium --focus "..."` |
| Flashcards | `nlm flashcards create $NB` | `--difficulty hard --focus "..."` |
| Data table | `nlm data-table create $NB` | `--description "..."` |

All take `--confirm` for unattended use. Audio/video typically takes 1-5 minutes - poll with `nlm studio status $NB` (or `--wait`).

## Source types

```bash
nlm source add $NB --url "https://..."           # web page
nlm source add $NB --youtube "https://..."       # YouTube transcript
nlm source add $NB --file path/to/document.pdf   # local file (PDF, etc.)
nlm source add $NB --text "raw content" --title "Notes"
nlm source add $NB --drive <google-doc-id>       # requires Drive access on the same Google account
nlm source sync $NB --confirm                    # re-fetch Drive sources
nlm source stale $NB                             # show sources needing sync
```

Add `--wait` whenever the next step depends on the source being processed.

## Saving downloads

Download artifacts into the `output/` directory under the current working directory:

```bash
mkdir -p output
nlm download audio $NB --id <art-id> --output output/podcast.mp3
nlm download report $NB --id <art-id> --output output/briefing.md
```

## Gotchas

- **Free tier ~50 queries/day.** Batch and pipeline commands burn through this fast.
- **Always pass `--confirm`** for create/delete from a script - the CLI prompts otherwise and will hang.
- **Always pass `--wait`** to `source add` when the next step uses that source.
- **Unofficial API** - the package wraps NotebookLM's internal endpoints, so behavior can change. If something breaks unexpectedly, run `nlm doctor` first.
- **Rate-limit safety**: prefer `nlm cross query --notebooks "id1,id2"` over running the same query N times.
- **German output**: NotebookLM follows source language. If sources are German, generated artifacts will be German - real umlauts come through fine, no transliteration concerns.

## Diagnostics

```bash
nlm doctor                  # checks install, auth, browser, MCP setup
nlm doctor --verbose
```

## MCP server (optional)

The same package ships an MCP server (`notebooklm-mcp`). To expose NotebookLM as MCP tools to Claude Code at user scope:

```bash
nlm setup add claude-code
```

This skill assumes CLI usage by default. If MCP tools named `mcp__notebooklm-mcp__*` appear in the tool list, prefer those (they avoid shell quoting).

## Full reference

`references/cli_reference.md` is the verbatim `nlm --ai` dump (every command, every flag, every recovery flow). Read it when a non-obvious command or edge case comes up. Or run `nlm --ai` directly to see the latest version after upgrades.

Install / upgrade:
```bash
uv tool install notebooklm-mcp-cli       # first install
uv tool upgrade notebooklm-mcp-cli       # update
```

