介绍
# Todoist CLI
一个用 Go 编写的快速、功能齐全的 Todoist CLI。
## 身份验证
从 https://todoist.com/app/settings/integrations/developer 获取你的 API 令牌。
```bash # Interactive todoist auth
# Direct todoist auth <your-token>
# Or set environment variable export TODOIST_API_TOKEN=<your-token> ```
## 任务
```bash # Show today's tasks (default) todoist
# List all tasks todoist tasks --all
# Filter tasks todoist tasks --filter "p1" # High priority todoist tasks --filter "overdue" # Overdue todoist tasks -p Work # By project
# Show task descriptions and comments todoist tasks -p Work --details
# Add a task todoist add "Buy groceries" todoist add "Call mom" -d tomorrow todoist add "Urgent" -P 1 -d "today 5pm" -l urgent
# Complete a task todoist complete <task-id> todoist done <task-id>
# Reopen completed task todoist reopen <task-id>
# View task details todoist view <task-id>
# Update a task todoist update <task-id> --due "next monday" todoist update <task-id> -P 2
# Delete a task todoist delete <task-id>
# Move a task (Kanban workflows) todoist move <task-id> --section "In Progress" todoist move <task-id> --project "Work"
# Search todoist search "meeting" ```
## 项目
```bash # List projects todoist projects
# Create project todoist projects add "New Project" --color blue ```
## 标签
```bash # List labels todoist labels
# Create label todoist labels add urgent --color red ```
## 分区
```bash # List sections todoist sections -p Work
# Create section todoist sections add "In Progress" -p Work ```
## 评论
```bash # View comments on a task todoist comment <task-id>
# Add a comment todoist comment <task-id> "This is a note" ```
## 已完成任务
```bash # Show recently completed todoist completed
# Filter by date todoist completed --since 2024-01-01 --limit 50 ```
## JSON 输出
所有命令都支持 `--json` 以输出机器可读的格式:
```bash todoist tasks --json | jq '.[] | .content' ```
## 命令参考
| 命令 | 描述 | |---------|-------------| | `todoist` | 显示今天的任务 | | `todoist tasks` | 列出带筛选的任务 | | `todoist add` | 创建一个新任务 | | `todoist complete` | 标记任务为已完成 | | `todoist done` | complete 的别名 | | `todoist reopen` | 重新打开已完成的任务 | | `todoist delete` | 删除一个任务 | | `todoist update` | 更新一个任务 | | `todoist move` | 将任务移动到分区/项目 | | `todoist view` | 查看任务详情 | | `todoist search` | 搜索任务 | | `todoist projects` | 列出/管理项目 | | `todoist labels` | 列出/管理标签 | | `todoist sections` | 列出/管理分区 | | `todoist comment` | 查看/添加评论 | | `todoist completed` | 显示已完成任务 | | `todoist auth` | 身份验证 |
## 优先级映射
| CLI | Todoist | |-----|---------| | `-P 1` | p1 (最高) | | `-P 2` | p2 | | `-P 3` | p3 | | `-P 4` | p4 (最低) |
## 注意
- 所有命令都支持 `--json` 以输出机器可读的格式