todoist-api
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTodoist API
Todoist API
When to use this skill
何时使用此技能
Use this skill when work involves Todoist data or automation, especially:
- capture or quick-add new tasks
- inspect, filter, move, complete, reopen, or delete tasks
- manage projects, sections, labels, or comments
- resolve human names to Todoist IDs before writing
- perform safer bulk edits with dry-runs
- review completed work or recent activity
- build Todoist scripts, agents, or integrations around the public API
当工作涉及Todoist数据或自动化时使用此技能,尤其是以下场景:
- 捕获或快速添加新任务
- 查看、筛选、移动、完成、重新打开或删除任务
- 管理项目、分区、标签或评论
- 在写入操作前将人工命名的名称解析为Todoist ID
- 通过预演(dry-run)执行更安全的批量编辑
- 查看已完成工作或近期活动
- 围绕公开API构建Todoist脚本、Agent或集成
When not to use this skill
何时不使用此技能
Do not use this skill for:
- editing the user’s local Todoist app UI directly
- calendar-specific workflows that belong in a calendar skill
- attachment upload flows that require multipart handling unless you are prepared to use or the
curlescape hatchraw - non-Todoist task systems
请勿在以下场景使用此技能:
- 直接编辑用户本地Todoist应用的UI
- 属于日历技能的特定日历工作流
- 需要多部分处理的附件上传流程(除非你准备使用或
curl兜底方案)raw - 非Todoist的任务管理系统
Safety defaults
安全默认设置
- Start read-only if the user’s intent is ambiguous.
- Resolve names to IDs before any write.
- Prefer close over delete unless the user explicitly wants permanent removal.
- Run first for bulk or destructive work.
--dry-run - Use for bulk closes, moves, repeated comments, and deletes.
--confirm - If a command may return a large payload, set so stdout stays small and predictable.
--output FILE
- 如果用户意图不明确,先以只读模式开始操作。
- 在执行任何写入操作前,将名称解析为ID。
- 除非用户明确要求永久删除,否则优先选择关闭(close)而非删除(delete)。
- 对于批量或破坏性操作,先运行预演。
--dry-run - 执行批量关闭、移动、重复评论和删除操作时,使用确认。
--confirm - 如果命令可能返回大体积结果,设置,使标准输出保持小巧且可预测。
--output FILE
Pick the smallest capable surface
选择最小适用范围
- One object, one endpoint → use a low-level REST wrapper such as ,
get-task, orupdate-project.get-comment - Natural-language capture → use .
quick-add-task - Resolve names safely → use ,
resolve-project,resolve-section.resolve-label - Create if missing → use ,
ensure-project,ensure-section.ensure-label - Many matching tasks → use ,
bulk-close-tasks,bulk-move-tasks.bulk-comment-tasks - Completed-work review → use or
report-completed.get-completed-tasks - Full or incremental sync / batched writes → use .
sync - Unwrapped or niche endpoint → use .
raw
- 单个对象,单个端点 → 使用低级REST封装,如、
get-task或update-project。get-comment - 自然语言捕获 → 使用。
quick-add-task - 安全解析名称 → 使用、
resolve-project、resolve-section。resolve-label - 不存在则创建 → 使用、
ensure-project、ensure-section。ensure-label - 多个匹配任务 → 使用、
bulk-close-tasks、bulk-move-tasks。bulk-comment-tasks - 已完成工作回顾 → 使用或
report-completed。get-completed-tasks - 全量或增量同步 / 批量写入 → 使用。
sync - 未封装或小众端点 → 使用。
raw
Output contract
输出约定
The main script prints structured output to stdout by default.
- returns a stable JSON envelope with fields like
--format json,action,ok,count,next_cursor,matched_count, andchanged_count.resolved - returns a smaller human-readable summary.
--format summary - writes the full output to a file and prints a small JSON notice to stdout.
--output FILE
This is designed for agent pipelines: stdout stays parseable, stderr carries diagnostics, and retries are built in for transient failures.
主脚本默认向标准输出打印结构化结果。
- 返回稳定的JSON包,包含
--format json、action、ok、count、next_cursor、matched_count和changed_count等字段。resolved - 返回更简洁的人类可读摘要。
--format summary - 将完整输出写入文件,并向标准输出打印一个小型JSON通知。
--output FILE
此设计适用于Agent流水线:标准输出保持可解析,标准错误输出承载诊断信息,且内置了针对临时故障的重试机制。
Scripts
脚本
- — main non-interactive Todoist CLI
scripts/todoist_api.py - — read-only connectivity check
scripts/smoke_test.py
Inspect help first:
bash
python3 scripts/todoist_api.py --help
python3 scripts/todoist_api.py get-tasks-by-filter --help
python3 scripts/todoist_api.py bulk-move-tasks --help
python3 scripts/smoke_test.py --help- — 主要的非交互式Todoist CLI工具
scripts/todoist_api.py - — 只读连通性检查工具
scripts/smoke_test.py
先查看帮助信息:
bash
python3 scripts/todoist_api.py --help
python3 scripts/todoist_api.py get-tasks-by-filter --help
python3 scripts/todoist_api.py bulk-move-tasks --help
python3 scripts/smoke_test.py --helpQuick start
快速开始
Set a token:
bash
export TODOIST_API_TOKEN="YOUR_TODOIST_TOKEN"Read-only smoke test:
bash
python3 scripts/smoke_test.pySanity-check access:
bash
python3 scripts/todoist_api.py get-projects --limit 5
python3 scripts/todoist_api.py get-labels --limit 10Resolve names before writes:
bash
python3 scripts/todoist_api.py resolve-project --name "Inbox"
python3 scripts/todoist_api.py resolve-section --project-name "Client Alpha" --name "Next Actions"
python3 scripts/todoist_api.py resolve-label --name "waiting-on"设置令牌:
bash
export TODOIST_API_TOKEN="YOUR_TODOIST_TOKEN"只读连通性测试:
bash
python3 scripts/smoke_test.py验证访问权限:
bash
python3 scripts/todoist_api.py get-projects --limit 5
python3 scripts/todoist_api.py get-labels --limit 10写入操作前解析名称:
bash
python3 scripts/todoist_api.py resolve-project --name "Inbox"
python3 scripts/todoist_api.py resolve-section --project-name "Client Alpha" --name "Next Actions"
python3 scripts/todoist_api.py resolve-label --name "waiting-on"High-value agent workflows
高价值Agent工作流
Quick add
快速添加
bash
python3 scripts/todoist_api.py quick-add-task \
--text "Email Chris tomorrow at 09:00 #Work @follow-up p2"bash
python3 scripts/todoist_api.py quick-add-task \
--text "Email Chris tomorrow at 09:00 #Work @follow-up p2"Create-if-missing section
不存在则创建分区
bash
python3 scripts/todoist_api.py ensure-section \
--project-name "Client Alpha" \
--name "Next Actions"bash
python3 scripts/todoist_api.py ensure-section \
--project-name "Client Alpha" \
--name "Next Actions"Preview a bulk close
预演批量关闭
bash
python3 scripts/todoist_api.py bulk-close-tasks \
--filter "overdue & @errands" \
--dry-runbash
python3 scripts/todoist_api.py bulk-close-tasks \
--filter "overdue & @errands" \
--dry-runExecute the same bulk close
执行相同的批量关闭
bash
python3 scripts/todoist_api.py bulk-close-tasks \
--filter "overdue & @errands" \
--confirmbash
python3 scripts/todoist_api.py bulk-close-tasks \
--filter "overdue & @errands" \
--confirmMove matching tasks into a resolved section
将匹配任务移动到已解析的分区
bash
python3 scripts/todoist_api.py bulk-move-tasks \
--filter "#Inbox & !recurring" \
--target-project-name "Work" \
--target-section-name "Next Actions" \
--dry-runbash
python3 scripts/todoist_api.py bulk-move-tasks \
--filter "#Inbox & !recurring" \
--target-project-name "Work" \
--target-section-name "Next Actions" \
--dry-runReport completed work
生成已完成工作报告
bash
python3 scripts/todoist_api.py report-completed \
--since "2026-03-01T00:00:00Z" \
--until "2026-03-31T23:59:59Z" \
--by completion \
--output reports/march-completed.jsonbash
python3 scripts/todoist_api.py report-completed \
--since "2026-03-01T00:00:00Z" \
--until "2026-03-31T23:59:59Z" \
--by completion \
--output reports/march-completed.jsonRecommended operating pattern
推荐操作流程
- Resolve or list the target object.
- Read current state with a low-level getter.
- Preview the write with .
--dry-run - Execute with when needed.
--confirm - Verify by re-reading or by running a report command.
- 解析或列出目标对象。
- 使用低级获取命令读取当前状态。
- 使用预演写入操作。
--dry-run - 需要时使用执行操作。
--confirm - 通过重新读取或运行报告命令验证结果。
Feature index
功能索引
- Command catalogue and endpoint coverage → references/REFERENCE.md
- Task-first recipes → references/RECIPES.md
- Todoist-specific caveats → references/GOTCHAS.md
- 命令目录与端点覆盖 → references/REFERENCE.md
- 任务优先方案 → references/RECIPES.md
- Todoist特定注意事项 → references/GOTCHAS.md
Escape hatches
兜底方案
Use when the public CLI surface does not yet wrap a needed endpoint:
rawbash
python3 scripts/todoist_api.py raw \
--method GET \
--path /projects/PROJECT_ID/fullUse when you need incremental sync or batched commands:
syncbash
python3 scripts/todoist_api.py sync \
--sync-token '*' \
--resource-types '["all"]'当公开CLI尚未封装所需端点时,使用:
rawbash
python3 scripts/todoist_api.py raw \
--method GET \
--path /projects/PROJECT_ID/full当你需要增量同步或批量命令时,使用:
syncbash
python3 scripts/todoist_api.py sync \
--sync-token '*' \
--resource-types '["all"]'