NotebookLM CLI
Overview
This skill provides complete access to Google NotebookLM through a command-line interface. Manage notebooks, sources, and generate various content formats including audio podcasts, reports, quizzes, flashcards, mind maps, slides, infographics, videos, and data tables.
When to Use This Skill
Use this skill when:
- - Managing NotebookLM notebooks and sources programmatically
- Generating audio overviews (podcasts) from notebook sources
- Creating study materials: quizzes, flashcards, reports
- Producing visual content: slides, infographics, mind maps, videos
- Querying sources via chat or one-shot questions
- Researching and importing new sources automatically
Quick Start
Authentication
CODEBLOCK0
Launches Chrome, navigates to NotebookLM, and extracts session cookies. Requires Google Chrome installed.
List Notebooks
CODEBLOCK1
Create Notebook and Add Sources
CODEBLOCK2
Generate Content (All Types)
All generation commands require --confirm or -y:
CODEBLOCK3
Authentication
| Command | Description |
|---|
| INLINECODE2 | Authenticate with NotebookLM (opens Chrome) |
| INLINECODE3 |
Verify current credentials |
|
nlm auth status | Check session validity |
|
nlm auth list | List all profiles |
|
nlm auth delete <profile> --confirm | Delete a profile |
|
nlm login --profile <name> | Login to specific profile |
Sessions last ~20 minutes. Re-authenticate with nlm login if commands fail.
Notebook Management
| Command | Description |
|---|
| INLINECODE9 | List all notebooks |
| INLINECODE10 |
Create a new notebook |
|
nlm notebook get <id> | Get notebook details |
|
nlm notebook describe <id> | AI-generated summary |
|
nlm notebook query <id> "question" | Chat with sources |
|
nlm notebook delete <id> --confirm | Delete a notebook |
Source Management
| Command | Description |
|---|
| INLINECODE15 | List sources in notebook |
| INLINECODE16 |
Show Drive sources with freshness |
|
nlm source add <id> --url "..." | Add URL or YouTube source |
|
nlm source add <id> --text "..." --title "..." | Add pasted text |
|
nlm source add <id> --drive <doc-id> | Add Google Drive document |
|
nlm source describe <source-id> | AI summary of source |
|
nlm source content <source-id> | Get raw text content |
|
nlm source stale <notebook-id> | List outdated Drive sources |
|
nlm source sync <notebook-id> --confirm | Sync Drive sources |
Content Generation
All generation commands require --confirm or -y:
Media Types
| Command | Output |
|---|
| INLINECODE26 | Audio podcast overview |
| INLINECODE27 |
Briefing doc or study guide |
|
nlm quiz create <id> --confirm | Quiz questions |
|
nlm flashcards create <id> --confirm | Flashcards |
|
nlm mindmap create <id> --confirm | Mind map |
|
nlm slides create <id> --confirm | Slide deck |
|
nlm infographic create <id> --confirm | Infographic |
|
nlm video create <id> --confirm | Video overview |
|
nlm data-table create <id> "description" --confirm | Data table extraction |
Studio (Artifact Management)
| Command | Description |
|---|
| INLINECODE35 | List all generated artifacts |
| INLINECODE36 |
Delete an artifact |
Chat
| Command | Description |
|---|
| INLINECODE37 | Start interactive REPL session |
| INLINECODE38 |
Configure chat goal and response style |
|
nlm notebook query <id> "question" | One-shot question (no session) |
Chat REPL commands: /sources, /clear, /help, INLINECODE43
Research
| Command | Description |
|---|
| INLINECODE44 | Web search (~30s) |
| INLINECODE45 |
Deep research (~5min) |
|
nlm research start "query" --notebook-id <id> --source drive | Search Google Drive |
|
nlm research status <notebook-id> | Check research progress |
|
nlm research import <notebook-id> <task-id> | Import discovered sources |
Aliases (UUID Shortcuts)
CODEBLOCK4
Output Formats
Most list commands support multiple formats:
CODEBLOCK5
Profiles (Multiple Accounts)
CODEBLOCK6
Configuration
CODEBLOCK7
AI Documentation
For AI assistants, generate comprehensive documentation:
CODEBLOCK8
Outputs 400+ lines covering all commands, authentication flow, error handling, task sequences, and automation tips.
References
NotebookLM CLI
概述
本技能提供通过命令行界面完整访问Google NotebookLM的功能。可管理笔记本和来源,并生成包括音频播客、报告、测验、闪卡、思维导图、幻灯片、信息图、视频和数据表在内的多种内容格式。
使用场景
在以下情况下使用本技能:
- - 以编程方式管理NotebookLM笔记本和来源
- 从笔记本来源生成音频概览(播客)
- 创建学习资料:测验、闪卡、报告
- 制作视觉内容:幻灯片、信息图、思维导图、视频
- 通过聊天或一次性提问查询来源
- 自动研究并导入新来源
快速入门
身份验证
bash
nlm login
启动Chrome浏览器,导航至NotebookLM,并提取会话Cookie。需要已安装Google Chrome。
列出笔记本
bash
nlm notebook list
创建笔记本并添加来源
bash
nlm notebook create 我的研究
nlm source add <笔记本ID> --url https://example.com/article
nlm source add <笔记本ID> --text 此处填写内容 --title 我的笔记
生成内容(所有类型)
所有生成命令都需要 --confirm 或 -y 参数:
bash
nlm audio create --confirm # 播客
nlm report create --confirm # 简报文档或学习指南
nlm quiz create --confirm # 测验题目
nlm flashcards create --confirm # 闪卡
nlm mindmap create --confirm # 思维导图
nlm slides create --confirm # 幻灯片
nlm infographic create --confirm # 信息图
nlm video create --confirm # 视频概览
nlm data-table create 描述 --confirm # 数据表
身份验证
| 命令 | 描述 |
|---|
| nlm login | 使用NotebookLM进行身份验证(打开Chrome) |
| nlm login --check |
验证当前凭证 |
| nlm auth status | 检查会话有效性 |
| nlm auth list | 列出所有配置文件 |
| nlm auth delete <配置文件> --confirm | 删除配置文件 |
| nlm login --profile <名称> | 登录到特定配置文件 |
会话持续时间约20分钟。如果命令失败,请使用 nlm login 重新进行身份验证。
笔记本管理
| 命令 | 描述 |
|---|
| nlm notebook list | 列出所有笔记本 |
| nlm notebook create 标题 |
创建新笔记本 |
| nlm notebook get
| 获取笔记本详情 |
| nlm notebook describe | AI生成的摘要 |
| nlm notebook query 问题 | 与来源聊天 |
| nlm notebook delete --confirm | 删除笔记本 |
来源管理
| 命令 | 描述 |
|---|
| nlm source list <笔记本ID> | 列出笔记本中的来源 |
| nlm source list <笔记本ID> --drive |
显示Drive来源及其新鲜度 |
| nlm source add --url ... | 添加URL或YouTube来源 |
| nlm source add --text ... --title ... | 添加粘贴文本 |
| nlm source add --drive <文档ID> | 添加Google Drive文档 |
| nlm source describe <来源ID> | 来源的AI摘要 |
| nlm source content <来源ID> | 获取原始文本内容 |
| nlm source stale <笔记本ID> | 列出过时的Drive来源 |
| nlm source sync <笔记本ID> --confirm | 同步Drive来源 |
内容生成
所有生成命令都需要 --confirm 或 -y 参数:
媒体类型
| 命令 | 输出 |
|---|
| nlm audio create <ID> --confirm | 音频播客概览 |
| nlm report create <ID> --confirm |
简报文档或学习指南 |
| nlm quiz create --confirm | 测验题目 |
| nlm flashcards create --confirm | 闪卡 |
| nlm mindmap create --confirm | 思维导图 |
| nlm slides create --confirm | 幻灯片 |
| nlm infographic create --confirm | 信息图 |
| nlm video create --confirm | 视频概览 |
| nlm data-table create 描述 --confirm | 数据表提取 |
工作室(工件管理)
| 命令 | 描述 |
|---|
| nlm studio status <笔记本ID> | 列出所有生成的工件 |
| nlm studio delete <笔记本ID> <工件ID> --confirm |
删除工件 |
聊天
| 命令 | 描述 |
|---|
| nlm chat start <笔记本ID> | 启动交互式REPL会话 |
| nlm chat configure <笔记本ID> |
配置聊天目标和回复风格 |
| nlm notebook query 问题 | 一次性提问(无会话) |
聊天REPL命令:/sources、/clear、/help、/exit
研究
| 命令 | 描述 |
|---|
| nlm research start 查询 --notebook-id <ID> | 网络搜索(约30秒) |
| nlm research start 查询 --notebook-id <ID> --mode deep |
深度研究(约5分钟) |
| nlm research start 查询 --notebook-id --source drive | 搜索Google Drive |
| nlm research status <笔记本ID> | 检查研究进度 |
| nlm research import <笔记本ID> <任务ID> | 导入发现的来源 |
别名(UUID快捷方式)
bash
nlm alias set myproject # 创建别名
nlm notebook get myproject # 使用别名
nlm alias list # 列出所有别名
nlm alias get myproject # 解析为UUID
nlm alias delete myproject # 删除别名
输出格式
大多数列表命令支持多种格式:
bash
nlm notebook list # 富表格(默认)
nlm notebook list --json # JSON输出
nlm notebook list --quiet # 仅显示ID(适用于脚本)
nlm notebook list --title # ID: 标题格式
nlm notebook list --full # 所有列
配置文件(多账户)
bash
nlm login --profile work # 登录到配置文件
nlm notebook list --profile work # 使用配置文件
nlm auth list # 列出所有配置文件
nlm auth delete work --confirm # 删除配置文件
配置
bash
nlm config show # 显示当前配置
nlm config get <键> # 获取特定设置
nlm config set <键> <值> # 更新设置
AI文档
为AI助手生成全面的文档:
bash
nlm --ai
输出400多行,涵盖所有命令、身份验证流程、错误处理、任务序列和自动化技巧。
参考