NotebookLM CLI
Use nlm to list notebooks, select a target, and ask questions via generate-chat or chat.
Workflow
- •
Verify CLI
- •
command -v nlm(if missing, ask how they want to install)
- •
- •
Verify auth
- •Check
~/.nlm/envor env varsNLM_AUTH_TOKEN,NLM_COOKIES - •If missing, run:
- •
nlm auth --all --notebooks - •If profiles are locked:
NLM_USE_ORIGINAL_PROFILE=1 nlm auth --all --notebooks --debug
- •
- •If auth still fails, fail fast and ask the user to complete browser login manually
- •Check
- •
Select notebook
- •
nlm list(shows recent) - •Ask user to pick an ID if not provided
- •
- •
Interact
- •Headless single question:
nlm generate-chat <notebook-id> "<prompt>" - •Interactive session:
nlm chat <notebook-id> - •Source-based transformations: ask for source IDs, then use
summarize,explain,outline,faq,briefing-doc,timeline,toc
- •Headless single question:
- •
Guardrails
- •Always confirm before destructive operations:
rm,rm-source,rm-note,delete-artifact,audio-rm - •Confirm before privacy-impacting actions:
share(public) andshare-private
- •Always confirm before destructive operations:
Quick commands
bash
nlm list nlm generate-chat <notebook-id> "Question about my knowledge base" nlm chat <notebook-id>
Notes
- •If user says "talk to my knowledge base", ask which notebook ID to use
- •No implicit state: do not assume a last-used notebook