Install
openclaw skills install notebooklm-studioImport sources (URLs, YouTube, files, text) into Google NotebookLM and generate user-selected artifacts: podcast, video, report, quiz, flashcards, mind map,...
openclaw skills install notebooklm-studioImport sources into NotebookLM, generate user-selected artifacts via CLI, download results locally.
Collect from user message (ask only for missing fields):
audio (podcast), video, report, quiz, flashcards, mind-map, slide-deck, infographic, data-tablezh_Hant): applied via notebooklm language set
references/artifact-options.md for all options per artifact type.See references/source-types.md for source type detection rules.
See references/artifacts.md for all 9 artifact types and CLI options.
Steps are sequential gates — do NOT skip or combine steps. Each numbered step must complete before the next begins. In particular:
Auth precheck — Verify the session is valid before doing any work:
notebooklm auth check --test --json
"status": "ok" → proceed to step 1."status": "error" → stop immediately. Tell the user:
NotebookLM 登入已過期,請先重新登入(
notebooklm login),完成後告訴我,我再繼續。
--test is required — without it, only local checks run, which can pass even with an expired session.Parse input & configure artifacts —
1a. Select artifacts — Detect source types from user message (URLs, files, text). Confirm which artifacts to generate.
1b. Discuss options — Before generating, confirm key options for each selected artifact.
Refer to references/artifact-options.md for priority levels:
If user says "use defaults" → skip all questions, proceed with default values immediately.
Example agent message (audio + video + report + quiz + flashcards + slides + infographic selected):
Before generating, a few options to confirm:
- Podcast: deep-dive / brief / critique / debate?
- Video: explainer / brief / cinematic? (cinematic uses Veo 3, takes 30-40 min)
- Report: briefing-doc / study-guide / blog-post / custom?
- Slides: detailed / presenter?
- Quiz & Flashcards: difficulty
medium, quantitystandard— adjust?- Infographic: style
auto, or prefer a specific style (sketch-note, professional, bento-grid...)?- Language:
zh_Hant, OK?Or just say "use defaults" to start immediately.
Derive slug — Based on the sources and user message, generate a short kebab-case slug (2-4 words) that captures the core topic. This slug is used for both the notebook name and the output directory.
react-server-components, feynman-technique, taiwan-semiconductor-q4Create notebook —
notebooklm create "<slug> <YYYYMMDD>"
# → {"notebook_id": "xyz789", ...} ← capture notebook_id
notebooklm use <notebook_id>
mkdir -p ./output/<slug>
Set language —
notebooklm language set <confirmed_language>
Use the language confirmed in step 1b. ⚠️ GLOBAL setting — always set explicitly to avoid residual from previous runs.
Add sources — For each source:
# URL, YouTube, or file path
notebooklm source add "<url_or_filepath>"
# Google Drive
notebooklm source add-drive <file_id> "<title>"
For plain text → save to a .txt file first, then source add "./temp_text.txt".
Generate artifacts — Two-tier strategy for timeout safety:
⚠️ Deduplication gate (Tier 2 only) — Before generating Tier 2 artifacts, call artifact list once and check all requested types in that single response:
notebooklm artifact list --json
# → [{"task_id": "abc123", "type": "slide-deck", "status": "processing"}, ...]
For each Tier 2 artifact you are about to generate, look for entries where type matches (e.g., slide-deck, audio, video). If multiple entries match the same type, the non-terminal status takes priority (processing/pending > completed > failed):
processing / pending → do NOT generate again. Take the existing task_id, go to step 9 (wait + deliver).completed → do NOT generate again. Skip the wait — go directly to download + deliver in step 9.failed → safe to re-generate.If artifact list itself fails or returns an error, proceed with generation — the dedup check is a safety net, not a hard gate.
Duplicate generation wastes resources and causes confusion — this gate prevents the most common operational error.
Tier 1 — Immediate (use --wait, completes within timeout):
# Sync (instant)
notebooklm generate mind-map
# Fast async (1-2 min) — use options confirmed in step 1b
notebooklm generate report --format <chosen_format> --wait
notebooklm generate quiz --difficulty <chosen_difficulty> --quantity <chosen_quantity> --wait
notebooklm generate flashcards --difficulty <chosen_difficulty> --quantity <chosen_quantity> --wait
notebooklm generate data-table "<description>" --wait
# Medium async (2-5 min, borderline — if timeout, retry or move to Tier 2)
notebooklm generate infographic --style <chosen_style> --orientation <chosen_orientation> --wait
Tier 2 — Deferred (use --json without --wait, capture task_id for step 9):
# Slow async — use options confirmed in step 1b
# Parse JSON output to extract task_id for polling
notebooklm generate slide-deck --format <chosen_format> --json
# → {"task_id": "abc123", "status": "pending"} ← save task_id
notebooklm generate video --format <chosen_format> --style <chosen_style> --json
# → {"task_id": "def456", "status": "pending"} ← save task_id
# Note: if cinematic, omit --style (ignored by Veo 3)
notebooklm generate audio "<description>" --format <chosen_format> --length <chosen_length> --json
# → {"task_id": "ghi789", "status": "pending"} ← save task_id
Options accepted as defaults in step 1b can be omitted (CLI uses its own defaults).
Parse each JSON response and save the task_id — you will need it in step 9.
Only generate the artifacts the user requested. Skip the rest.
See references/artifacts.md → "Deferred Generation" for Tier 2 details.
Write delivery status — Immediately after all Tier 2 generates are dispatched, write ./output/<slug>/delivery-status.json so the recovery script can pick up if the agent times out:
{
"slug": "<slug>",
"notebook_id": "<notebook_id>",
"created_at": "<ISO 8601>",
"artifacts": [
{"type": "slide-deck", "task_id": "<id>", "status": "pending", "output_path": "./output/<slug>/slides.pdf"},
{"type": "audio", "task_id": "<id>", "status": "pending", "output_path": "./output/<slug>/podcast.mp3"}
]
}
Update each artifact's status to completed or failed as step 9 progresses.
This file is the handoff contract between the agent and scripts/recover_tier2_delivery.sh.
Telegram delivery is agent-only (requires OpenClaw message tool); the recovery script handles download + status tracking only.
Download Tier 1 — Each successful Tier 1 artifact into ./output/<slug>/:
notebooklm download mind-map ./output/<slug>/mindmap.json
notebooklm download report ./output/<slug>/report.md
notebooklm download quiz --format json ./output/<slug>/quiz.json
notebooklm download flashcards --format json ./output/<slug>/flashcards.json
notebooklm download data-table ./output/<slug>/data.csv
notebooklm download infographic ./output/<slug>/infographic.png
Report + Deliver Tier 1 — Present completed Tier 1 artifacts to user. If Tier 2 artifacts are pending, include a status note:
"Slides/Audio/Video are still generating, I'll send them when ready."
Telegram delivery (OpenClaw only) — If message tool is available:
See references/telegram-delivery.md for delivery contract.
Skip Telegram delivery if running outside OpenClaw (e.g. Claude Code, Codex).
Poll + Deliver Tier 2 — Wait for each deferred artifact in order of expected speed (fastest first), then download and deliver as each completes:
# Wait by expected completion order: slide-deck (fastest) → video → audio (slowest)
# Uses --interval 5 (not default 2) since Tier 2 artifacts take minutes, not seconds
notebooklm artifact wait <slide_task_id> --timeout 1800 --interval 5 --json
# → {"status": "completed", ...} ← task_id from generate is used as artifact_id here
notebooklm download slide-deck ./output/<slug>/slides.pdf
# → deliver to Telegram immediately
notebooklm artifact wait <video_task_id> --timeout 1800 --interval 5 --json
# Note: if cinematic, use --timeout 2400 (generation takes 30-40 min)
notebooklm download video ./output/<slug>/video.mp4
# → deliver to Telegram immediately
notebooklm artifact wait <audio_task_id> --timeout 1800 --interval 5 --json
notebooklm download audio ./output/<slug>/podcast.mp3
bash scripts/compress_audio.sh ./output/<slug>/podcast.mp3 ./output/<slug>/podcast_compressed.mp3
# → deliver to Telegram immediately
delivery-status.json status to completedfailed with reason, notify user, continue to next artifactpending, tell the user:
"Tier 2 補送模式已啟動,recovery script 會每 5 分鐘檢查並自動送達。"
⚠️ Timeout recovery — If artifact wait returns status: "timeout", the artifact is likely still generating. NEVER re-generate. Instead:
notebooklm artifact poll <task_id> --jsonprocessing → re-wait: notebooklm artifact wait <task_id> --timeout 1800 --interval 5 --jsoncompleted → download and deliverfailed → notify user with error, move to next artifactBefore reporting "complete" to the user, ALL of the following must be true:
message tool call (OpenClaw's built-in messaging tool) returned a success response with a messageId
processing or pending status without being trackedNever say "done" while any artifact is still pending delivery. If Tier 2 artifacts are still generating, say so explicitly and continue waiting. The task is not complete until everything is delivered or accounted for.
Before delivery, verify:
See references/output-contracts.md for format specifications.
auth check --test --json before any work; expired sessions fail fast instead of blowing up mid-generation.artifact list before Tier 2 generation to prevent duplicate artifacts when agent retries or resumes.artifact wait timeout no longer triggers re-generation; polls status and re-waits, giving up only after 2 consecutive timeouts (~60 min).delivery-status.json after Tier 2 dispatch; step 9 updates it as artifacts complete. Enables cron-based recovery via scripts/recover_tier2_delivery.sh when agent times out.