| name | nlm |
| description | This skill should be used when the user asks to "create a notebook", "add source to notebook", "generate audio overview", "create podcast", "manage NotebookLM", "nlm", "add PDF to notebook", "list notebooks", "summarize sources", "generate study guide", "create FAQ", "briefing document", "chat with notebook", "generate outline", "slide deck", "research a topic", "deep research", or needs to interact with Google NotebookLM via the nlm CLI tool. |
| version | 0.3.0 |
| user-invocable | false |
NotebookLM CLI (nlm)
Manage Google NotebookLM notebooks, sources, notes, chat, and generated content (audio/video overviews, slide decks, apps, reports) via the nlm command-line tool.
Requires: nlm on PATH (nix-managed, built from upstream tmc/nlm). Install/update via cd ~/nix && nix run .#build-switch.
Check: command -v nlm || echo "MISSING: nlm CLI not installed"
Command structure: the CLI uses subcommand groups — nlm <group> <action> (e.g. nlm notebook list, nlm source add, nlm audio create). The older flat aliases (nlm list, nlm add, nlm audio-create, …) were removed in upstream's parser migration. When unsure of exact syntax, run nlm --help or nlm <group> --help — it's authoritative. The references/*.md files predate the migration and may be stale.
Authentication
Before first use, authenticate with Google:
nlm auth login -all
This connects to Chrome via CDP (Chrome DevTools Protocol) to extract cookies from an active NotebookLM session. Credentials are stored in ~/.nlm/env.
Troubleshooting Authentication
If nlm auth fails with "no valid profiles found" or "SESSION_COOKIE_INVALID":
-
Verify Chrome is running with remote debugging:
ps aux | grep -E "chrome.*remote-debugging-port=9400"
If not running, Chrome needs to be started with --remote-debugging-port=9400.
-
Test CDP connection: curl http://localhost:9400/json/version (should return Chrome version JSON).
-
Re-authenticate with debug: nlm auth login -debug -all (shows which profiles are checked and why).
-
Verify: nlm notebook list should list notebooks without errors.
You can also point at a remote CDP socket: nlm auth login -cdp-url ws://localhost:9222, or pick a Google account index with -authuser 1.
Core Commands
Notebooks
nlm notebook list
nlm notebook create "Research Notes"
nlm notebook rename <nb-id> "New Title"
nlm notebook delete <nb-id>
nlm notebook description <nb-id> [text]
nlm notebook emoji <nb-id> <emoji>
nlm notebook featured
nlm analytics <nb-id>
Sources
nlm source list <nb-id>
nlm source add <nb-id> <file|url|-> [more...]
nlm source add <nb-id> https://www.youtube.com/watch?v=VIDEO_ID
nlm source rename <source-id> "New Name"
nlm source delete <nb-id> <source-id|a,b,c|->
nlm source refresh <nb-id> <source-id>
nlm source read <source-id> [nb-id]
nlm source sync <nb-id> [paths...]
nlm discover-sources <nb-id> "query"
Notes
nlm note list <nb-id>
nlm note read <nb-id> <note-id>
nlm note create <nb-id> "Title" ["content"]
nlm note update <nb-id> <note-id> "content" "Title"
nlm note delete <nb-id> <note-id>
Chat & research
nlm generate-chat <nb-id> "What are the main themes?"
nlm chat <nb-id> ["prompt"]
nlm chat <nb-id> -f prompt.txt
nlm chat <nb-id> --source-match <regex>
nlm research <nb-id> "query" --mode=fast|deep [--md]
Source → output transforms
All take <nb-id> [source-id...] (omit source ids to use all sources):
| Command | Purpose |
|---|
summarize / briefing-doc | Summary / professional briefing |
study-guide / faq | Key concepts + review questions / FAQ |
outline / toc / timeline | Outline / table of contents / timeline |
rephrase / expand / explain | Reword / elaborate / simplify |
critique / verify | Critique / fact-check |
brainstorm | Ideate from sources |
mindmap <nb-id> <source-id> [...] | Interactive mindmap (opens in browser) |
nlm summarize <nb-id>
nlm study-guide <nb-id> <source-id-1> <source-id-2>
Audio & video overviews
nlm audio create <nb-id> "Focus on key themes, professional tone"
nlm audio list <nb-id>
nlm audio get <nb-id>
nlm audio download <nb-id> [output.mp3]
nlm audio share <nb-id> [--public]
nlm audio delete <nb-id>
nlm audio-suggestions <nb-id>
nlm video create <nb-id> "instructions"
nlm video list <nb-id>
nlm video get <nb-id>
nlm video download <nb-id> [output.mp4]
Slide decks, apps, reports (added upstream)
nlm deck create [--format detailed|presenter] <nb-id> ["instructions"]
nlm deck download <nb-id> --id <artifact-id> [--format pdf|pptx] [--output file]
nlm app create --type prototype|mindmap|canvas <nb-id> ["instructions"]
nlm mindmap create <nb-id> ["instructions"]
nlm report-suggestions <nb-id>
nlm create-report <nb-id> <report-type> [description] [instructions]
nlm generate-report <nb-id> [--sections ...]
nlm artifact list <nb-id>
nlm artifact get <artifact-id>
nlm artifact update <artifact-id> [new-title]
nlm artifact delete <artifact-id>
Labels (autolabel clusters)
nlm label list <nb-id>
nlm label generate <nb-id>
nlm label create <nb-id> <name> [emoji]
nlm label attach <nb-id> <label-id> <source-id>
nlm label unlabeled <nb-id>
Sharing & other
nlm share <nb-id>
nlm share-private <nb-id>
nlm generate-guide <nb-id>
nlm magic <nb-id> [source-id...]
nlm mcp
nlm account
nlm refresh
Exit codes: 0 ok · 2 bad args · 3 auth required/invalid · 4 not found · 5 precondition (quota, source cap, wrong type) · 6 transient (rate limit/5xx) · 7 busy (still generating).
Workflows
For longer recipes (research → study materials, content analysis, Readwise→NLM import), see references/workflows.md (note: predates the parser migration — translate flat commands to the subcommand form above).
Quick start — automated research:
id=$(nlm notebook create "Topic Research")
nlm research "$id" "your topic" --mode=deep
nlm generate-chat "$id" "What are the key findings?"
Troubleshooting
- Auth errors (exit 3):
nlm auth login -all to re-authenticate; nlm refresh to refresh credentials.
- Debug mode: add
-debug for detailed API interaction logs.
- Resource busy (exit 7): generation (audio/video/deck/report) is async — re-run the
get/list/artifact get command until it's ready.
- Authoritative syntax:
nlm --help and nlm <group> --help always reflect the installed binary.
Environment Variables
NLM_AUTH_TOKEN: Authentication token (managed by the auth command)
NLM_COOKIES: Authentication cookies (managed by the auth command)
NLM_BROWSER_PROFILE: Chrome/Brave profile to use (default: "Default")
NLM_AUTHUSER: Google account index for multi-account profiles