Todoist CLI
Manage Todoist via the REST API v2.
Setup
- 1. Get API token: Todoist → Settings → Integrations → Developer → API token
- Set environment variable:
export TODOIST_API_TOKEN="your_token_here"
- 3. Make CLI executable:
CODEBLOCK1
CLI Location
CODEBLOCK2
Quick Reference
Tasks
CODEBLOCK3
Projects
CODEBLOCK4
Sections
CODEBLOCK5
Labels
CODEBLOCK6
Comments
CODEBLOCK7
Filter Syntax
Todoist supports powerful filter queries:
| Filter | Description |
|---|
| INLINECODE0 | Due today |
| INLINECODE1 |
Due tomorrow |
|
overdue | Past due |
|
7 days | Due in next 7 days |
|
no date | No due date |
|
#ProjectName | In specific project |
|
@label | Has label |
|
p1,
p2,
p3,
p4 | Priority level |
|
assigned to: me | Assigned to you |
|
created: today | Created today |
Combine with & (and) or | (or):
CODEBLOCK8
Due Date Strings
Natural language due dates:
- -
today, tomorrow, INLINECODE17 - INLINECODE18 , INLINECODE19
- INLINECODE20
- INLINECODE21 , INLINECODE22
- INLINECODE23
- INLINECODE24 , INLINECODE25
- INLINECODE26
Priority Levels
| Value | Meaning |
|---|
| 1 | Normal (default) |
| 2 |
Medium |
| 3 | High |
| 4 | Urgent |
Output
All commands return JSON. Pipe to jq for formatting:
CODEBLOCK9
Notes
- - Requires
curl and INLINECODE29 - All output is JSON for easy scripting
- Task IDs are numeric strings (e.g., "8765432109")
- Project IDs are also numeric strings
Todoist CLI
通过REST API v2管理Todoist。
设置
- 1. 获取API令牌:Todoist → 设置 → 集成 → 开发者 → API令牌
- 设置环境变量:
bash
export TODOIST
APITOKEN=your
tokenhere
- 3. 使CLI可执行:
bash
chmod +x ~/clawd/skills/todoist/scripts/todoist
CLI位置
bash
~/clawd/skills/todoist/scripts/todoist
快速参考
任务
bash
列出所有任务
todoist tasks
带筛选条件列出
todoist tasks --filter today
todoist tasks --filter overdue
todoist tasks --filter #Work
todoist tasks --project PROJECT_ID
快速视图
todoist today
todoist overdue
todoist upcoming
获取单个任务
todoist task TASK_ID
添加任务
todoist add 购买杂货
todoist add 给妈妈打电话 --due tomorrow
todoist add 会议准备 --due today 3pm --priority 4
todoist add 审查PR --project PROJECT_ID --labels work,urgent
todoist add 编写文档 --description 包含示例
更新任务
todoist update TASK_ID --content 新标题
todoist update TASK_ID --due next monday
todoist update TASK_ID --priority 3
完成/重新打开/删除
todoist complete TASK_ID
todoist reopen TASK_ID
todoist delete-task TASK_ID
项目
bash
列出项目
todoist projects
获取项目
todoist project PROJECT_ID
创建项目
todoist add-project 工作
todoist add-project 个人 --color blue --favorite
更新项目
todoist update-project PROJECT_ID --name 新名称
todoist update-project PROJECT_ID --color red
删除项目
todoist delete-project PROJECT_ID
分区
bash
列出分区
todoist sections
todoist sections PROJECT_ID
创建分区
todoist add-section --name 进行中 --project PROJECT_ID
删除分区
todoist delete-section SECTION_ID
标签
bash
列出标签
todoist labels
创建标签
todoist add-label 紧急
todoist add-label 受阻 --color red
删除标签
todoist delete-label LABEL_ID
评论
bash
列出评论
todoist comments --task TASK_ID
todoist comments --project PROJECT_ID
添加评论
todoist add-comment 需要更多信息 --task TASK_ID
删除评论
todoist delete-comment COMMENT_ID
筛选语法
Todoist支持强大的筛选查询:
明天到期 |
| overdue | 已逾期 |
| 7 days | 未来7天内到期 |
| no date | 无到期日 |
| #ProjectName | 在特定项目中 |
| @label | 包含标签 |
| p1, p2, p3, p4 | 优先级等级 |
| assigned to: me | 分配给你 |
| created: today | 今天创建 |
使用&(与)或|(或)组合:
bash
todoist tasks --filter today & #Work
todoist tasks --filter overdue | p1
到期日期字符串
自然语言到期日期:
- - today, tomorrow, yesterday
- next monday, next week
- in 3 days
- every day, every weekday
- every monday at 9am
- Jan 15, 2026-01-20
- today at 3pm
优先级等级
中等 |
| 3 | 高 |
| 4 | 紧急 |
输出
所有命令返回JSON格式。可通过管道传递给jq进行格式化:
bash
todoist tasks | jq .[] | {id, content, due: .due.string}
todoist today | jq -r .[].content
备注
- - 需要curl和jq
- 所有输出均为JSON格式,便于脚本处理
- 任务ID为数字字符串(例如:8765432109)
- 项目ID同样为数字字符串