TickTick CLI — TickTick 命令行界面(CLI)
v1Manage TickTick tasks and projects from the command line with OAuth2 auth, batch operations, and rate limit handling.
运行时依赖
安装命令
点击复制技能文档
TickTick CLI 技能 管理 TickTick 任务和项目从命令行。
设置
- 注册 TickTick 开发者应用
- 认证
无头/手动认证 # 在无头服务器上使用手动模式 bun run scripts/ticktick.ts auth --client-id YOUR_CLIENT_ID --client-secret YOUR_CLIENT_SECRET --manual 这将打印授权 URL。打开它在浏览器中,批准访问,然后复制完整的重定向 URL(看起来像 http://localhost:8080/?code=XXXXX&state=STATE)并将其粘贴回 CLI。 CLI 将打开您的浏览器以授权访问。 批准后,令牌将存储在 ~/.clawdbot/credentials/ticktick-cli/config.json 中。
命令 列出任务 # 列出所有任务 bun run scripts/ticktick.ts tasks # 列出特定项目的任务 bun run scripts/ticktick.ts tasks --list "Work" # 按状态筛选 bun run scripts/ticktick.ts tasks --status pending bun run scripts/ticktick.ts tasks --status completed # JSON 输出 bun run scripts/ticktick.ts tasks --json
创建任务 # 基本任务创建 bun run scripts/ticktick.ts task "Buy groceries" --list "Personal" # 带有描述和优先级 bun run scripts/ticktick.ts task "Review PR" --list "Work" --content "Check the new auth changes" --priority high # 带有截止日期 bun run scripts/ticktick.ts task "Submit report" --list "Work" --due tomorrow bun run scripts/ticktick.ts task "Plan vacation" --list "Personal" --due "in 7 days" bun run scripts/ticktick.ts task "Meeting" --list "Work" --due "2024-12-25" # 带有标签 bun run scripts/ticktick.ts task "Research" --list "Work" --tag research important
更新任务 # 通过任务名称或 ID 更新 bun run scripts/ticktick.ts task "Buy groceries" --update --priority medium bun run scripts/ticktick.ts task "abc123" --update --due tomorrow --content "Updated notes" # 限制搜索到特定项目 bun run scripts/ticktick.ts task "Review PR" --update --list "Work" --priority low
完成任务 # 标记任务为完成 bun run scripts/ticktick.ts complete "Buy groceries" # 完成带有项目筛选 bun run scripts/ticktick.ts complete "Review PR" --list "Work"
放弃任务(不会做) # 标记任务为不会做 bun run scripts/ticktick.ts abandon "Old task" # 放弃带有项目筛选 bun run scripts/ticktick.ts abandon "Obsolete item" --list "Do"
批量放弃(多个任务) # 放弃多个任务在单个 API 调用中 bun run scripts/ticktick.ts batch-abandon # 带有 JSON 输出 bun run scripts/ticktick.ts batch-abandon abc123def456... xyz789... --json 注意:batch-abandon 需要任务 ID(24 个字符的十六进制字符串),而不是任务名称。 使用 tasks --json 获取任务 ID。
列出项目 # 列出所有项目 bun run scripts/ticktick.ts lists # JSON 输出 bun run scripts/ticktick.ts lists --json
创建项目 # 创建新项目 bun run scripts/ticktick.ts list "New Project" # 带有颜色 bun run scripts/ticktick.ts list "Work Tasks" --color "#FF5733"
更新项目 # 重命名项目 bun run scripts/ticktick.ts list "Old Name" --update --name "New Name" # 更改颜色 bun run scripts/ticktick.ts list "Work" --update --color "#00FF00"
选项参考 优先级级别 none - 无优先级(默认) low - 低优先级 medium - 中优先级 high - 高优先级
截止日期格式 today - 今天截止 tomorrow - 明天截止 in N days - N 天后截止(例如 "in 3 days") next monday - 下周一 ISO 日期 - YYYY-MM-DD 或完整 ISO 格式
全局选项 --json - 输出结果在 JSON 格式(用于脚本) --help - 显示任何命令的帮助
代理使用提示 当使用此技能作为 AI 代理时: 始终使用 --json 标志以获得机器可读输出 首先使用 lists --json 列出项目以获取有效的项目 ID 尽可能使用项目 ID 而不是名称以提高可靠性 在完成之前检查任务状态以避免错误
示例代理工作流程: # 1. 获取可用项目 bun run scripts/ticktick.ts lists --json # 2. 在特定项目中创建任务 bun run scripts/ticktick.ts task "Agent task" --list "PROJECT_ID" --priority high --json # 3.稍后标记为完成 bun run scripts/ticktick.ts complete "Agent task" --list "PROJECT_ID" --json
配置 令牌存储在 ~/.clawdbot/credentials/ticktick-cli/config.json 中: { "clientId": "YOUR_CLIENT_ID", "clientSecret": "YOUR_CLIENT_SECRET", "accessToken": "...", "refreshToken": "...", "tokenExpiry": 1234567890000, "redirectUri": "http://localhost:8080" } 注意:凭据以明文存储。 CLI 尝试设置文件权限为 700。