跳转到主要内容

概述

任务命令让您无需打开 Web 应用即可管理 Apollo 任务。所有命令都支持模糊名称解析 — 您可以通过标题、部分匹配或 UUID 来引用任务。

命令

列出任务

# Your assigned tasks (shortcut)
apollo task mine

# All tasks in a project
apollo task list -p "Apollo"

# Filter by status
apollo task list -s todo,in_progress

# Combine filters
apollo task list -p "Apollo" -s in_progress -a me --limit 50

# Filter by release, specialty, or task type
apollo task list -p "Delfin One" --release "P3.1"
apollo task list -p "Delfin One" --specialty "frontend"
apollo task list -p "Delfin One" --unassigned --due-before 2026-03-01
选项:
Flag描述
-p, --project <name>按项目名称或 ID 筛选
-s, --status <status>按状态筛选:backlogtodoin_progressblockeddone
-a, --assignee <name>按负责人筛选(使用 me 表示自己)
--release <name>按发布名称筛选(模糊匹配)
--specialty <name>按专业领域筛选(如 frontendback-endai
--task-type <name>按任务类型筛选(如 featurebugchore
--unassigned仅显示未分配的任务
--due-before <date>显示截止日期在指定日期之前的任务(YYYY-MM-DD)
--limit <n>最大结果数(默认:50)

查看任务详情

# By title (fuzzy match)
apollo task view "fix auth"

# By UUID
apollo task view 550e8400-e29b-41d4-a716-446655440000
显示完整的任务详情:状态、优先级、负责人、项目、描述、日期和依赖关系。

创建任务

# Basic
apollo task create -t "Add dark mode to CLI" -p "Apollo"

# Full options
apollo task create \
  -t "Implement token refresh" \
  -p "Delfin One" \
  --priority high \
  --assignee me \
  --description "Handle expired JWT tokens gracefully" \
  --due 2026-03-15
选项:
Flag描述
-t, --title <title>任务标题(必填)
-p, --project <name>项目名称或 ID(必填)
--priority <level>criticalhighmediumlow
--assignee <name>负责人名称或 me
--description <text>任务描述
--due <date>截止日期(YYYY-MM-DD)
--hours <n>预估工时

更新任务

# Change status
apollo task update <id> -s in_progress

# Change priority and assignee
apollo task update <id> --priority critical --assignee "carlos"

# Update description
apollo task update <id> --description "Updated requirements: also handle refresh tokens"

# Set due date and estimated hours
apollo task update <id> --due 2026-04-01 --hours 8
选项:
Flag描述
-s, --status <status>新状态
--priority <level>新优先级
--assignee <name>新负责人
--description <text>新描述
--due <date>新截止日期(YYYY-MM-DD)
--hours <n>新预估工时

快捷操作

# Mark as done
apollo task done <id-or-title>

# Assign to someone
apollo task assign <id-or-title> "Ian"

批量操作

为了一次管理多个任务,CLI 提供了批量命令,可以按项目、状态或显式 ID 对任务集进行操作。

批量状态更新

一次更改多个任务的状态:
# By explicit IDs
apollo task bulk-status -s done --ids "id1,id2,id3"

# By project + current status filter
apollo task bulk-status -s in_progress -p "Apollo" --current-status todo

# Move all blocked tasks in a project to todo
apollo task bulk-status -s todo -p "Apollo" --current-status blocked
选项:
Flag描述
-s, --status <status>要设置的新状态(必填)
--ids <id1,id2,...>逗号分隔的任务 ID
-p, --project <name>按项目筛选
--current-status <status>仅更新具有此当前状态的任务

批量分配

将多个任务分配给团队成员:
# Assign specific tasks
apollo task bulk-assign -a me --ids "id1,id2"

# Assign all unassigned tasks in a project
apollo task bulk-assign -a "Ian" -p "Apollo" --unassigned-only
选项:
Flag描述
-a, --assignee <name>负责人名称或 me(必填)
--ids <id1,id2,...>逗号分隔的任务 ID
-p, --project <name>按项目筛选
--unassigned-only仅分配当前未分配的任务

批量创建

从 JSON 文件一次创建多个任务:
# From a JSON file
apollo task bulk-create -p "Apollo" --file tasks.json
JSON 文件应包含一个任务对象数组:
[
  { "title": "Set up CI pipeline", "status": "todo", "priority": "high" },
  { "title": "Write unit tests", "status": "todo" },
  { "title": "Update documentation", "status": "backlog" }
]
每个任务对象可以包含:titlestatusprioritydescriptiondue_dateestimated_hours

JSON 输出

所有命令都支持 --json 以获得结构化输出:
apollo task list --json
[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "title": "Fix authentication bug",
    "status": "in_progress",
    "priority": "high",
    "project_id": "...",
    "assigned_to": "..."
  }
]

管道示例

# Count tasks by status
apollo task list -p "Apollo" --json | jq 'group_by(.status) | map({status: .[0].status, count: length})'

# Get titles of blocked tasks
apollo task list -s blocked --json | jq '.[].title'