todoist-api
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTodoist CLI Skill
Todoist CLI Skill
This skill provides procedural guidance for working with Todoist using the CLI tool.
td本Skill提供了使用 CLI工具操作Todoist的流程指引。
tdPrerequisites
前置条件
The CLI must be installed and authenticated. Verify with:
tdbash
td auth statusIf td is not installed or not authenticated:
- Not installed: Tell the user to install with
npm install -g @doist/todoist-cli - Not authenticated: Tell the user to run to authenticate via OAuth
td auth login
必须已安装并认证 CLI。可通过以下命令验证:
tdbash
td auth status如果未安装或未认证:
- 未安装: 告知用户使用进行安装
npm install -g @doist/todoist-cli - 未认证: 告知用户运行通过OAuth完成认证
td auth login
Output Formats for Agents
面向Agent的输出格式
For machine-readable output, use these flags:
- - Output as JSON array
--json - - Output as newline-delimited JSON (one object per line)
--ndjson - - Include all fields in JSON output (default shows essential fields only)
--full
如需机器可读的输出,可使用以下标志:
- - 以JSON数组格式输出
--json - - 以换行分隔的JSON格式输出(每行一个对象)
--ndjson - - 在JSON输出中包含所有字段(默认仅显示必要字段)
--full
Confirmation Requirement
确认要求
Before executing any destructive action, always ask the user for confirmation using AskUserQuestion or similar tool. A single confirmation suffices for a logical group of related actions.
Destructive actions include:
- Deleting tasks, projects, sections, labels, or comments
- Completing tasks
- Updating existing resources
- Archiving projects
Read-only operations do not require confirmation.
在执行任何破坏性操作前,务必使用AskUserQuestion或类似工具向用户确认。 一组相关的逻辑操作只需一次确认即可。
破坏性操作包括:
- 删除任务、项目、分区、标签或评论
- 完成任务
- 更新现有资源
- 归档项目
只读操作无需确认。
Quick Commands
快速命令
| Command | Description |
|---|---|
| Quick add with natural language parsing |
| Tasks due today and overdue |
| Tasks due in next N days (default: 7) |
| Tasks in Inbox |
| Recently completed tasks |
| 命令 | 描述 |
|---|---|
| 支持自然语言解析的快速添加 |
| 今日到期及逾期的任务 |
| 未来N天内到期的任务(默认:7天) |
| 收件箱中的任务 |
| 最近完成的任务 |
Quick Add Examples
快速添加示例
bash
td add "Buy milk tomorrow p1 #Shopping"
td add "Call dentist every monday @health"
td add "Review PR #Work /Code Review"The quick add parser supports:
- Due dates: ,
tomorrow,next mondayJan 15 - Priority: (urgent) through
p1(normal)p4 - Project:
#ProjectName - Section:
/SectionName - Labels:
@label1 @label2
bash
td add "Buy milk tomorrow p1 #Shopping"
td add "Call dentist every monday @health"
td add "Review PR #Work /Code Review"快速添加解析器支持:
- 到期日期:,
tomorrow,next mondayJan 15 - 优先级:(紧急)至
p1(普通)p4 - 项目:
#ProjectName - 分区:
/SectionName - 标签:
@label1 @label2
Tasks
任务
List Tasks
列出任务
bash
td task list [options]Filters:
- - Filter by project name or id:xxx
--project <name> - - Filter by label (comma-separated for multiple)
--label <name> - - Filter by priority
--priority <p1-p4> - - Filter by due date (today, overdue, or YYYY-MM-DD)
--due <date> - - Raw Todoist filter query
--filter <query> - - Filter by assignee (me or id:xxx)
--assignee <ref> - - Filter to workspace
--workspace <name> - - Filter to personal projects only
--personal
Output:
bash
td task list --json # JSON array
td task list --project "Work" --json # Filtered JSON
td task list --all --json # All tasks (no limit)bash
td task list [options]筛选条件:
- - 按项目名称或id:xxx筛选
--project <name> - - 按标签筛选(多个标签用逗号分隔)
--label <name> - - 按优先级筛选
--priority <p1-p4> - - 按到期日期筛选(today、overdue或YYYY-MM-DD格式)
--due <date> - - 原生Todoist筛选查询语句
--filter <query> - - 按被分配人筛选(me或id:xxx)
--assignee <ref> - - 按工作区筛选
--workspace <name> - - 仅筛选个人项目
--personal
输出示例:
bash
td task list --json # JSON数组格式
td task list --project "Work" --json # 筛选后的JSON格式
td task list --all --json # 所有任务(无数量限制)View Task Details
查看任务详情
bash
td task view <ref> # Human-readable
td task view <ref> --json # JSON outputThe ref can be a task name, partial match, or .
id:xxxbash
td task view <ref> # 人类可读格式
td task view <ref> --json # JSON格式输出<ref>id:xxxCreate Task
创建任务
Quick add (natural language):
bash
td add "Task text with #Project @label tomorrow p2"Explicit flags:
bash
td task add --content "Task text" \
--project "Work" \
--due "tomorrow" \
--priority p2 \
--labels "urgent,review" \
--description "Additional details"Options:
- - Task content (required)
--content <text> - - Due date (natural language or YYYY-MM-DD)
--due <date> - - Deadline date (YYYY-MM-DD)
--deadline <date> - - Priority level
--priority <p1-p4> - - Project name or id:xxx
--project <name> - - Section ID
--section <id> - - Comma-separated labels
--labels <a,b> - - Parent task for subtask
--parent <ref> - - Task description
--description <text> - - Assign to user (name, email, id:xxx, or "me")
--assignee <ref> - - Duration (e.g., 30m, 1h, 2h15m)
--duration <time>
快速添加(自然语言):
bash
td add "Task text with #Project @label tomorrow p2"显式参数:
bash
td task add --content "Task text" \
--project "Work" \
--due "tomorrow" \
--priority p2 \
--labels "urgent,review" \
--description "Additional details"可选参数:
- - 任务内容(必填)
--content <text> - - 到期日期(自然语言或YYYY-MM-DD格式)
--due <date> - - 截止日期(YYYY-MM-DD格式)
--deadline <date> - - 优先级等级
--priority <p1-p4> - - 项目名称或id:xxx
--project <name> - - 分区ID
--section <id> - - 逗号分隔的标签列表
--labels <a,b> - - 子任务的父任务
--parent <ref> - - 任务描述
--description <text> - - 分配给指定用户(名称、邮箱、id:xxx或"me")
--assignee <ref> - - 时长(例如:30m、1h、2h15m)
--duration <time>
Update Task
更新任务
bash
td task update <ref> --content "New content" --due "next week"Options:
- - New content
--content <text> - - New due date
--due <date> - - Deadline date
--deadline <date> - - Remove deadline
--no-deadline - - New priority
--priority <p1-p4> - - Replace labels
--labels <a,b> - - New description
--description <text> - - Assign to user
--assignee <ref> - - Remove assignee
--unassign - - Duration
--duration <time>
bash
td task update <ref> --content "New content" --due "next week"可选参数:
- - 新的任务内容
--content <text> - - 新的到期日期
--due <date> - - 截止日期
--deadline <date> - - 移除截止日期
--no-deadline - - 新的优先级
--priority <p1-p4> - - 替换标签
--labels <a,b> - - 新的任务描述
--description <text> - - 分配给指定用户
--assignee <ref> - - 移除被分配人
--unassign - - 时长
--duration <time>
Complete Task
完成任务
bash
td task complete <ref>bash
td task complete <ref>Reopen Task
重新打开任务
bash
td task uncomplete id:xxxNote: Uncomplete requires the task ID (id:xxx format).
bash
td task uncomplete id:xxx注意:重新打开任务需要使用任务ID(id:xxx格式)。
Delete Task
删除任务
bash
td task delete <ref>bash
td task delete <ref>Move Task
移动任务
bash
td task move <ref> --project "New Project"
td task move <ref> --section <section-id>
td task move <ref> --parent <task-ref>bash
td task move <ref> --project "New Project"
td task move <ref> --section <section-id>
td task move <ref> --parent <task-ref>Open in Browser
在浏览器中打开
bash
td task browse <ref>bash
td task browse <ref>Projects
项目
List Projects
列出项目
bash
td project list # Human-readable tree
td project list --json # JSON array
td project list --personal --json # Personal projects onlybash
td project list # 人类可读的树形结构
td project list --json # JSON数组格式
td project list --personal --json # 仅列出个人项目View Project
查看项目详情
bash
td project view <ref>
td project view <ref> --jsonbash
td project view <ref>
td project view <ref> --jsonCreate Project
创建项目
bash
td project create --name "Project Name" \
--color "blue" \
--parent "Parent Project" \
--view-style board \
--favoriteOptions:
- - Project name (required)
--name <name> - - Colour name
--color <color> - - Parent project for nesting
--parent <ref> - - "list" or "board"
--view-style <style> - - Mark as favourite
--favorite
bash
td project create --name "Project Name" \
--color "blue" \
--parent "Parent Project" \
--view-style board \
--favorite可选参数:
- - 项目名称(必填)
--name <name> - - 颜色名称
--color <color> - - 嵌套项目的父项目
--parent <ref> - - "list"或"board"
--view-style <style> - - 标记为收藏
--favorite
Update Project
更新项目
bash
td project update <ref> --name "New Name" --color "red"bash
td project update <ref> --name "New Name" --color "red"Archive/Unarchive Project
归档/取消归档项目
bash
td project archive <ref>
td project unarchive <ref>bash
td project archive <ref>
td project unarchive <ref>Delete Project
删除项目
bash
td project delete <ref>Note: Project must have no uncompleted tasks.
bash
td project delete <ref>注意:项目必须没有未完成的任务才能删除。
List Collaborators
列出协作者
bash
td project collaborators <ref>bash
td project collaborators <ref>Sections
分区
List Sections
列出分区
bash
td section list <project> # Human-readable
td section list <project> --json # JSON arraybash
td section list <project> # 人类可读格式
td section list <project> --json # JSON数组格式Create Section
创建分区
bash
td section create --name "Section Name" --project "Project Name"bash
td section create --name "Section Name" --project "Project Name"Update Section
更新分区
bash
td section update <id> --name "New Name"bash
td section update <id> --name "New Name"Delete Section
删除分区
bash
td section delete <id>bash
td section delete <id>Labels
标签
List Labels
列出标签
bash
td label list # Human-readable
td label list --json # JSON arraybash
td label list # 人类可读格式
td label list --json # JSON数组格式Create Label
创建标签
bash
td label create --name "label-name" --color "green" --favoritebash
td label create --name "label-name" --color "green" --favoriteUpdate Label
更新标签
bash
td label update <ref> --name "new-name" --color "blue"bash
td label update <ref> --name "new-name" --color "blue"Delete Label
删除标签
bash
td label delete <name>bash
td label delete <name>Comments
评论
List Comments
列出评论
bash
td comment list <task-ref> # Comments on task
td comment list <project-ref> --project # Comments on projectbash
td comment list <task-ref> # 任务下的评论
td comment list <project-ref> --project # 项目下的评论Add Comment
添加评论
bash
td comment add <task-ref> --content "Comment text"
td comment add <project-ref> --project --content "Comment text"bash
td comment add <task-ref> --content "Comment text"
td comment add <project-ref> --project --content "Comment text"Update Comment
更新评论
bash
td comment update <id> --content "Updated text"bash
td comment update <id> --content "Updated text"Delete Comment
删除评论
bash
td comment delete <id>bash
td comment delete <id>Reminders
提醒
List Reminders
列出提醒
bash
td reminder list <task-ref>bash
td reminder list <task-ref>Add Reminder
添加提醒
bash
td reminder add <task-ref> --due "tomorrow 9am"bash
td reminder add <task-ref> --due "tomorrow 9am"Delete Reminder
删除提醒
bash
td reminder delete <id>bash
td reminder delete <id>Filters
筛选器
List Saved Filters
列出已保存的筛选器
bash
td filter list --jsonbash
td filter list --jsonShow Tasks Matching Filter
显示匹配筛选器的任务
bash
td filter show <filter-ref> --jsonbash
td filter show <filter-ref> --jsonCreate Filter
创建筛选器
bash
td filter create --name "My Filter" --query "today & p1"bash
td filter create --name "My Filter" --query "today & p1"Completed Tasks
已完成任务
bash
td completed # Today's completed tasks
td completed --since 2024-01-01 # Since specific date
td completed --project "Work" --json # Filtered JSON output
td completed --all --json # All completed (no limit)Options:
- - Start date (YYYY-MM-DD), default: today
--since <date> - - End date (YYYY-MM-DD), default: tomorrow
--until <date> - - Filter by project
--project <name>
bash
td completed # 今日完成的任务
td completed --since 2024-01-01 # 自指定日期起完成的任务
td completed --project "Work" --json # 筛选后的JSON格式输出
td completed --all --json # 所有已完成任务(无数量限制)可选参数:
- - 起始日期(YYYY-MM-DD格式),默认:今日
--since <date> - - 结束日期(YYYY-MM-DD格式),默认:明日
--until <date> - - 按项目筛选
--project <name>
Activity and Stats
活动与统计
bash
td activity # Recent activity
td stats # Productivity stats and karmabash
td activity # 近期活动
td stats # 生产力统计与积分Pagination
分页
For large result sets, use to fetch everything, or handle pagination with cursors:
--allbash
undefined对于大型结果集,使用参数获取所有数据,或使用游标处理分页:
--allbash
undefinedFirst page
第一页
result=$(td task list --json --limit 50)
result=$(td task list --json --limit 50)
If there's a next_cursor in the response, continue
如果响应中存在next_cursor,继续获取下一页
cursor=$(echo "$result" | jq -r '.[-1].id // empty')
td task list --json --limit 50 --cursor "$cursor"
undefinedcursor=$(echo "$result" | jq -r '.[-1].id // empty')
td task list --json --limit 50 --cursor "$cursor"
undefinedReference Resolution
引用解析
The parameter in commands accepts:
<ref>- Task/project/label name (partial match supported)
- for exact ID match
id:xxx - Numeric ID (interpreted as id:xxx)
命令中的参数支持:
<ref>- 任务/项目/标签的名称(支持部分匹配)
- 格式的精确ID匹配
id:xxx - 数字ID(会被解析为id:xxx格式)
Additional Reference
额外参考
For detailed information on specific topics, consult:
- - Alternative methods for completed task history via API
references/completed-tasks.md - - Todoist filter query syntax for
references/filters.mdflag--filter
如需特定主题的详细信息,请参考:
- - 通过API获取已完成任务历史的替代方法
references/completed-tasks.md - - 用于
references/filters.md参数的Todoist筛选查询语法--filter
Workflow Summary
工作流总结
- Verify authentication -
td auth status - Read operations - Execute directly without confirmation
- Write operations - Ask for confirmation before executing
- Use JSON output - Add flag for machine-readable data
--json - Handle large datasets - Use or pagination with
--all--cursor
- 验证认证状态 -
td auth status - 只读操作 - 直接执行,无需确认
- 写入操作 - 执行前需向用户确认
- 使用JSON输出 - 添加参数以获取机器可读数据
--json - 处理大型数据集 - 使用参数或通过
--all进行分页--cursor