Obtain content from multiple sources, upload to NotebookLM to generate various outputs; or browse, query, and ask questions about existing notebooks.
Dependencies:notebooklm-py(CLI v0.3.3+)、markitdown(PPTX/XLSX/EPUB conversion only). First-time use requires notebooklm login。
Decision Tree
用戶請求
├── 想找/瀏覽/查詢/下載既有 notebook 或成品?
│ └── Workflow B:瀏覽 → 閱讀 → 提問
├── 有內容要上傳 / 要生成新東西?
│ └── Workflow A:上傳 → 生成 → 下載
└── 不確定 → 詢問用戶
Workflow A: Upload → Generate → Download
Step 1: Identify content source
| Input characteristic | Handling method |
|---|---|
| YouTube URL | source add "URL" → source wait <id> |
| Web page URL | source add "URL" → source wait <id> |
| Google Drive document | source add-drive <file_id> "title" |
Local .pdf/.docx/.md/.csv/.txt |
source add "filepath" → source wait <id> |
Local .pptx/.xlsx/.epub |
markitdown "file" -o "$TEMP/converted.md" → source add |
| Local image/audio | source add "filepath" → source wait <id>(automatic OCR/transcription) |
| Plain keywords | source add-research "query"(see below) |
Step 2: Create notebook + add sources
notebooklm create "筆記本標題"
notebooklm source add "來源" # 上傳來源
notebooklm source wait <source_id> # 等待處理完成
- A notebook can have at most 50 sources; all
source waitbefore generating - Confirm before upload: inform the user of the notebook name about to be created; execute after confirmation
Step 3: Generate
Default behavior is non-blocking(except for mind-map). For interactive scenarios, add --wait to wait for completion.
| User intent | Command |
|---|---|
| Podcast/audio | generate audio --wait |
| PPT/slides | generate slide-deck --wait |
| Mind map | generate mind-map(synchronous, waits automatically) |
| Quiz/question generation | generate quiz --wait |
| Report/summary | generate report --wait |
| Video | generate video --wait |
| Infographic | generate infographic --wait |
| Flashcards | generate flashcards --wait |
| Data table | generate data-table "description" --wait |
User did not specify what to generate → only upload, do not generate; wait for further commands.
For each type's format/style/length parameters → see references/generate-options.md。
Step 4: Download
notebooklm download <type> ./output.<ext>
Common options:--latest(latest output),--format <fmt>(output format),--all(download all).
Full download options → see references/generate-options.md。
AI research search
When the user provides plain keywords, use NotebookLM's built-in research feature:
notebooklm source add-research "query" --mode deep --from web --import-all
notebooklm research wait # 等待研究完成
--mode fast(fast) /deep(deep)--from web(web) /drive(Google Drive)
Workflow B: Browse → Read → Ask
Browse and switch
notebooklm list # 列出所有 notebook
notebooklm use <id> # 切換(支援部分 ID 匹配)
notebooklm status # 當前上下文
notebooklm rename "新名稱" # 重新命名
Source management
notebooklm source list # 來源清單
notebooklm source fulltext <id> # 完整索引文本
notebooklm source guide <id> # AI 摘要
Ask and converse
notebooklm ask "問題" # 對整個 notebook 提問
notebooklm ask "問題" -s <source_id> # 指定來源提問
notebooklm ask "問題" -c <conversation_id> # 繼續既有對話
notebooklm ask "問題" --save-as-note --note-title "標題" # 答案存為筆記
History and outputs
notebooklm history # 對話紀錄
notebooklm summary # notebook 摘要
notebooklm artifact list # 已生成成品清單
notebooklm note list # 筆記清單
Share
notebooklm share public --enable # 公開分享
notebooklm share add user@email.com # 邀請特定用戶
NEVER List
- NEVER use
source add --wait— this flag does not exist. Usesource wait <id>instead - NEVER assume
generateblocks — it is async by default (except mind-map). Add--waitfor interactive use - NEVER use
--style retro— the correct value isretro-print - NEVER use 1-based slide index —
revise-slide --slide 0= first slide (zero-based) - NEVER create a notebook without confirming the name with the user first
- NEVER assume audio downloads are
.wav— the actual format is.mp4container - NEVER poll artifact status in the main conversation for extended periods — use a subagent or inform the user of estimated wait time
Integration and handoff
- yt-search: YouTube URL directly
source add; if you already have a subtitle text file, you can also directlysource add - markitdown: only for PPTX/XLSX/EPUB (formats not directly supported by NotebookLM). PDF/DOCX/MD/CSV/TXT/image/audio directly
source add - Obsidian vault: after reading the note content
source addfile path - crawl4ai: for anti-scraping websites (X.com, etc.), first use crawl4ai to scrape, then
source addlocal file
Language settings
notebooklm language set zh_Hant # 繁體中文
notebooklm language set ja # 日文
You can also add to individual commands --language zh_Hant。
Temporary file cleanup
After generation is complete and the user confirms receipt of the output, clean up temporary files:rm -f "$TEMP"/converted.md
References
| What you need | Where to look |
|---|---|
| Generation/download parameter details | references/generate-options.md |
| Complete workflow examples | references/examples.md |
| Windows setup | references/windows-setup.md |
| Troubleshooting | references/troubleshooting.md |