nlm-skill
Interface with Google NotebookLM via CLI or MCP tools to manage notebooks, sources, and automate content creation.
Install
mkdir -p .claude/skills/nlm-skill && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/1717" && unzip -o skill.zip -d .claude/skills/nlm-skill && rm skill.zipInstalls to .claude/skills/nlm-skill
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Expert guide for the NotebookLM CLI (`nlm`) and MCP server - interfaces for Google NotebookLM. Use this skill when users want to interact with NotebookLM programmatically, including: creating/managing notebooks, adding sources (URLs, YouTube, text, Google Drive), generating content (podcasts, reports, quizzes, flashcards, mind maps, slides, infographics, videos, data tables), conducting research, chatting with sources, or automating NotebookLM workflows. Triggers on mentions of \"nlm\", \"notebooklm\", \"notebook lm\", \"podcast generation\", \"audio overview\", \"refactor document\", \"critique draft\", or any NotebookLM-related automation task.Key capabilities
- →Create and manage NotebookLM notebooks
- →Add various source types to notebooks, including URLs, YouTube videos, text, and Google Drive documents
- →Generate content like podcasts, reports, quizzes, and mind maps from notebook sources
- →Conduct research within NotebookLM
- →Chat with sources in NotebookLM
- →Automate NotebookLM workflows using CLI commands or MCP tools
How it works
The skill provides guidance for interacting with NotebookLM through either the `nlm` CLI or MCP tools, based on tool availability and user preference. It supports various operations like notebook management, source addition, and content generation.
Inputs & outputs
When to use nlm-skill
- →Create and manage NotebookLM notebooks
- →Add YouTube and URL sources to notebooks
- →Automate generation of audio overviews and podcasts
- →Draft reports and summaries from notebook sources
About this skill
Gemini Notebook CLI & MCP Expert
This skill provides comprehensive guidance for using Gemini Notebook via both the nlm CLI and MCP tools.
Tool Detection (CRITICAL - Read First!)
ALWAYS check which tools are available before proceeding:
- Check for MCP tools: Look for tools starting with
mcp__gemini-notebook-mcp__*ormcp_gemini_notebook_mcp_* - If BOTH MCP tools AND CLI are available: ASK the user which they prefer to use before proceeding
- If only MCP tools are available: Use them directly (refer to tool docstrings for parameters)
- If only CLI is available: Use
nlmCLI commands via Bash
Decision Logic:
has_mcp_tools = check_available_tools() # Look for mcp__gemini-notebook-mcp__* or mcp_gemini_notebook_mcp_*
has_cli = check_bash_available() # Can run nlm commands
if has_mcp_tools and has_cli:
# ASK USER: "I can use either MCP tools or the nlm CLI. Which do you prefer?"
user_preference = ask_user()
else if has_mcp_tools:
# Use MCP tools directly
mcp__gemini-notebook-mcp__notebook_list()
else:
# Use CLI via Bash
bash("nlm notebook list")
This skill documents BOTH approaches. Choose the appropriate one based on tool availability and user preference.
Quick Reference
Run nlm --ai to get comprehensive AI-optimized documentation - this provides a complete view of all CLI capabilities.
nlm --help # List all commands
nlm <command> --help # Help for specific command
nlm --ai # Full AI-optimized documentation (RECOMMENDED)
nlm --version # Check installed version
Critical Rules (Read First!)
- Authenticate when needed: Run
nlm loginfor first-time setup or confirmed stale/missing credentials. Saved cookies often remain usable for weeks. - Do not confuse network failures with expired auth:
auth_status="unverified"means the probe was inconclusive. Check connectivity or try an API call before asking the user to log in again. - Auto-Authentication Recovery: The CLI includes automatic 3-layer auth recovery (CSRF refresh -> Token reload -> Headless Auth) and 3x server error retries. Most errors are handled automatically. You only need to manually run
nlm loginif all recovery layers fail. - ⚠️ ALWAYS ASK USER BEFORE DELETE: Before executing ANY delete command, ask the user for explicit confirmation. Deletions are irreversible. Show what will be deleted and warn about permanent data loss.
- Always obtain approval before generation or deletion: Direct
studio_createand delete operations enforce--confirm/confirm=True. The current MCP batch Studio path does not enforce its confirm parameter, so the agent must preserve the approval gate. - Research needs a destination: Pass
--notebook-id <id>for an existing notebook or--title <title>to create one. - Capture IDs from output: Create/start commands return IDs needed for subsequent operations
- Use aliases: Simplify long UUIDs with
nlm alias set <name> <uuid> - Check aliases before creating: Run
nlm alias listbefore creating a new alias to avoid conflicts with existing names. - DO NOT launch REPL: Never use
nlm chat start- it opens an interactive REPL that AI tools cannot control. Usenlm notebook queryfor one-shot Q&A instead. - Choose output format wisely: Default output (no flags) is compact and token-efficient—use it for status checks. Use
--quietto capture IDs for piping. Only use--jsonwhen you need to parse specific fields programmatically. - Use
--helpwhen unsure: Runnlm <command> --helpto see available options and flags for any command. - Studio: fast track by default: Infer format/style/prompt silently—one compact line, then
studio_create(confirm=True). No intake questionnaires. Fast track reduces clarifying questions, not the confirm gate. Cinematic video is always guided (quota-limited). Full preview only when vague, high-stakes, cinematic, or user asks. See references/studio-prompting-guide.md.
Current MCP surface: 43 tools. Consolidated action tools include note,
label, studio_status, batch, pipeline, and tag. Consolidated type
tools include source_add, studio_create, and download_artifact.
Workflow Decision Tree
Use this to determine the right sequence of commands:
User wants to...
│
├─► Work with NotebookLM for the first time
│ └─► nlm login → nlm notebook create "Title"
│
├─► Add content to a notebook
│ ├─► From a URL/webpage → nlm source add <nb-id> --url "https://..."
│ ├─► From YouTube → nlm source add <nb-id> --url "https://youtube.com/..."
│ ├─► From pasted text → nlm source add <nb-id> --text "content" --title "Title"
│ ├─► From Google Drive → nlm source add <nb-id> --drive <doc-id> --type doc
│ └─► Discover new sources → nlm research start "query" --notebook-id <nb-id>
│
├─► Generate content from sources (→ Studio Prompting for optimal focus_prompt)
│ ├─► Podcast/Audio → nlm audio create <nb-id> --confirm
│ ├─► Written summary → nlm report create <nb-id> --confirm
│ ├─► Study materials → nlm quiz/flashcards create <nb-id> --confirm
│ ├─► Visual content → nlm mindmap/slides/infographic create <nb-id> --confirm
│ ├─► Video → nlm video create <nb-id> --confirm
│ └─► Extract data → nlm data-table create <nb-id> "description" --confirm
│
├─► Refactor, critique, or improve a draft document
│ └─► See Workflow 15 in references/workflows.md
│
├─► Ask questions about sources
│ └─► nlm notebook query <nb-id> "question"
│ (Use --conversation-id for follow-ups)
│ ⚠️ Do NOT use `nlm chat start` - it's a REPL for humans only
│
├─► Review or export a past chat
│ └─► nlm chats list <nb-id> → nlm chats get/export <nb-id> [conversation-id]
│
├─► Check generation status
│ └─► nlm studio status <nb-id>
│
└─► Manage/cleanup
├─► List notebooks → nlm notebook list
├─► List sources → nlm source list <nb-id>
├─► Delete source → nlm source delete <source-id> --confirm
└─► Delete notebook → nlm notebook delete <nb-id> --confirm
Command Categories
1. Authentication
MCP Authentication
If using MCP tools and encountering authentication errors:
# Run the CLI authentication (works for both CLI and MCP)
nlm login
# Then reload tokens in MCP
mcp__gemini-notebook-mcp__refresh_auth()
# Returns status: "success" (valid), "expired" (tokens dead, run `nlm login`),
# or "error". `nlm login` is the only recovery path for "expired".
Or manually save cookies via MCP (fallback):
# Extract cookies from Chrome DevTools and save
mcp__gemini-notebook-mcp__save_auth_tokens(cookies="<cookie_header>")
#### CLI Authentication
```bash
nlm login # Launch browser, extract cookies (primary method)
nlm login --check # Validate current session
nlm login --profile work # Use named profile for multiple accounts
nlm login --provider openclaw --cdp-url http://127.0.0.1:18800 # External CDP provider
nlm login switch <profile> # Switch the default profile
nlm login profile list # List all profiles with email addresses
nlm login profile delete <name> # Delete a profile
nlm login profile rename <old> <new> # Rename a profile
Multi-Profile Support: Each profile gets its own isolated browser session (supports Chrome, Arc, Brave, Edge, Chromium, Firefox, and more), so you can be logged into multiple Google accounts simultaneously.
Auth status: configured means usable; stale means run nlm login;
not_configured means first-time setup is required; unverified means the
probe was inconclusive; error means the health check itself failed.
Switching MCP Accounts: The MCP server always uses the active default profile. If you need to switch which Google account the MCP server is communicating with, you MUST use the CLI: run nlm login switch <name>. Your next MCP tool call will instantly use the new account.
Note: Both MCP and CLI share the same authentication backend, so authenticating with one works for both.
2. Notebook Management
MCP Tools
Use notebook_list, notebook_create, notebook_get, notebook_describe,
notebook_query, notebook_rename, and notebook_delete. The
get/describe/query/rename/delete tools require notebook_id; list and create
do not. Delete requires confirm=True.
For large notebooks or long-running questions, call notebook_query_start,
then poll notebook_query_status(query_id) until completed or errored.
CLI Commands
nlm notebook list # List all notebooks
nlm notebook list --json # JSON output for parsing
nlm notebook list --quiet # IDs only (for scripting)
nlm notebook create "Title" # Create notebook, returns ID
nlm notebook create "Title" --json # Stable machine-readable ID capture
nlm notebook get <id> # Get notebook details
nlm notebook describe <id> # AI-generated summary + suggested topics
nlm notebook query <id> "question" # One-shot Q&A with sources
nlm notebook rename <id> "New Title" # Rename notebook
nlm notebook delete <id> --confirm # PERMANENT deletion
3. Source Management
MCP Tools
Use source_add with these source_type values:
url- Web page or YouTube URL (urlparam)text- Pasted content (text+titleparams)file- Server-local file upload (file_pathparam). The path must exist on the machine running the MCP server, not merely on the client host. Local admission is case-insensitive and follows the official 43-extension contract: OFFICIAL_FILE_EXTENSIONS: .pdf, .txt, .md, .docx, .csv, .pptx, .epub, .avif, .bmp, .gif, .heic, .heif, .ico, .jp2, .jpe, .jpeg, .jpg, .png, .tif, .tiff, .webp, .3g2, .3gp, .aac, .aif, .aifc
Content truncated.
When not to use it
- →When the user wants to launch an interactive REPL session
- →When the user wants to delete items without explicit confirmation
Limitations
- →The skill cannot control an interactive REPL launched by `nlm chat start`
- →Cinematic video generation is quota-limited
- →The agent must preserve the approval gate for `studio_create` and delete operations
How it compares
This skill offers programmatic control over NotebookLM features via CLI or MCP tools, enabling automation and integration into workflows, unlike manual interaction with the NotebookLM web interface.
Compared to similar skills
nlm-skill side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| nlm-skill (this skill) | 8 | 27d | Review | Intermediate |
| context-gatherer | 0 | 4mo | No flags | Beginner |
| ks | 0 | 2mo | No flags | Beginner |
| auto | 0 | 3mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
context-gatherer
arozumenko
Gather cross-channel context (local KB, email, Teams chats, optional web) about a person and topic before responding. Use when the user says "what do we know about X", "find prior discussions with Y", "context on this thread", or before drafting any reply where prior history matters.
ks
DoIT-Artificial-Intelligence
(Kitchen Sink) Process a YouTube video with all features (summary, Q&A, infographic, audio, and video).
auto
RintaroMasaoka
Autonomously execute research cycles. Specify the cycle limit as an argument (e.g., /auto 2). Default: 5.
autoresearch
abhidya
Stateful validator-gated research loop with native-hook persistence
idea-discovery
Shallow-W
Workflow 1: Full idea discovery pipeline. Orchestrates research-lit → idea-creator → novelty-check → research-review to go from a broad research direction to validated, pilot-tested ideas. Use when user says \"找idea全流程\", \"idea discovery pipeline\", \"从零开始找方向\", or wants the complete idea explorati
learn-new-things
Abilityai
Continuous learning heartbeat - autonomously researches, extracts insights, and expands knowledge base