用途
Things 3 CLI 用于在 macOS 上通过 things 命令行工具读取本地 Things 数据库并管理待办事项与项目。读取范围包括收件箱、今日、即将到来、搜索、项目、区域和标签;写入操作通过 Things URL scheme 完成,可用于添加或更新 todos。
主要能力
- 只读(DB):读取本地 Things 数据库,支持
things inbox --limit 50、things today、things upcoming、things search "query"、things projects、things areas、things tags。 - 写入(URL scheme):添加和更新 todos。添加时支持标题、备注、时间(
--when)、截止日期(--deadline)、列表(项目或区域)、项目标题(heading)、标签、检查清单项(--checklist-item),也支持从 STDIN 输入多行内容(首行标题,后续行备注)。 - 更新时支持修改标题、替换/追加/前置备注、移动列表与标题、替换或添加标签、标记完成或取消(
--completed/--canceled)。 - 更新操作需要认证 token:可设置
THINGS_AUTH_TOKEN或传入--auth-token <TOKEN>。 - 安全预览:使用
things --dry-run可打印 URL 而不打开 Things。 - 前台显示:
things --foreground add "Title"可将 Things 带到前台。
使用方式
安装(推荐,Apple Silicon):
GOBIN=/opt/homebrew/bin go install github.com/ossianhempel/things3-cli/cmd/things@latest
若数据库读取失败:为调用程序授予完全磁盘访问权限(手动运行给 Terminal;网关运行给 OpenClaw.app)。
可选配置:设置 THINGSDB 或传入 --db 指向 ThingsData-* 文件夹;设置 THINGS_AUTH_TOKEN 以避免在更新操作中传入 --auth-token。
添加 todo 示例:
things add "Buy milk"
things add "Buy milk" --notes "2% + bananas"
things add "Book flights" --list "Travel"
things add "Pack charger" --list "Travel" --heading "Before"
things add "Call dentist" --tags "health,phone"
things add "Trip prep" --checklist-item "Passport" --checklist-item "Tickets"
从 STDIN 添加:
cat <<'EOF' | things add -
Title line
Notes line 1
Notes line 2
EOF
更新 todo 示例(需要认证 token):
things search "milk" --limit 5
things update --id <UUID> --auth-token <TOKEN> "New title"
things update --id <UUID> --auth-token <TOKEN> --notes "New notes"
things update --id <UUID> --auth-token <TOKEN> --append-notes "..."
things update --id <UUID> --auth-token <TOKEN> --prepend-notes "..."
things update --id <UUID> --auth-token <TOKEN> --list "Travel" --heading "Before"
things update --id <UUID> --auth-token <TOKEN> --tags "a,b"
things update --id <UUID> --auth-token <TOKEN> --add-tags "a,b"
things update --id <UUID> --auth-token <TOKEN> --completed
things update --id <UUID> --auth-token <TOKEN> --canceled
安全预览:
things --dry-run add "Title"
things --dry-run update --id <UUID> --auth-token <TOKEN> --completed
适用场景
适用于需要在 macOS 上以命令行方式批量或脚本化读取 Things 数据、快速添加待办、更新任务属性、移动任务到项目或区域、管理标签与检查清单,以及标记任务完成或取消的场景。也适合在自动化流程中通过 STDIN 传入多行文本创建待办。
限制
- 仅支持 macOS。
- 更新操作需要认证 token。
- 读取数据库需要完全磁盘访问权限。
- 当前 things3-cli 不支持删除待办:没有“delete/move-to-trash”写入命令,
things trash仅为只读列表。删除或移入废纸篓需使用 Things UI,或通过things update标记为--completed/--canceled作为替代。 --dry-run只打印 URL,不会打开 Things。- 未提供收费、价格或平台支持范围之外的信息。