NotebookLM CLI:查询和搜索 NotebookLM 文档 - Openclaw Skills

作者:互联网

2026-03-25

AI教程

什么是 NotebookLM CLI?

NotebookLM CLI 技能实现了 AI 编程代理与 NotebookLM 平台之间的无缝集成。通过使用 notebooklm-mcp-cli 软件包,该技能允许代理直接通过终端界面访问个人或共享知识库。它专为处理跨多个文档的复杂查询而设计,同时通过基于您现有的 NotebookLM 来源生成响应来保持高准确性。这种能力使其成为依赖结构化文档研究和自动化数据提取的 Openclaw Skills 用户必不可少的组件。

下载入口:https://github.com/openclaw/skills/tree/main/skills/lhquangit/notebooklm-cli-cookies

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install notebooklm-cli-cookies

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 notebooklm-cli-cookies。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

NotebookLM CLI 应用场景

  • 在特定的 NotebookLM 笔记本中查询技术数据、规格或价格信息。
  • 通过单个命令总结存储在 NotebookLM 项目中的文档资源。
  • 使用笔记本别名从研究论文或内部维基中自动检索信息。
  • 使用 Openclaw Skills 将 NotebookLM 知识集成到多代理工作流中。
NotebookLM CLI 工作原理
  1. 代理识别与 NotebookLM 相关的请求,并验证身份验证路径和登录状态。
  2. 技能列出可用笔记本,将人类可读的标题或别名解析为唯一的 ID。
  3. 使用 nlm 命令行工具针对选定的笔记本执行特定查询。
  4. 技能捕获输出并向用户返回事实性的、有据可依的响应,并识别所使用的源笔记本。

NotebookLM CLI 配置指南

首先,请确保您已通过 pipx 或 uv 安装了 notebooklm-mcp-cli 软件包。

pipx install notebooklm-mcp-cli

配置环境变量 NOTEBOOKLM_MCP_CLI_PATH 指向您的身份验证存储目录。在运行查询前验证您的登录状态:

nlm login --check

配置完成后,此技能将成为您 Openclaw Skills 库中一个强大的补充。

NotebookLM CLI 数据架构与分类体系

该技能通过 CLI 与 NotebookLM API 交互,并处理用于笔记本管理的 JSON 元数据。

字段 描述 类型
notebook_id NotebookLM 笔记本的唯一 UUID 字符串
alias 用户为特定笔记本定义的快捷方式 字符串
title 笔记本的显示名称 字符串
query 发送到 CLI 的自然语言问题 字符串
name: notebooklm-cli
description: Search and answer questions over documents already uploaded to NotebookLM using the nlm CLI. Use when users ask to find information, summarize sources, or query a specific NotebookLM notebook.
metadata: {"openclaw":{"requires":{"bins":["nlm"],"env":["NOTEBOOKLM_MCP_CLI_PATH"]}}}
user-invocable: true

NotebookLM CLI

Purpose

Use this skill when the user wants to search or ask questions over content that already exists in NotebookLM notebooks.

This skill assumes:

  • nlm is installed (notebooklm-mcp-cli package).
  • Auth was pre-injected for headless runtime.
  • NOTEBOOKLM_MCP_CLI_PATH points to the auth storage directory.

Hard Rules (avoid wrong tool choices)

When the user mentions any of the following, treat it as a strict request to query NotebookLM:

  • "NotebookLM", "notebooklm"
  • "notebook alias", "alias"
  • a known alias name (for example: tai_lieu_dien, nlm_tai_lieu_dien)

In these cases:

  • Always run nlm via Exec to answer. Do not answer from memory.
  • Do not switch to web search unless the user explicitly asks for web sources.
  • If the answer is not in the notebook, say so (based on the nlm output).

Slash command:

  • If the user invokes this skill via /nlm ... in T@elegrimm, treat the raw text after /nlm as the nlm arguments.
  • Always execute exactly: nlm via Exec, and return the relevant stdout.

Runtime Checks

Before running queries:

  1. Verify auth path is configured:
echo "$NOTEBOOKLM_MCP_CLI_PATH"
  1. Verify login status:
nlm login --check

If auth check fails, stop and ask for auth refresh workflow (do not run browser login in AWS runtime).

Query Workflow

  1. List notebooks:
nlm notebook list --json
  1. Select notebook:
  • If user provided notebook id, use it directly.
  • If user provided title, resolve it to notebook_id from the list output (do not pass raw title into nlm notebook get/source list/query).
  • If user provided alias, use the alias.
  • If ambiguous, ask user to choose one notebook.
  1. Query notebook:
nlm notebook query "" ""
  1. Return answer and include which notebook was queried.

Notes:

  • nlm notebook list returns titles for display, but many other commands expect a notebook id (UUID) or an alias. Passing a title like "tài li?u ?i?n" may return null/empty results.
  • If the user will query the same notebook often, create an alias and use it consistently (for example: tai_lieu_dien).

T@elegrimm Prompt Templates (copy/paste)

Prefer one of these formats to reliably trigger this skill:

  1. Force CLI query:
Ch?y l?nh: nlm notebook query tai_lieu_dien "giá c?a A9N61500 là bao nhiêu? N?u notebook kh?ng có th?ng tin giá thì tr? l?i: kh?ng th?y trong NotebookLM."
  1. Natural language but explicit:
Trong NotebookLM notebook alias tai_lieu_dien: tr? l?i cau h?i "giá c?a A9N61500 là bao nhiêu?". B?t bu?c dùng nlm ?? truy v?n, kh?ng tìm web, kh?ng ??c file local.

Output Guidelines

  • Be explicit about notebook identity (title + id when available).
  • If query result is empty or vague, suggest a refined follow-up query.
  • Prefer concise, factual answers grounded in NotebookLM response.

Common Errors

  • Authentication expired / 401 / 403:
    • Check NOTEBOOKLM_MCP_CLI_PATH.
    • Ensure profiles/default/cookies.json and profiles/default/metadata.json exist.
    • Refresh cookies outside AWS (machine with browser), then redeploy secret.
  • nlm: command not found:
    • Install package: pipx install notebooklm-mcp-cli (recommended), or uv tool install notebooklm-mcp-cli.

Command Reference

# List notebooks
nlm notebook list --json

# Query notebook by id or alias
nlm notebook query "" ""

# Check auth status
nlm login --check