Mac Notes Agent
Overview
This skill lets the agent talk to Apple Notes on macOS using AppleScript
(via osascript). It is implemented as a small Node.js CLI:
CODEBLOCK0
Requires macOS with the built-in Notes app and osascript available.
All operations target the default Notes account. Optionally you can specify
which folder to use.
Commands
1) Add a new note
CODEBLOCK1
- -
--title (required): Note title - INLINECODE3 (required): Note body text. Use
\n for line breaks. - INLINECODE5 (optional): Folder name. If omitted, uses system default folder. If folder doesn't exist, it will be created.
Line breaks (\n) are converted to <br> tags internally for proper rendering in Notes.
Result (JSON):
CODEBLOCK2
2) List notes
CODEBLOCK3
- - Lists notes in the given folder (or all folders if omitted).
- Output is JSON array with
title, folder, creationDate, and synthetic id.
3) Read a note (get)
CODEBLOCK4
4) Update a note (replace body)
CODEBLOCK5
- - Replaces the entire body of the matching note.
- Can also use
--id for identification.
5) Append to a note
CODEBLOCK6
- - Appends new content to the end of the existing note.
6) Delete a note
CODEBLOCK7
7) Search notes
CODEBLOCK8
- - Searches note titles and bodies for the keyword.
Identification Model
Apple Notes doesn't expose stable IDs. This CLI uses:
- - Primary key: INLINECODE13
- Synthetic ID: INLINECODE14
When multiple notes share the same title, the CLI operates on the most recently created one.
Environment
- - macOS only: Uses AppleScript via INLINECODE15
- No npm dependencies: Uses only Node.js built-ins (
child_process)
Mac Notes Agent
概述
此技能允许代理通过AppleScript(使用osascript)与macOS上的Apple Notes进行交互。它作为一个小型Node.js CLI实现:
bash
node skills/mac-notes-agent/cli.js [options]
需要macOS系统内置的Notes应用和可用的osascript。
所有操作均针对默认Notes账户。您可以选择指定要使用的文件夹。
命令
1) 添加新笔记
bash
node skills/mac-notes-agent/cli.js add \
--title 会议记录 \
--body 第一行\n第二行\n第三行 \
[--folder Jarvis]
- - --title(必填):笔记标题
- --body(必填):笔记正文。使用\n表示换行。
- --folder(可选):文件夹名称。如果省略,则使用系统默认文件夹。如果文件夹不存在,则会自动创建。
换行符(\n)会在内部转换为
标签,以便在Notes中正确渲染。
结果(JSON):
json
{
status: ok,
id: Jarvis::2026-02-09T08:40:00::会议记录,
title: 会议记录,
folder: Jarvis
}
2) 列出笔记
bash
node skills/mac-notes-agent/cli.js list [--folder Jarvis] [--limit 50]
- - 列出指定文件夹中的笔记(如果省略则列出所有文件夹)。
- 输出为JSON数组,包含title、folder、creationDate和合成id。
3) 读取笔记(获取)
bash
按文件夹+标题
node skills/mac-notes-agent/cli.js get \
--folder Jarvis \
--title 会议记录
按合成id
node skills/mac-notes-agent/cli.js get --id Jarvis::2026-02-09T08:40:00::会议记录
4) 更新笔记(替换正文)
bash
node skills/mac-notes-agent/cli.js update \
--folder Jarvis \
--title 会议记录 \
--body 新内容\n替换所有内容
- - 替换匹配笔记的整个正文。
- 也可以使用--id进行标识。
5) 追加到笔记
bash
node skills/mac-notes-agent/cli.js append \
--folder Jarvis \
--title 会议记录 \
--body \n---\n附加笔记内容
6) 删除笔记
bash
node skills/mac-notes-agent/cli.js delete \
--folder Jarvis \
--title 会议记录
7) 搜索笔记
bash
node skills/mac-notes-agent/cli.js search \
--query 关键词 \
[--folder Jarvis] \
[--limit 20]
标识模型
Apple Notes不暴露稳定的ID。此CLI使用:
- - 主键:(folderName, title)
- 合成ID:folderName::creationDate::title
当多个笔记共享相同标题时,CLI会操作最近创建的那个。
环境
- - 仅限macOS:通过osascript使用AppleScript
- 无npm依赖:仅使用Node.js内置模块(child_process)