Things 3 CLI
使用 things 命令读取本地 Things 数据库(收件箱/今天/搜索/项目/区域/标签),并通过 Things URL 方案添加和更新待办事项。
设置
- 安装(推荐,Apple Silicon 芯片):
GOBIN=/opt/homebrew/bin go install github.com/ossianhempel/things3-cli/cmd/things@latest - 如果数据库读取失败:为调用程序授予完全磁盘访问权限(手动运行时为“终端”;网关运行时为
OpenClaw.app)。 - 可选:设置
THINGSDB(或传递--db)指向你的ThingsData-*文件夹。 - 可选:设置
THINGS_AUTH_TOKEN以避免在更新操作时传递--auth-token。
只读操作(数据库)
things inbox --limit 50things todaythings upcomingthings search "查询"things projects/things areas/things tags
写入操作(URL 方案)
- 推荐使用安全预览:
things --dry-run add "标题" - 添加任务:
things add "标题" --notes "备注..." --when today --deadline 2026-01-02 - 将 Things 置于前台:
things --foreground add "标题"
示例:添加待办事项
- 基本用法:
things add "买牛奶" - 带备注:
things add "买牛奶" --notes "2% 脂肪 + 香蕉" - 放入项目/区域:
things add "订机票" --list "旅行" - 放入项目标题下:
things add "打包充电器" --list "旅行" --heading "出发前" - 带标签:
things add "约牙医" --tags "健康,电话" - 清单项:
things add "旅行准备" --checklist-item "护照" --checklist-item "机票" - 从标准输入读取(多行 => 标题 + 备注):
cat <<'EOF' | things add -标题行备注行 1备注行 2EOF
示例:修改待办事项(需要身份验证令牌)
- 首先:获取 ID(UUID 列):
things search "牛奶" --limit 5 - 身份验证:设置
THINGS_AUTH_TOKEN或传递--auth-token <令牌> - 标题:
things update --id <UUID> --auth-token <令牌> "新标题" - 替换备注:
things update --id <UUID> --auth-token <令牌> --notes "新备注" - 追加/前置备注:
things update --id <UUID> --auth-token <令牌> --append-notes "..."/--prepend-notes "..." - 移动列表:
things update --id <UUID> --auth-token <令牌> --list "旅行" --heading "出发前" - 替换/添加标签:
things update --id <UUID> --auth-token <令牌> --tags "a,b"/things update --id <UUID> --auth-token <令牌> --add-tags "a,b" - 完成/取消(类似软删除):
things update --id <UUID> --auth-token <令牌> --completed/--canceled - 安全预览:
things --dry-run update --id <UUID> --auth-token <令牌> --completed
删除待办事项?
- 当前
things3-cli不支持(没有“删除/移至废纸篓”的写入命令;things trash是只读列表)。 - 可选方案:使用 Things UI 删除/丢弃,或通过
things update标记为--completed/--canceled。
备注
- 仅限 macOS。
--dry-run会打印 URL 但不打开 Things。