Dida365 OpenAPI
Overview
Use this skill to call the documented Dida365 OpenAPI surface through the bundled Python CLI.
Prefer python scripts/dida365.py ... over ad hoc curl because the bundled CLI already handles OAuth, config loading, exact project-name resolution, structured errors, and every documented endpoint.
Use Python 3.9 or newer.
The skill's default support surface is the documented API plus stable tested extensions that behaved consistently in real app/API round-trips:
- - task
kind writes for TEXT and INLINECODE4 - task
tags writes
Boundaries
This skill intentionally stays on the official Dida365 OpenAPI surface.
It does not use browser-cookie private APIs.
That means the following are explicit non-goals here:
- - standalone tag catalog / CRUD operations outside task create or update writes
- project folder / group operations
- full-account sync from private endpoints
- private batch task/project operations
- achievement or productivity-stat calculations from private data
If a user asks for those, state that they are outside the official API-backed scope of this skill.
Quick Start
- 1. Persist app config once:
-
python scripts/dida365.py auth setup --client-id ... --client-secret ... --redirect-uri ...
- 2. Preferred OAuth path:
-
python scripts/dida365.py auth login-local --client-id ... --client-secret ...
- Open the URL printed to stderr and finish the browser flow.
- 3. Verify the connection:
-
python scripts/dida365.py project data --project-id inbox
- 4. Read or write data:
-
python scripts/dida365.py project list
-
python scripts/dida365.py task create --project-id inbox --title "Example"
-
python scripts/dida365.py task completed --start-date ... --end-date ... to query completed tasks across all projects
Manual authorize-url / exchange-code flows remain supported; see references/auth-and-config.md when the localhost callback flow is not suitable.
Command Rules
- - Use
auth for OAuth helpers, token cache inspection, and token cleanup. - Use
project for project CRUD and project data reads. - Use
task for task CRUD, complete, move, completed-task queries, and filter queries. - Use
project data --project-id inbox for inbox reads. Do not use project get --project-id inbox. - Use
--project-name only when the user gave a human-readable project name. Resolution is exact match only. - Use
--json-file or --json when the payload contains arrays or nested objects such as items, reminders, bulk move operations, or advanced filter bodies. - Treat first-class flags as the final override layer.
--json-file loads a base payload, --json overrides it, and scalar flags override both. - After write operations such as
task create, task update, and task complete, prefer a read-back step when the stored result matters. Use task get to verify fields like reminders, repeatFlag, tags, and kind. - Stable task
kind writes are TEXT and NOTE. Use checklist items instead of direct CHECKLIST kind writes. - INLINECODE40 uses any-match / OR semantics in real testing, not all-match semantics.
- Unfiltered
task filter responses are capped at 200 rows for this endpoint on the tested account. Narrow the query window or add filters when completeness matters. - Use the enum values, date format, confirmed reminder patterns, and confirmed recurrence patterns from
references/api-reference.md. Do not invent undocumented values. - The CLI blocks known gray-area reminder and recurrence values. If a pattern is not listed as confirmed in
references/api-reference.md, do not assume it is safe. - Expect JSON on stdout for every command. Commands that allow successful empty responses normalize them to
{"ok": true}. - Expect structured JSON errors on stderr for validation failures and non-2xx API responses.
Auth And Config
- - Config precedence is CLI flags, then environment variables, then local files in
${XDG_CONFIG_HOME:-~/.config}/dida365-openapi/. - INLINECODE46 and
auth login-local persist config and token state; auth setup persists config without performing OAuth. - See
references/auth-and-config.md for environment variables, local file locations, and localhost callback details.
Command Selection
- - Need the raw authorization link: use
auth authorize-url. - Already have an OAuth
code: use auth exchange-code. - Want the CLI to wait for the browser callback: use
auth login-local. - Need to inspect current config or token state: use
auth status. - Need to remove only the cached token: use
auth clear-token. - Need inbox tasks or columns: use
project data --project-id inbox. - Need one project by id or exact name: use
project get. - Need tasks under a project plus columns: use
project data. - Need today's tasks: use
task filter with the local-day startDate / endDate window. - Need a weekly completion review: use
task completed with a weekly date range and omit --project-id for an account-wide view. - Need an exact documented create/update payload: prefer
--json-file. - Need a single move operation quickly: use
task move --from-project-id ... --to-project-id ... --task-id .... - Need multiple move operations: use
task move --json '[{...}, {...}]'. - Need completed tasks across all projects: omit
--project-id from task completed.
References
Dida365 OpenAPI
概述
使用此技能通过捆绑的 Python CLI 调用已文档化的 Dida365 OpenAPI 接口。优先使用 python scripts/dida365.py ... 而非临时 curl 命令,因为捆绑的 CLI 已处理 OAuth 认证、配置加载、精确项目名称解析、结构化错误以及所有已文档化的端点。需使用 Python 3.9 或更高版本。
该技能的默认支持范围包括已文档化的 API 以及在真实应用/API 往返测试中表现稳定的扩展功能:
- - 任务 kind 写入支持 TEXT 和 NOTE
- 任务 tags 写入支持
边界
本技能严格限定在官方 Dida365 OpenAPI 接口范围内,不使用浏览器 Cookie 私有 API。
这意味着以下功能明确不在本技能目标范围内:
- - 独立标签目录/除任务创建或更新写入外的 CRUD 操作
- 项目文件夹/分组操作
- 通过私有端点进行全账户同步
- 私有批量任务/项目操作
- 基于私有数据的成就或生产力统计计算
若用户提出相关需求,需明确说明这些功能超出本技能基于官方 API 的支持范围。
快速开始
- 1. 持久化应用配置一次:
- python scripts/dida365.py auth setup --client-id ... --client-secret ... --redirect-uri ...
- 2. 推荐 OAuth 路径:
- python scripts/dida365.py auth login-local --client-id ... --client-secret ...
- 打开输出到 stderr 的 URL 并完成浏览器流程。
- 3. 验证连接:
- python scripts/dida365.py project data --project-id inbox
- 4. 读取或写入数据:
- python scripts/dida365.py project list
- python scripts/dida365.py task create --project-id inbox --title 示例
- python scripts/dida365.py task completed --start-date ... --end-date ... 查询所有项目中的已完成任务
手动 authorize-url / exchange-code 流程仍受支持;当本地主机回调流程不适用时,请参阅 references/auth-and-config.md。
命令规则
- - 使用 auth 进行 OAuth 辅助、令牌缓存检查和令牌清理。
- 使用 project 进行项目 CRUD 和项目数据读取。
- 使用 task 进行任务 CRUD、完成、移动、已完成任务查询和筛选查询。
- 使用 project data --project-id inbox 读取收件箱。不要使用 project get --project-id inbox。
- 仅当用户提供人类可读的项目名称时使用 --project-name。解析仅支持精确匹配。
- 当负载包含数组或嵌套对象(如 items、reminders、批量移动操作或高级筛选主体)时,使用 --json-file 或 --json。
- 将一级标志视为最终覆盖层。--json-file 加载基础负载,--json 覆盖它,标量标志覆盖两者。
- 在写入操作(如 task create、task update 和 task complete)后,当存储结果重要时,优先进行回读步骤。使用 task get 验证 reminders、repeatFlag、tags 和 kind 等字段。
- 稳定的任务 kind 写入值为 TEXT 和 NOTE。使用清单 items 而非直接的 CHECKLIST kind 写入。
- task filter --tag-json 在实际测试中使用任意匹配/或语义,而非全匹配语义。
- 未筛选的 task filter 响应在测试账户上限制为最多 200 行。当完整性重要时,缩小查询窗口或添加筛选条件。
- 使用 references/api-reference.md 中的枚举值、日期格式、已确认的提醒模式和已确认的重复模式。不要发明未文档化的值。
- CLI 会阻止已知的灰色区域提醒和重复值。如果某个模式未在 references/api-reference.md 中列为已确认,不要假定其安全。
- 每个命令预期 stdout 输出 JSON。允许成功空响应的命令会将其规范化为 {ok: true}。
- 对于验证失败和非 2xx API 响应,预期 stderr 输出结构化 JSON 错误。
认证与配置
- - 配置优先级为:CLI 标志 > 环境变量 > ${XDGCONFIGHOME:-~/.config}/dida365-openapi/ 中的本地文件。
- auth exchange-code 和 auth login-local 会持久化配置和令牌状态;auth setup 仅持久化配置而不执行 OAuth。
- 有关环境变量、本地文件位置和本地主机回调详情,请参阅 references/auth-and-config.md。
命令选择
- - 需要原始授权链接:使用 auth authorize-url。
- 已有 OAuth code:使用 auth exchange-code。
- 希望 CLI 等待浏览器回调:使用 auth login-local。
- 需要检查当前配置或令牌状态:使用 auth status。
- 需要仅移除缓存的令牌:使用 auth clear-token。
- 需要收件箱任务或列:使用 project data --project-id inbox。
- 需要按 ID 或精确名称获取单个项目:使用 project get。
- 需要项目下的任务及列:使用 project data。
- 需要今日任务:使用 task filter 并设置本地日期的 startDate/endDate 窗口。
- 需要每周完成情况回顾:使用 task completed 并设置每周日期范围,省略 --project-id 以获取全账户视图。
- 需要精确的文档化创建/更新负载:优先使用 --json-file。
- 需要快速执行单个移动操作:使用 task move --from-project-id ... --to-project-id ... --task-id ...。
- 需要执行多个移动操作:使用 task move --json [{...}, {...}]。
- 需要跨所有项目的已完成任务:在 task completed 中省略 --project-id。
参考资料