Things Todo
用於 Peter 的 Mac 上的 Things 3 任務。偏好使用 things 處理 Things 支援的待辦事項;僅當使用者要求 Apple 提醒事項時才使用 $reminders。
工具
- CLI:
things - 儲存庫:
https://github.com/ossianhempel/things3-cli - 安裝:
GOBIN=/opt/homebrew/bin go install github.com/ossianhempel/things3-cli/cmd/things@latest
更新 URL 操作的授權:
source ~/.profile >/dev/null 2>&1 || true
things auth
THINGS_AUTH_TOKEN 應來自 ~/.profile 或 1Password。絕不要將其印出。
things update --dry-run 必須將其塗改為 auth-token=***。
開始
使用 JSON 進行腳本化讀取與驗證:
things tasks --format json --limit 20
things today --format json
things search "query" --format json
Things 資料庫的讀取可能需要呼叫的應用程式具有「完整磁碟存取權限」。寫入操作應透過 Things URL Scheme 或 things 的 AppleScript 進行;請勿直接寫入 SQLite 資料庫。
新增
預設:新增,然後搜尋/讀取回來。
things add "預訂倫敦-舊金山直飛商務艙機票" --notes "僅限直飛。" --when tomorrow --tags travel
things tasks --search "LHR-SFO" --format json
有用的旗標:
--notes "文字"--when today|tomorrow|evening|anytime|someday|YYYY-MM-DD--deadline YYYY-MM-DD--list "專案或領域"--tags 標籤1,標籤2--checklist-item "文字"可重複使用--dry-run用於檢查things:///URL 而不進行實際修改。
更新 / 刪除
先找到 UUID,然後按 ID 進行修改:
things tasks --search "flight" --format json
things update --id <uuid> "新標題" --notes "已更新備註"
things tasks --search "新標題" --format json
things delete --id <uuid> --confirm <uuid>
things tasks --search "新標題" --format json
things trash --search "新標題" --format json
寫入後務必讀取回來。刪除會將項目移至 Things 垃圾桶;若清理很重要時,請驗證一般搜尋結果為空,且垃圾桶搜尋中包含該項目。
慣例
- 將模糊的要求轉化為具體的下一步行動標題。
- 當使用者明確表示要收集(capture)時,保留其用語。
- 將不相關的動作拆分為不同的待辦事項。
- 僅在使用者暗示時才使用「今天」;否則預設使用收件匣/隨時。
- 在大量更新/刪除前偏好使用
--dry-run。 - 若要計算當前日期,請執行
date指令;不要猜測。
注意事項
- 僅限 macOS;如果 Things.app 不存在或無法顯示,遠端主機上可能會顯示版本為
UNKNOWN。 update需要THINGS_AUTH_TOKEN;add則不需要。- 對於新增/更新,
--tags是複數;對於過濾,tasks --tag是單數。 today的 JSON 可能顯示start: Anytime加上一個真正的start_date;請使用命令的成員資格/回讀,而不是僅依賴單一個欄位,以驗證是否歸入「今天」。