notebooklm skill
Install, authenticate, troubleshoot, and operate Gemini Notebook through the notebooklm-py CLI or typed async Python API. Use for notebook and source management, grounded chat and research, and artifact generation or download when the user mentions Gemini Notebook, notebooklm-py, the notebooklm CLI, or its Python API. Do not use for the generic Gemini API or unrelated content creation.
Is the notebooklm skill safe?
Read the findings before you install it. We read 11 files in the folder on 2026-09-28.
- high
README.md:165Downloads a script and runs it in one step, so what runs is whatever that server sends that day. Common for installers, and still worth a look at the address.
**Why `uv tool` / `pipx`?** They install the CLI into its own isolated environment and put `notebooklm` on your `PATH` — no dependency clashes with other tools, a one-line upgrade (`uv tool upgrade...
Install the notebooklm skill
A skill is a folder. Copy it into your agent's skills folder and the agent loads it when the task matches its description.
git clone --depth 1 https://github.com/teng-lin/notebooklm-py.git /tmp/notebooklm-py mkdir -p ~/.claude/skills cp -r /tmp/notebooklm-py/. ~/.claude/skills/notebooklm
In the Claude apps, zip the folder and upload it from the Skills settings. The folder on GitHub
The instructions your agent would load
SKILL.md as published, without the frontmatter. Read it on GitHub
Gemini Notebook Automation
Use the notebooklm CLI for agent workflows. Prefer --json and explicit IDs so every operation is inspectable and safe under concurrency. Use the typed async Python API only when the user requests application code or the CLI cannot express the workflow. The readiness, identity, authorization, and credential-handling rules below apply to both interfaces.
Setup and Authentication
Requires Python 3.10+. Install the package in the user's existing environment; do not create a separate environment unless requested:
pip install "notebooklm-py[browser]"
pip install "notebooklm-py[cookies]" # optional browser-cookie extractionIf system pip reports externally-managed-environment, do not use --break-system-packages. For CLI-only use, offer uv tool install "notebooklm-py[browser]" or the equivalent pipx command; for application code, use the user's active project environment.
For unattended or headless work, prefer durable profile-backed master-token auth over a copied cookie snapshot. Install pip install "notebooklm-py[headless]"; the one-time automatic OAuth capture also needs [browser]. On a trusted workstation run notebooklm login --master-token --account , then deploy mastertoken.json, not storagestate.json, to the selected profile. NOTEBOOKLMHOME selects the private base directory and NOTEBOOKLMPROFILE selects its profile; defaults resolve to ~/.notebooklm/profiles/default/master_token.json.
In CI, NOTEBOOKLMMASTERTOKENJSON is a secret-transport convention, not an environment variable the package reads directly. Write its exact value to the selected profile's mastertoken.json with mode 0600, unset it, then run notebooklm auth refresh to mint storagestate.json. A sibling master token can automatically re-mint expired file-backed cookies. Inline NOTEBOOKLMAUTH_JSON is only a short-lived fallback; it bypasses this recovery path.
Use PyPI or a release tag, not an unreleased main checkout. When available, consult the installation guide.
Before a workflow, verify real authentication rather than merely parsing the cookie file:
notebooklm auth check --test --jsonRequire .status == "ok" and .checks.token_fetch == true. If validation fails:
notebooklm login --browser-cookies . Use notebooklm auth inspect --browser first when account selection is unclear.
- With a display, run notebooklm login and validate again.
- In a headless environment, install [cookies] and use
notebooklm auth refresh --browser-cookies after signing back into the browser.
- If previously valid cookies became stale, try notebooklm auth refresh; use
The normal --test preflight may heal and persist refreshed cookies. Add --passive when the check must be strictly read-only, including the failure-diagnosis workflow below.
notebooklm status reports selected-notebook context, not authentication.
Treat both auth files as bearer credentials: never print, log, or commit them. A master token is a durable full-account credential that survives password changes; use a dedicated account, protect it in a secret store and as 0600 on disk, and explicitly revoke it if exposed.
Operating Invariants
envelopes are .notebook.id from create, .source.id from source add, and .taskid from asynchronous generators. generate mind-map instead returns mindmap, note_id, and kind; both kinds return a finished result with no task ID or separate artifact wait step.
- Use --json for discovery and mutations, then retain the returned full UUIDs. Important
Do not rely on notebooklm use. For every concurrent run, also set a unique NOTEBOOKLMPROFILE=agent- so context and profile writes are isolated. A new profile has no credentials: put a mastertoken.json copy in that profile and mint its storage before use. Never share one writable storage_state.json across agents.
- Pass -n/--notebook on every notebook-scoped command in automation or concurrent work.
generation. The add envelope has no status. Require wait exit 0 and status == "ready"; let the waiter handle media-specific transient error rows.
- After adding sources, retain every .source.id, then run source wait for each before chat or
artifact wait with -n . Download that exact artifact with -a -n ; never select the latest visible artifact. Mind-map generation returns its completed result directly and does not need artifact wait.
- After an asynchronous generator returns a task/artifact ID, pass it positionally to
commands in one sequential job, and download only after the wait exits 0. Otherwise run in the foreground or return exact ID-pinned commands to the user.
- For overlapping research runs, always pass --run-id .
- Use a host's background facility only when it actually exists. Keep wait and dependent download
Authorization Boundaries
Safe inspection and explicitly requested creation, source addition, chat, and prompt suggestion can run directly. Diagnose failures with read-only commands before attempting recovery.
Obtain confirmation immediately before an action when it was not already clearly authorized:
removal, logout, clear, research cancellation, and ask --new;
- destructive commands such as notebook/source/note/artifact/label/profile deletion, sharing
generation command's --language override);
- language set, because the default mode changes the account-global output language (prefer a
- generation or long foreground waits, which can take minutes and be rate-limited;
- downloads, which write files;
- research wait --import-all, which imports sources;
- ask --save-as-note and history --save, which create notes.
User intent, not the presence of a CLI prompt, is the authorization boundary. After authorization, pass --yes/-y where supported. Most destructive JSON commands refuse to prompt without it, but some, including ask --new --json and share remove --json, execute without prompting. Never treat prompt absence as consent.
research cancel is fire-and-forget. After an authorized cancellation, verify the exact run with notebooklm research status -n --run-id --json.
Command Discovery
Use the installed CLI's help as the version-matched source of truth instead of guessing flags:
notebooklm --help
notebooklm source --help
notebooklm research --help
notebooklm generate --help
notebooklm artifact --help
notebooklm download --helpAlso inspect notebooklm --version and drill down to the exact command, such as notebooklm generate audio --help, whenever its help differs from this skill.
Common operations:
For the full surface, consult the installed command help or, when available, the CLI reference. For application code, use the baseline below and, when available, the Python API guide.
Canonical Source-to-Artifact Workflow
Keep {notebookid}, every {sourceid}, and {artifact_id} from JSON output:
An explicit request for this completed workflow authorizes its normal prerequisite waits, requested generation, and requested output file. Confirm only work not already authorized by that request.
notebooklm source wait {sourceid} -n {notebookid} --timeout 600 for every captured source.
- notebooklm create "Research: topic" --json
- notebooklm source add -n {notebook_id} --json for each input.
- Once the foreground wait is authorized, run
notebooklm generate audio "instructions" -n {notebookid} -s {sourceid} --json. Repeat -s for each selected source and capture .taskid as {artifactid}.
- Once generation is authorized, generate the requested type. For audio:
notebooklm artifact wait {artifactid} -n {notebookid} --timeout 1200.
- Once the foreground wait is authorized, run
notebooklm download audio ./podcast.m4a -a {artifactid} -n {notebookid}.
- Once the output write is authorized, run
For analysis without generation, replace steps 4-6 with an ID-pinned chat command only after every source is ready:
notebooklm ask "Summarize the key arguments" -n {notebook_id} --json