跳转到主要内容

概述

工作流命令将 Apollo CLI 打造成开发者优先的工作管理器。启动一个任务即可自动获得 git 分支。让紧急度评分告诉你接下来该做什么。保存常用过滤器。设置默认项目,不再到处输入 -p
所有工作流命令都支持 --json,便于脚本编写和 Claude Code 集成。

启动 / 停止 / 当前任务

apollo task start <id>

解析任务、创建 git 分支、标记为 in_progress 并跟踪你的活动会话。
# Start by name (fuzzy match)
apollo task start "fix auth bug"

# Start by short ID
apollo task start a1b2c3d4

# Custom branch name
apollo task start "fix auth" --branch "hotfix/auth-fix"

# Skip branch creation
apollo task start "review docs" --no-branch
--base
string
默认值:"main"
要从中创建的基础分支
--branch
string
覆盖自动生成的分支名称
--no-branch
boolean
默认值:"false"
跳过 git 分支创建,仅更新任务状态
执行流程:
  1. 生成分支名称:feat/<shortId>-<slugified-title>
  2. 创建并切换到分支(如果已存在则直接切换)
  3. 将任务元数据存储为 git 分支配置
  4. 在 Apollo 中将任务标记为 in_progress
  5. 如果任务未分配,自动分配给你
  6. 在本地存储活动会话,供 stopcurrent 使用

apollo task stop [id]

停止你的活动会话。暂存未提交的更改、更新状态并显示已用时间。
# Stop the current active task
apollo task stop

# Stop and mark as done
apollo task stop --done

# Stop without git stash
apollo task stop --no-stash
--done
boolean
默认值:"false"
将任务标记为 done 而非恢复为 todo
--no-stash
boolean
默认值:"false"
即使有未提交的更改也跳过 git stash

apollo task current

显示当前活动的任务及已用时间。
apollo task current
# Working on: Fix authentication bug
#   Project: Apollo
#   Branch:  feat/a1b2c3d4-fix-authentication-bug
#   Elapsed: 1h 23m
#   ID:      a1b2c3d4-...

下一个任务(智能排序)

apollo task next

按加权紧急度评分显示你的最高优先级任务。灵感来自 Taskwarrior 的紧急度系数系统。
# Show top 5 tasks (default)
apollo task next

# Show top 3 with score breakdown
apollo task next -n 3 --explain

# Scope to a project
apollo task next -p "Apollo"
-p, --project
string
限定到特定项目
-n, --count
number
默认值:"5"
显示的任务数量
--explain
boolean
默认值:"false"
显示每个任务的评分明细

评分算法

每个任务根据 6 个因素以不同权重进行评分:
因素权重原始最大值描述
Priority4x20critical=20, high=15, medium=10, low=5
Due Date3x20overdue=20, today=18, this week=12, this month=6
Unblocked2x10无阻塞 +10,被阻塞 -20
Impact2x20每解除一个任务的阻塞 +5(最多 4 个)
Age1x5基于创建天数,0-5
Status1x8in_progress=8, todo=5, blocked=0
原始分数归一化为 0-100。使用 --explain 查看确切的评分明细。

保存的过滤器

保存常用的任务过滤器组合,用单个命令即可重放。

apollo filter save <name>

# Save a filter for high-priority blocked tasks
apollo filter save "my-blockers" --status "blocked" --priority "high,critical" --assignee me

# Save a filter for a project's todo list
apollo filter save "apollo-todo" --project "Apollo" --status "todo"
-s, --status
string
状态过滤器(逗号分隔)
--priority
string
优先级过滤器(逗号分隔)
-a, --assignee
string
负责人名称或 me
-p, --project
string
项目名称
--release
string
发布名称
--unassigned
boolean
仅未分配的任务
--due-before
string
截止日期之前
--limit
string
最大结果数

apollo filter list

apollo filter list
# Name          Flags
# my-blockers   status=blocked, priority=high,critical, assignee=me
# apollo-todo   project=Apollo, status=todo

apollo filter run <name>

通过使用存储的 flags 执行 apollo task list 来重放保存的过滤器。
apollo filter run "my-blockers"
# Equivalent to: apollo task list --status blocked --priority high,critical --assignee me

apollo filter delete <name>

apollo filter delete "my-blockers"
过滤器保存在本地的 ~/.apollo/apollo-local.json 中,跨会话持久保存。

项目上下文

设置默认项目,这样就不需要在每个命令中输入 -p "项目名"

apollo context set <project>

apollo context set "Apollo"
# Default project set to: Apollo
# All commands will use this project unless -p is specified.

apollo context show

apollo context show
# Default project: Apollo

apollo context clear

apollo context clear
# Default project cleared.
遵循上下文的命令: task listrelease listepic listkb listkb searchkb folders 显式的 -p flag 始终会覆盖上下文默认值。

任务依赖

apollo task deps [id]

可视化任务的依赖树 — 谁阻塞了你,你解除了谁的阻塞。
# Show deps for a specific task
apollo task deps "fix auth bug"

# Only show upstream blockers
apollo task deps "fix auth" --direction up

# Deeper traversal
apollo task deps "fix auth" --depth 5

# Project-wide dependency chains
apollo task deps --project "Apollo"
--direction
string
默认值:"both"
up(仅阻塞者)、down(仅依赖者)或 both
--depth
number
默认值:"3"
最大遍历深度
-p, --project
string
显示项目中的所有依赖链(无需任务 ID)
单任务视图显示带有状态图标的树:
  Dependencies for: Fix auth bug
  ──────────────────────────────────────────────────

  ▲ Blocks me (upstream):

  └── ✓ Set up OAuth provider done
      └── ○ Configure redirect URLs todo

  ▼ I unblock (downstream):

  ├── ○ Update login page todo
  └── ○ Add SSO support todo
项目级视图显示线性链:
  Dependency chains in Apollo (8 tasks with deps)
  ──────────────────────────────────────────────────

  Chain 1 (3 tasks):
  ✓ Set up OAuth → ● Fix auth bug → ○ Update login page

  Chain 2 (2 tasks):
  ○ Design API schema → ○ Implement REST endpoints