Things 3 CLI
使用 things 讀取您本機的 Things 資料庫(收件匣/今天/搜尋/專案/區域/標籤),並透過 Things URL scheme 新增與更新待辦事項。
設定
- 安裝(建議,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 scheme)
- 建議先安全預覽:
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 "機票" - 從 STDIN 輸入(多行 => 標題 + 備註):
cat <<'EOF' | things add -標題行備註行 1備註行 2EOF
範例:修改待辦事項(需要驗證令牌)
- 首先:取得 ID(UUID 欄位):
things search "牛奶" --limit 5 - 驗證:設定
THINGS_AUTH_TOKEN或傳遞--auth-token <TOKEN> - 修改標題:
things update --id <UUID> --auth-token <TOKEN> "新標題" - 取代備註:
things update --id <UUID> --auth-token <TOKEN> --notes "新備註" - 附加/前置備註:
things update --id <UUID> --auth-token <TOKEN> --append-notes "..."/--prepend-notes "..." - 移動清單:
things update --id <UUID> --auth-token <TOKEN> --list "旅行" --heading "出發前" - 取代/新增標籤:
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/--canceled - 安全預覽:
things --dry-run update --id <UUID> --auth-token <TOKEN> --completed
刪除待辦事項?
things3-cli目前不支援(沒有「刪除/移至垃圾桶」的寫入指令;things trash是唯讀列表)。- 替代方案:使用 Things 介面刪除/丟入垃圾桶,或透過
things update標記為--completed/--canceled。
備註
- 僅限 macOS。
--dry-run只會印出 URL,不會打開 Things。