介绍
# Todoist Integration
通过 `td` 命令行工具 (todoist-rs) 管理任务。
## 安装
```bash brew install LuoAndOrder/tap/todoist-cli ```
或者通过 Cargo 安装:`cargo install todoist-cli-rs`
## 同步行为
- **写入自动同步**:`add`、`done`、`edit`、`delete` 直接调用 API - **读取使用缓存**:`list`、`today`、`show` 从本地缓存读取 - **按需同步**:使用 `--sync` 标志或运行 `td sync` 获取最新数据
```bash td sync # Incremental sync (fast) td sync --full # Full rebuild if cache seems off ```
## 常用操作
### 列出任务
```bash # Today's agenda (includes overdue) td today --sync
# Today only (no overdue) td today --no-overdue
# All tasks td list --sync
# By project td list -p "Inbox" --sync td list -p "Work" --sync
# High priority td list -f "p1 | p2" --sync
# By label td list -l "urgent" --sync
# Complex filters td list -f "today & p1" --sync td list -f "(today | overdue) & !@waiting_on" --sync ```
### 添加任务
快速添加(自然语言): ```bash td quick "Buy milk tomorrow @errands #Personal" td quick "Review PR tomorrow" --note "Check the auth changes carefully" ```
结构化添加: ```bash td add "Task content" \ -p "Inbox" \ -P 2 \ -d "today" \ -l "urgent"
# With description td add "Prepare quarterly report" -P 1 -d "friday" \ --description "Include sales metrics and customer feedback summary" ```
选项: - `-P, --priority` - 1(最高)到 4(最低,默认) - `-p, --project` - 项目名称 - `-d, --due` - 截止日期("today"、"tomorrow"、"2026-01-30"、"next monday") - `-l, --label` - 标签(可重复指定以添加多个) - `--description` - 任务描述/备注(显示在任务标题下方) - `--section` - 目标项目中的版块 - `--parent` - 父任务 ID(创建子任务)
### 完成任务
```bash td done <task-id> td done <id1> <id2> <id3> # Multiple at once td done <id> --all-occurrences # End recurring task permanently ```
### 修改任务
```bash td edit <task-id> -c "New content" td edit <task-id> --description "Additional notes here" td edit <task-id> -P 1 td edit <task-id> -d "tomorrow" td edit <task-id> --add-label "urgent" td edit <task-id> --remove-label "next" td edit <task-id> --no-due # Remove due date td edit <task-id> --section "Next Actions" td edit <task-id> -p "Work" # Move to different project ```
编辑选项: - `-c, --content` - 更新任务标题 - `--description` - 更新任务描述/备注 - `-P, --priority` - 更改优先级(1-4) - `-d, --due` - 更改截止日期 - `--no-due` - 移除截止日期 - `-l, --label` - 替换所有标签 - `--add-label` - 添加标签 - `--remove-label` - 移除标签 - `-p, --project` - 移动到其他项目 - `--section` - 移动到项目中的版块
### 显示任务详情
```bash td show <task-id> td show <task-id> --comments ```
### 删除任务
```bash td delete <task-id> ```
### 重新打开已完成的任务
```bash td reopen <task-id> ```
## 项目与标签管理
```bash # Projects td projects # List all td projects add "New Project" td projects show <id>
# Labels td labels # List all td labels add "urgent" ```
## 过滤语法
与 `-f/--filter` 配合使用: - `|` 表示 OR:`today | overdue` - `&` 表示 AND:`@next & #Personal` - 括号:`(today | overdue) & p1` - 否定:`!@waiting_on` - 优先级:`p1`、`p2`、`p3`、`p4` - 日期:`today`、`tomorrow`、`overdue`、`no date`、`7 days`
## 工作流技巧
1. **早晨复盘**:`td today --sync` 2. **快速捕捉**:`td quick "thing to do"` 3. **专注列表**:`td list -f "@next" --sync` 4. **等待事项**:`td list -f "@waiting_on" --sync` 5. **一天结束时**:`td today`(使用缓存即可,此前已同步)