notebooklm-visual-workflow
Generate NotebookLM visuals from local files via nlm. Covers slides vs infographic: use infographic + per-item sources for one-question-per-page decks with real code/text; slides are landscape-only and summarize.
- License 许可
- MIT
- 最近更新
- 2026-10-14
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- notebooklm-visual-workflow
- author
- curator
- license
- MIT
- version
- 1.1.0
- platforms
- [ "linux", "macos", "windows" ]
- description
- Generate NotebookLM visuals from local files via nlm. Covers slides vs infographic: use infographic + per-item sources for one-question-per-page decks with real code/text; slides are landscape-only and summarize.
02 资源文件 5
- 参考文档references/code-image-cards.md3.7 KB
- 参考文档references/nlm-cli-recipes.md2.2 KB
- 参考文档references/quiz-deck-recipe.md3.2 KB
- 脚本scripts/render_code_cards.py2.6 KB
- 脚本scripts/split_markdown_sections.py1.9 KB
03 SKILL.md 正文
NotebookLM Visual Workflow (nlm CLI)
Turn local material (markdown notes, diagrams, code, images) into NotebookLM
slide decks and infographics using the nlm CLI (~/.local/bin/nlm, v0.9.6).
When to use
- User asks for a slidedeck / infographic / visual summary "in NotebookLM" from local files, a repo, or a folder of notes.
- You already have a
nlmCLI installed and authenticated (cookies present). - User wants ONE item per page/slide (quiz cards, Q&A, per-question explainers)
with the actual source text/code visible → use
infographic createwith per-item sources, NOT slides (see Per-item sources below).
Workflow
1. Create the notebook
nlm notebook create "<title>" --json # -> notebook_id
Capture the id cleanly: nlm notebook list --json (parse) or write it to a file
(echo "$NB" > nb_id.txt). Avoid brittle sed/inline-json parses of
notebook create output — they leave stray prefixes and break later calls.
2. Upload local sources
nlm source add <nb> --file <path> --title "<label>" --wait
- Accepted:
.md,.txt,.pdf, images (.png/.jpg/.webp), audio, video. - Code files (
.java/.py/.ts) are REJECTED → copy/rename to.txt(wrap in ```java fences). Example:cp Algorithms.java Algorithms.txt. - Images upload fine and act as visual references (e.g. a brand-character
PNG or a template JPG the generator can match). Name them in
--focus. - Consolidate many small files (e.g. 83 notes + 102 diagrams) into one
.md/.txtto avoid per-file rate limits and a multi-hundred-source slog.
3a. Slide deck (landscape, topic-summary) — nlm slides create
nlm slides create <nb> --format detailed_deck --length default --confirm \
--focus "Act as a McKinsey Senior Designer. CREATE A VISUAL WONDER. Rules: 1. Dark luxury, obsidian + burnished gold + volumetric light. 2. 3D-beveled gold serif headers, Montserrat body. 3. Symmetrical triptychs, theatrical staging. 4. One message per slide, max 4 bullets / 12 words. 5. GENERATE A COMPREHENSIVE 18-PAGE DECK."
--length dynamicis NOT supported by this CLI — usedefaultand bake the page count into--focus.
⚠️ Slides decks are IMAGE-ONLY (no extractable text layer) and NotebookLM
summarizes the source rather than printing verbatim content. If you need the
actual question/code/quote text to appear on the page (quiz cards, one-item-per-
page, "show me the code"), do NOT use slides — use infographic create with one
source per item (see 3c). Slides are for high-level topic decks where the
literal source text need not be visible.
3b. Single infographic PNG — nlm infographic create
nlm infographic create <nb> --orientation portrait --detail detailed \
--style sketch_note \
--focus "Create ONE portrait hand-drawn sketchnote for the question in source '<TITLE>'. Print the EXACT question verbatim at top. Include a 'HOW IT WORKS' section showing the REAL code from the source inside a code box. Other sections: Problem, Why it matters, Complexity, Common mistakes (X), Quick revision (checkmarks), SAVE CTA, footer bar. Keep code legible and intact."
Styles: auto_select|sketch_note|professional|bento_grid|editorial|instructional|bricks|clay|anime|kawaii|scientific.
Orientation: landscape|portrait|square — portrait is ONLY available here;
slides are always landscape (~1376×768). If the user wants portrait, use
infographic.
3c. Per-item sources (one question / one card per page)
For "one topic per page with the real content visible," split the source into
one small .md per item and add EACH as its own source, then generate ONE
infographic per item. NotebookLM renders each source's text far more faithfully
when it is the only focus. Use scripts/split_markdown_sections.py to carve a
big README into per-###-header files. Force fidelity in --focus:
"print the EXACT <question/code> verbatim", "do NOT summarize or paraphrase the
code", "keep code legible and intact". See references/quiz-deck-recipe.md.
3d. Force verbatim CODE into slide decks (code-as-image trick)
Slides (detailed_deck) are image-only AND NotebookLM summarizes the source
instead of copying it. If you need the EXACT method + test code on each slide
(quiz decks, "show me the code"), text-prompts fail — the code gets paraphrased
or dropped (verified this session: 0 selectable text chars across all 53 pages of
a generated deck; the literal assertEquals/method lines never appeared).
Fix: render the code as PNG image cards and make NotebookLM embed them verbatim. NotebookLM paraphrases text but embeds images as-is, so an image of the code survives rasterization intact.
- Extract each question's ```java block(s) from the source
.md(method + JUnit test) and render each to a clean PNG with a monospace font (JetBrains Mono works well). Seescripts/render_code_cards.py(reusable generator) andreferences/code-image-cards.md(the exact recipe from this session). - Add each PNG as an image source:
nlm source add <nb> --file <card>.png --title "qNN method code (verbatim image)" --wait. - In
--focus, MANDATE image embedding, e.g.: "CODE IS SUPPLIED AS READY-MADE IMAGES (the 'qNN_method' and 'qNN_test' source images). You MUST place BOTH onto the slide EXACTLY as given — do NOT redraw, retype, paraphrase, summarize, or omit any code. Embed at readable size." - Pass the question source IDs + the code-card image IDs together to
slides create --source-ids.
This is the reliable path when you specifically need a landscape slide deck (not a portrait infographic) with real code per page. Per-item infographics (3c) also work but produce one PNG per item, not a unified deck.
4. Status + download
nlm studio status <nb> # needs notebook_id (NOT artifact_id); "unknown" = in progress
nlm download infographic <nb> --id <artifact_id> --output out.png
nlm download slide-deck <nb> --output out.pdf
Heavy infographics (real code in a box, portrait,
--detail detailed) can take 10–15 min and reportstatus: "unknown"the entire time. Poll up to ~20 min; do NOT assume failure at 3 min.nlm downloadFAILS while status is still"unknown"— only download after a poll returns"completed".
5. Share
nlm share public <nb> # public link == notebook URL; artifacts live inside under Studio
Profiles & Rate Limits
nlmhas MULTIPLE authenticated profiles, not one. List them withnlm login profile list; switch the active account withnlm login switch <profile>(setsdefault_profile). Different profiles = different Google accounts = separate NotebookLM quotas. Verify any profile is live before relying on it:nlm login --check --profile <name>showsAuthentication valid!+ Gmail address. Slots may show(invalid)/Profile not found/Unknown= expired cookies; re-auth vianlm login --profile <name>(browser OAuth).- Rate-limit rotation (the #1 way this workflow fails): slide-deck creation is
throttled per account (
API error (code 8): Wait a few minutes before retrying slide deck creation/RESOURCE_EXHAUSTED). Generating >1 deck per account in a burst fails repeatedly. Fixes, in order of preference:- Rotate profiles — create each deck under a DIFFERENT valid profile
(
nlm login switch mentorabefore eachnotebook create+slides create). - Use one fresh notebook per deck (notebooks also burst-limit per notebook).
- Space creations 10+ min apart.
- Rotate profiles — create each deck under a DIFFERENT valid profile
(
- NEVER assert "only one profile" and never exhaust one account's quota while
other valid profiles sit unused. Check
nlm login profile listfirst. - Rotation validity is ENVIRONMENT-DEPENDENT (conflict note vs
notebooklm-nlm-cli): this trick only works when the other profiles are actually authenticated (valid cookies) in that environment. This session PROVED rotation works formentora/trinity/glorious— 3 decks generated back-to-back with ZERORESOURCE_EXHAUSTED/rate-limit lines. By contrast,notebooklm-nlm-cliasserts rotation "does NOT work" because that env had only ONE authenticated profile (oludayo35); switching errors withProfile '<x>' not found. So: runnlm login profile list/nlm login --check --profile <x>first — if multiple profiles show valid, rotate; if only one is valid, fall back to retries + spacing. Do NOT blindly believe either skill's absolute claim; verify the profile set for the current env before acting.
Pitfalls
nlm studio statusrequires the notebook_id, not the artifact_id.- Generation reports
status: "unknown"while running; poll untilcompleted. Heavy code-bearing infographics take 10–15 min and stay"unknown"the whole time — keep polling;nlm downloadfails until"completed". - Slides vs infographic — pick by orientation + text needs: slides are
landscape-only and image-only (source text won't appear); infographics support
portrait and render source text/code when given per-item sources. User asked for
portrait + code on each page → use
infographic create --orientation portrait, neverslides create. nlm source add --filerejects code extensions (.java/.py/.ts) → rename to.txtwrapped in ``` fences (e.g.cp Algorithms.java Algorithms.txt).- 50-source cap per notebook. NotebookLM rejects source #51+ with
INVALID_ARGUMENT. If you need >50 sources (e.g. many per-item question files), spread them across multiple notebooks and generate one deck per notebook, thenpdfunitethe resulting PDFs. This also dodges the per-notebook burst limit. - Gemini image REST models (
gemini-2.5-flash-image,gemini-3-*-image,nano-banana-*) often 429 even when Gemini text/vision works. If you wanted to generate an image via the Gemini REST API and hit 429, use NotebookLM'sinfographic createinstead — separate quota, same reference-image + brief. - When piping
nlmoutput topython3for parsing, the security scanner may flag it as HIGH (pipe-to-interpreter). Either approve, or usegrep -Eon the raw output instead of a python parse to avoid the prompt.
See also
references/nlm-cli-recipes.md— copy-paste command recipes.references/quiz-deck-recipe.md— one-item-per-page / quiz deck recipe (portrait + code).references/code-image-cards.md— code-as-image recipe (force verbatim code into slide decks).scripts/split_markdown_sections.py— carve a big markdown doc into per-section sources.scripts/render_code_cards.py— render each question's method+test to PNG code cards.gemini-vision-router— for seeing images when native vision is throttled.
04 同仓库更多 Skills
blocked-page-recovery
Use when a fetch fails: 403/429, paywall, WAF, bot wall.
gemini-vision-fallback
Vision fallback: Gemini REST API if vision_analyze blocked.
twitter-cli
Use twitter-cli for ALL Twitter/X operations — reading tweets, posting, replying, quoting, liking, retweeting, following, searching, user lookups. Invoke whenever user requests any Twitter interaction.
prism-scan
Structural analysis through dynamically generated cognitive lenses. Generates the optimal analytical lens for the specific code/artifact, then executes it. Finds conservation laws, structural invariants, and concrete bugs that vanilla analysis misses. Use on any code file, system design, or text artifact.
prism-reflect
Constraint transparency: analyzes an artifact structurally, then analyzes what its own analysis concealed. Produces a conservation law AND a constraint report showing what was maximized, what was sacrificed, and what to investigate next. The only AI skill that knows what it can't see.
prism-full
Full Prism: multi-pass structural analysis with mandatory adversarial self-correction. Designs custom analytical passes, executes them with chaining, then attacks its own findings before synthesizing. Use for maximum depth on important code or artifacts.