使用 inotes CLI 从终端管理 Apple Notes。当需要在 macOS 的 Notes.app 中列出、读取、创建、编辑、删除或搜索备忘录时使用。
使用 inotes.inotes 管理 Apple Notes 是一个用于 Apple Notes 的 macOS CLI. 它通过 AppleScript 与是一项面向实际任务的技能,主要用于Output 默认为 human-r.。它将相关步骤、工具调用和结果整理方式集中到统一流程中,帮助使用者更快完成目标并减少重复操作。
实际使用前应先确认任务范围、数据来源、运行环境、必要权限和关键参数,再依据技能说明逐步执行;若输入条件不完整,应先补齐信息或采用保守配置,避免因错误假设导致结果偏离需求。
执行过程中需要关注工具调用是否成功、接口或依赖是否可用、输出格式是否符合预期,并对异常提示、缺失字段和边界情况进行处理;涉及批量任务时,还应保存进度,避免中断后重复操作。
inotes 是一个面向 macOS 的 Apple Notes 命令行工具。它通过 AppleScript 与 Notes.app 通信,支持全部 CRUD 操作及搜索功能。默认输出为人类可读的表格格式;如需机器可读输出,请使用 --json 参数。
inotes 不连接任何远程服务器系统要求:
推荐使用 Homebrew 安装:
brew install wangwalk/tap/inotes
验证安装:
inotes --version # 应显示:0.1.2 which inotes # 路径应为 /opt/homebrew/bin/ 或 /usr/local/bin/
从 GitHub Releases 手动安装:
从 GitHub Releases 下载并校验 SHA256:
curl -LO https://github.com/wangwalk/inotes/releases/download/v0.1.2/inotes-0.1.2-universal-apple-darwin.tar.gz # 请依据发布说明中的校验和进行验证 tar xzf inotes-0.1.2-universal-apple-darwin.tar.gz sudo cp inotes /usr/local/bin/ sudo chmod +x /usr/local/bin/inotes
检查权限:
inotes status
若提示权限被拒绝,用户需在 系统设置 > 隐私与安全性 > 自动化 > Notes 中为当前终端应用启用自动化访问权限。
inotes # 最近的 iCloud 笔记(默认) inotes today # 今日修改的笔记 inotes show week # 本周修改的笔记 inotes show all # 所有笔记 inotes show --folder Work # 指定文件夹内的笔记 inotes show recent --limit 10 # 限制结果数量
inotes folders
inotes accounts
inotes mkfolder "Projects" inotes mkfolder "Work Notes" --account Exchange
inotes read 1 # 根据上一次 show 输出的索引号
inotes read A3F2 # 根据 ID 前缀(至少 4 位十六进制字符)
inotes add --title "Meeting Notes" --body "Action items" --folder Work
inotes edit 1 --title "Updated Title" inotes edit 2 --body "New content" --folder Projects
inotes delete 1 # 删除前需确认 inotes delete 1 --force # 跳过确认步骤
inotes search "quarterly review" inotes search "TODO" --folder Work --limit 10
默认仅显示 iCloud 笔记。如需访问其他账户,请使用 --account 或 --all-accounts 参数。
inotes accounts # 列出可用账户 inotes show all --account Exchange inotes show all --all-accounts
| 参数 | 说明 |
|---|---|
| (默认) | 人类可读的表格格式 |
--json / -j |
JSON 格式 |
--plain |
制表符分隔(TSV) |
--quiet / -q |
仅输出数量统计 |
--json 参数。--no-input 禁用交互式提示。--no-color,避免 ANSI 转义序列干扰。show 输出的顺序)或 ID 前缀(笔记 ID 的前 4 位及以上十六进制字符)定位笔记。inotes status 确认自动化权限已正确配置。创建每日笔记:
inotes add --title "Daily Notes $(date +%Y-%m-%d)" --body "## TODOnn## Donen"
导出全部笔记为 JSON:
inotes show all --json > notes-backup.json
查找含特定标签的笔记:
inotes search "#important" --json | jq '.[] | select(.folder == "Work")'
归档已完成的笔记:
inotes search "DONE" --folder Inbox --json | jq -r '.[].id' | while read id; do inotes edit "$id" --folder Archive done
“自动化权限被拒绝”
“命令未找到”
which inotes 检查是否已加入 PATHbrew doctor 并检查警告信息brew reinstall wangwalk/tap/inotes使用索引号时提示“找不到笔记”
inotes show 获取最新索引inotes read A3F2笔记数量较多时性能下降
--limit 参数减少结果集大小--folder "Work"today、week、recent