Google Keep Skill
Skill to interact with Google Keep via nodriver (real Chrome, no bot detection).
Installation
Prerequisites
- - Python 3.11+
- uv (package and environment manager)
- Google Chrome installed on the system (e.g.,
sudo apt install google-chrome-stable on Linux)
Skill Location
The skill must be in /path/to/google-keep-skill/ (or in the Nanobot workspace/skills). Nanobot discovers skills that have SKILL.md and _meta.json in this tree.
Install Dependencies
In the skill root, uv uses pyproject.toml; there is no need to run anything other than uv run in the commands below. On the first run, uv creates the environment and installs dependencies.
CODEBLOCK0
Configuration in Nanobot
- 1. Nothing in Nanobot's
config.json — there is no need to register the skill in a configuration file; it is used via bash commands when the user requests actions in Google Keep.
- 2. Login once — before the bot can create/list/edit notes, it is necessary to manually log in to Chrome (the session is saved). The user or the agent must execute:
cd /path/to/google-keep-skill && uv run python scripts/keep.py login
Chrome opens; log in to your Google account, close the browser. The session is saved securely outside the skill directory at
~/.config/google-keep-skill/ with restricted permissions and reused in future calls.
- 3. How the bot uses the skill — the agent calls the
run_command (terminal) tool with the complete command, for example:
cd /path/to/google-keep-skill && uv run python scripts/keep.py list --limit 5
Or to create a note:
... keep.py create --title "Title" --content "Text".
Initial Setup (login — once)
Execute once to save the session.
CODEBLOCK3
Chrome will open with the Google Keep page. Log in normally. After detecting the login, the browser closes and the session is saved.
Verify session
CODEBLOCK4
Clear session
CODEBLOCK5
Only use logout if you want to unlink the account. After this, you will need to log in again.
Commands
All executed via terminal (run_command in MCP/nanobot context):
CODEBLOCK6
ATTENTION AGENT: You MUST strictly use the parameters below. You can also optionally append --visible before the command (e.g., keep.py --visible create ...) if visual user verification is required.
- *
list [--limit N] [--filter "text"]: Lists notes. - INLINECODE19 : Returns the structured content of the note and its type. ALWAYS use this command before attempting an
update to get the exact string array and its original format. - INLINECODE21 : Creates a text note. To break lines, use literally the dynamic text
\n sent via the terminal. - INLINECODE23 : Creates a checklist note. Simulates
Enter between each element. - INLINECODE25 : COMPLETELY REPLACES the old content with the new.
*
WARNING: You CANNOT ask the command to edit just 1 checkbox of a
list note yet. Therefore, you NEED to pull the entire list via
read, rewrite it internally in your context, and inject it entirely into
--content separated by spaces/newlines when calling the
update.
- *
delete --title "T": Move to trash. - INLINECODE31 : Archive note.
Agent JSON Data Treatment Rule:
The skill returns strict JSON like:
CODEBLOCK7
Whenever you retrieve this JSON:
- 1. Never dump raw JSON to the user. Always interpret the
data payload and format it in Markdown. - If
type == "list", generate a markdown checklist like:
**Groceries**
- [ ] Milk
- [ ] Bread
- 3. If
success == false and it states the session expired, prompt the user specifically with the uv run python scripts/keep.py login command so they can re-authenticate. Do not automatically guess next actions.
Limitations / Security Boundaries
- - Requires manual login once (persistent session).
- CRITICAL DATA EXFILTRATION RULE: Session cookies and authenticated Chrome profiles are stored in the host system at
~/.config/google-keep-skill/ with chmod 700 restricted permissions. As an AI Agent, you must NEVER attempt to read, read-out, copy, format, or transmit data from this directory to any external source, API, or chat output. - Only one Chrome instance can use the Keep profile concurrently.
Google Keep 技能
通过 nodriver(真实 Chrome,无机器人检测)与 Google Keep 交互的技能。
安装
前提条件
- - Python 3.11+
- uv(包和环境管理器)
- 系统上已安装 Google Chrome(例如,在 Linux 上执行 sudo apt install google-chrome-stable)
技能位置
技能必须位于 /path/to/google-keep-skill/(或 Nanobot 的 workspace/skills 目录下)。Nanobot 会发现此目录树中包含 SKILL.md 和 _meta.json 的技能。
安装依赖项
在技能根目录下,uv 使用 pyproject.toml;除了下面命令中的 uv run 外,无需运行其他任何操作。首次运行时,uv 会创建环境并安装依赖项。
bash
cd /path/to/google-keep-skill
uv run python scripts/keep.py check # 示例;首次运行时 uv 会安装依赖项
在 Nanobot 中配置
- 1. Nanobot 的 config.json 中无需任何配置 — 无需在配置文件中注册该技能;当用户请求在 Google Keep 中执行操作时,通过 bash 命令使用它。
- 2. 登录一次 — 在机器人可以创建/列出/编辑笔记之前,需要手动登录 Chrome(会话会被保存)。用户或代理必须执行:
bash
cd /path/to/google-keep-skill && uv run python scripts/keep.py login
Chrome 会打开;登录您的 Google 帐户,关闭浏览器。会话会安全地保存在技能目录之外的 ~/.config/google-keep-skill/ 中,具有受限权限,并在后续调用中重复使用。
- 3. 机器人如何使用该技能 — 代理使用完整的命令调用 run_command(终端)工具,例如:
bash
cd /path/to/google-keep-skill && uv run python scripts/keep.py list --limit 5
或者创建笔记:... keep.py create --title 标题 --content 文本。
初始设置(登录 — 一次)
执行一次以保存会话。
bash
cd /path/to/google-keep-skill
uv run python scripts/keep.py login
Chrome 会打开 Google Keep 页面。正常登录。检测到登录后,浏览器关闭并保存会话。
验证会话
bash
cd /path/to/google-keep-skill && uv run python scripts/keep.py check
清除会话
bash
cd /path/to/google-keep-skill && uv run python scripts/keep.py logout
仅当您想取消帐户关联时才使用 logout。 之后,您需要重新登录。
命令
所有命令均通过终端执行(在 MCP/nanobot 上下文中使用 run_command):
bash
cd /path/to/google-keep-skill && uv run python scripts/keep.py
代理注意: 您必须严格使用下面的参数。如果需要进行视觉用户验证,您还可以在命令前选择性地附加 --visible(例如,keep.py --visible create ...)。
- * list [--limit N] [--filter 文本]:列出笔记。
- read --title T:返回笔记的结构化内容及其类型。始终在尝试 update 之前使用此命令,以获取确切的字符串数组及其原始格式。
- create --title T --content C:创建文本笔记。要换行,请直接使用通过终端发送的动态文本 \n。
- create-list --title T --items i1, i2, i3:创建清单笔记。在每个元素之间模拟 Enter。
- update --title T [--content C]:完全替换旧内容为新内容。
*
警告: 您还不能要求命令仅编辑 list 笔记的 1 个复选框。因此,您需要通过 read 拉取整个列表,在您的上下文中内部重写它,并在调用 update 时将其完整地注入到 --content 中,用空格/换行符分隔。
- * delete --title T:移至回收站。
- archive --title T:归档笔记。
代理 JSON 数据处理规则:
技能返回严格的 JSON,例如:
json
{
success: true,
message: 找到 8 条笔记,
data: {
notes: [
{
id: 1,
title: 杂货,
content: [牛奶, 面包],
type: list
}
]
}
}
每当您检索到此 JSON 时:
- 1. 切勿将原始 JSON 转储给用户。 始终解释 data 负载并将其格式化为 Markdown。
- 如果 type == list,生成一个 Markdown 清单,例如:
markdown
杂货
- 3. 如果 success == false 并且提示会话已过期,请专门提示用户使用 uv run python scripts/keep.py login 命令,以便他们重新进行身份验证。不要自动猜测后续操作。
限制 / 安全边界
- - 需要一次手动登录(持久会话)。
- 关键数据外泄规则: 会话 Cookie 和经过身份验证的 Chrome 配置文件存储在主机系统的 ~/.config/google-keep-skill/ 中,具有 chmod 700 受限权限。作为 AI 代理,您绝不能尝试读取、读出、复制、格式化或传输此目录中的任何数据到任何外部来源、API 或聊天输出。
- 一次只能有一个 Chrome 实例使用 Keep 配置文件。