介绍
# NotebookLM CLI
## 概述
该技能通过命令行界面提供对 Google NotebookLM 的完整访问权限。管理笔记本和来源,并生成各种内容格式,包括音频播客、报告、测验、抽认卡、思维导图、幻灯片、信息图、视频和数据表。
## 何时使用此技能
在以下情况使用此技能: - 以编程方式管理 NotebookLM 笔记本和来源 - 从笔记本来源生成音频概述(播客) - 创建学习材料:测验、抽认卡、报告 - 生成视觉内容:幻灯片、信息图、思维导图、视频 - 通过聊天或一次性提问查询来源 - 自动研究并导入新来源
## 快速开始
### 身份验证
```bash nlm login ```
启动 Chrome,导航至 NotebookLM,并提取会话 Cookie。需要安装 Google Chrome。
### 列出笔记本
```bash nlm notebook list ```
### 创建笔记本并添加来源
```bash nlm notebook create "My Research" nlm source add <notebook-id> --url "https://example.com/article" nlm source add <notebook-id> --text "Your content here" --title "My Notes" ```
### 生成内容(所有类型)
所有生成命令都需要 `--confirm` 或 `-y`:
```bash nlm audio create <id> --confirm # Podcast nlm report create <id> --confirm # 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 ```
## 身份验证
| 命令 | 描述 | |---------|-------------| | `nlm login` | 使用 NotebookLM 进行身份验证(打开 Chrome) | | `nlm login --check` | 验证当前凭据 | | `nlm auth status` | 检查会话有效性 | | `nlm auth list` | 列出所有配置文件 | | `nlm auth delete <profile> --confirm` | 删除配置文件 | | `nlm login --profile <name>` | 登录特定配置文件 |
会话持续约 20 分钟。如果命令失败,请使用 `nlm login` 重新进行身份验证。
## 笔记本管理
| 命令 | 描述 | |---------|-------------| | `nlm notebook list` | 列出所有笔记本 | | `nlm notebook create "Title"` | 创建新笔记本 | | `nlm notebook get <id>` | 获取笔记本详细信息 | | `nlm notebook describe <id>` | AI 生成的摘要 | | `nlm notebook query <id> "question"` | 与来源聊天 | | `nlm notebook delete <id> --confirm` | 删除笔记本 |
## 来源管理
| 命令 | 描述 | |---------|-------------| | `nlm source list <notebook-id>` | 列出笔记本中的来源 | | `nlm source list <notebook-id> --drive` | 显示带有新鲜度的 Drive 来源 | | `nlm source add <id> --url ""...""` | 添加 URL 或 YouTube 来源 | | `nlm source add <id> --text ""..."" --title ""...""` | 添加粘贴的文本 | | `nlm source add <id> --drive <doc-id>` | 添加 Google Drive 文档 | | `nlm source describe <source-id>` | 来源的 AI 摘要 | | `nlm source content <source-id>` | 获取原始文本内容 | | `nlm source stale <notebook-id>` | 列出过时的 Drive 来源 | | `nlm source sync <notebook-id> --confirm` | 同步 Drive 来源 |
## 内容生成
所有生成命令都需要 `--confirm` 或 `-y`:
### 媒体类型
| 命令 | 输出 | |---------|--------| | `nlm audio create <id> --confirm` | 音频播客概述 | | `nlm report create <id> --confirm` | 简报文档或学习指南 | | `nlm quiz create <id> --confirm` | 测验问题 | | `nlm flashcards create <id> --confirm` | 抽认卡 | | `nlm mindmap create <id> --confirm` | 思维导图 | | `nlm slides create <id> --confirm` | 演示文稿幻灯片 | | `nlm infographic create <id> --confirm` | 信息图 | | `nlm video create <id> --confirm` | 视频概述 | | `nlm data-table create <id> "description" --confirm` | 数据表提取 |
## Studio(制品管理)
| 命令 | 描述 | |---------|-------------| | `nlm studio status <notebook-id>` | 列出所有生成的制品 | | `nlm studio delete <notebook-id> <artifact-id> --confirm` | 删除制品 |
## 聊天
| 命令 | 描述 | |---------|-------------| | `nlm chat start <notebook-id>` | 启动交互式 REPL 会话 | | `nlm chat configure <notebook-id>` | 配置聊天目标和回复风格 | | `nlm notebook query <id> "question"` | 一次性提问(无会话) |
聊天 REPL 命令:`/sources`、`/clear`、`/help`、`/exit`
## 研究
| 命令 | 描述 | |---------|-------------| | `nlm research start "query" --notebook-id <id>` | 网络搜索(约 30 秒) | | `nlm research start "query" --notebook-id <id> --mode deep` | 深度研究(约 5 分钟) | | `nlm research start "query" --notebook-id <id> --source drive` | 搜索 Google Drive | | `nlm research status <notebook-id>` | 检查研究进度 | | `nlm research import <notebook-id> <task-id>` | 导入发现的来源 |
## 别名(UUID 快捷方式)
```bash nlm alias set myproject <uuid> # Create alias nlm notebook get myproject # Use alias nlm alias list # List all aliases nlm alias get myproject # Resolve to UUID nlm alias delete myproject # Remove alias ```
## 输出格式
大多数列表命令支持多种格式:
```bash nlm notebook list # Rich table (default) nlm notebook list --json # JSON output nlm notebook list --quiet # IDs only (for scripting) nlm notebook list --title # "ID: Title" format nlm notebook list --full # All columns ```
## 配置文件(多账户)
```bash nlm login --profile work # Login to profile nlm notebook list --profile work # Use profile nlm auth list # List all profiles nlm auth delete work --confirm # Delete profile ```
## 配置
```bash nlm config show # Show current configuration nlm config get <key> # Get specific setting nlm config set <key> <value> # Update setting ```
## AI 文档
对于 AI 助手,生成综合文档:
```bash nlm --ai ```
输出 400 多行,涵盖所有命令、身份验证流程、错误处理、任务序列和自动化技巧。
## 参考
- [命令参考](references/commands.md) - 完整的命令签名 - [故障排除](references/troubleshooting.md) - 错误诊断和解决方案 - [工作流](references/workflows.md) - 端到端任务序列