task-list

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

task-list

task-list

Category: Task Management
类别:任务管理

Usage

使用方法

bash
task-list [--dir <directory>] [--status <status>] [--format <format>]
bash
task-list [--dir <directory>] [--status <status>] [--format <format>]

Arguments

参数

  • --dir
    : Optional - Specific directory (focus, active, paused, completed, all). Default: all
  • --status
    : Optional - Filter by status (pending, in_progress, completed, blocked)
  • --format
    : Optional - Output format (table, list, json). Default: table
  • --dir
    :可选 - 指定目录(focus、active、paused、completed、all)。默认值:all
  • --status
    :可选 - 按状态筛选(pending、in_progress、completed、blocked)
  • --format
    :可选 - 输出格式(table、list、json)。默认值:table

Execution Instructions for Claude Code

Claude Code执行说明

When this command is run, Claude Code should:
  1. Scan specified directories for task files (*.md)
  2. Parse each task file header to extract:
    • Task ID and title
    • Status and priority
    • Progress percentage
    • Estimated/actual hours
    • Blocked status
    • Dependencies
  3. Apply any filters (status, etc.)
  4. Calculate aggregate statistics
  5. Display in requested format
运行此命令时,Claude Code应执行以下操作:
  1. 扫描指定目录中的任务文件(*.md)
  2. 解析每个任务文件的头部,提取以下信息:
    • 任务ID和标题
    • 状态和优先级
    • 进度百分比
    • 预估/实际耗时
    • 阻塞状态
    • 依赖关系
  3. 应用筛选条件(如状态等)
  4. 计算汇总统计数据
  5. 以请求的格式展示结果

Directory Scanning Order

目录扫描顺序

  1. focus/ - Show first (current work)
  2. active/ - Ready tasks
  3. paused/ - Context switched
  4. completed/ - Recently done
  5. archive/ - If requested
  1. focus/ - 优先展示(当前工作任务)
  2. active/ - 待执行任务
  3. paused/ - 已切换上下文的任务
  4. completed/ - 近期完成任务
  5. archive/ - 仅在被请求时展示

Output Formats

输出格式

Table Format (default)

表格格式(默认)

📋 Task List Overview

FOCUS (1 task)
ID        | Title                      | Progress | Est/Act | Priority | Status
----------|----------------------------|----------|---------|----------|------------
TASK-001  | User Authentication       | 50%      | 8h/4h   | 🔴 High  | In Progress

ACTIVE (3 tasks)
ID        | Title                      | Progress | Est/Act | Priority | Status
----------|----------------------------|----------|---------|----------|------------
TASK-002  | API Documentation         | 0%       | 4h/0h   | 🟡 Med   | Pending
TASK-003  | Search Implementation     | 20%      | 12h/2h  | 🔴 High  | In Progress
TASK-004  | Performance Optimization  | 0%       | 6h/0h   | 🟢 Low   | Blocked ⚠️

PAUSED (1 task)
ID        | Title                      | Progress | Est/Act | Priority | Reason
----------|----------------------------|----------|---------|----------|------------
TASK-005  | Data Migration           | 30%      | 10h/3h  | 🟡 Med   | Waiting for DB

Summary: 5 tasks | 2 in progress | 1 blocked | Total: 40h estimated, 9h actual
📋 Task List Overview

FOCUS (1 task)
ID        | Title                      | Progress | Est/Act | Priority | Status
----------|----------------------------|----------|---------|----------|------------
TASK-001  | User Authentication       | 50%      | 8h/4h   | 🔴 High  | In Progress

ACTIVE (3 tasks)
ID        | Title                      | Progress | Est/Act | Priority | Status
----------|----------------------------|----------|---------|----------|------------
TASK-002  | API Documentation         | 0%       | 4h/0h   | 🟡 Med   | Pending
TASK-003  | Search Implementation     | 20%      | 12h/2h  | 🔴 High  | In Progress
TASK-004  | Performance Optimization  | 0%       | 6h/0h   | 🟢 Low   | Blocked ⚠️

PAUSED (1 task)
ID        | Title                      | Progress | Est/Act | Priority | Reason
----------|----------------------------|----------|---------|----------|------------
TASK-005  | Data Migration           | 30%      | 10h/3h  | 🟡 Med   | Waiting for DB

Summary: 5 tasks | 2 in progress | 1 blocked | Total: 40h estimated, 9h actual

List Format

列表格式

📋 Task List

🎯 FOCUS
└── TASK-001: User Authentication
    Progress: 50% | 8h estimated, 4h actual | High priority
    Status: In Progress | Next: 2.3 Implement JWT tokens

📂 ACTIVE (3)
├── TASK-002: API Documentation
│   Progress: 0% | 4h estimated | Medium priority
│   Status: Pending | Dependencies: TASK-001
├── TASK-003: Search Implementation
│   Progress: 20% | 12h estimated, 2h actual | High priority
│   Status: In Progress
└── TASK-004: Performance Optimization
    Progress: 0% | 6h estimated | Low priority
    Status: Blocked ⚠️ | Reason: Waiting for profiling tools
📋 Task List

🎯 FOCUS
└── TASK-001: User Authentication
    Progress: 50% | 8h estimated, 4h actual | High priority
    Status: In Progress | Next: 2.3 Implement JWT tokens

📂 ACTIVE (3)
├── TASK-002: API Documentation
│   Progress: 0% | 4h estimated | Medium priority
│   Status: Pending | Dependencies: TASK-001
├── TASK-003: Search Implementation
│   Progress: 20% | 12h estimated, 2h actual | High priority
│   Status: In Progress
└── TASK-004: Performance Optimization
    Progress: 0% | 6h estimated | Low priority
    Status: Blocked ⚠️ | Reason: Waiting for profiling tools

JSON Format

JSON格式

json
{
  "summary": {
    "total_tasks": 5,
    "in_progress": 2,
    "blocked": 1,
    "total_estimated_hours": 40,
    "total_actual_hours": 9
  },
  "tasks": {
    "focus": [...],
    "active": [...],
    "paused": [...],
    "completed": [...]
  }
}
json
{
  "summary": {
    "total_tasks": 5,
    "in_progress": 2,
    "blocked": 1,
    "total_estimated_hours": 40,
    "total_actual_hours": 9
  },
  "tasks": {
    "focus": [...],
    "active": [...],
    "paused": [...],
    "completed": [...]
  }
}

Progress Indicators

进度指示器

  • ████████░░
    - Visual progress bar
  • Percentage with color coding:
    • 0-25%: 🔴 Red
    • 26-75%: 🟡 Yellow
    • 76-100%: 🟢 Green
  • ████████░░
    - 可视化进度条
  • 带颜色编码的百分比:
    • 0-25%: 🔴 红色
    • 26-75%: 🟡 黄色
    • 76-100%: 🟢 绿色

Error Handling

错误处理

  • If no tasks found: Show helpful message about creating tasks
  • If task file corrupted: Mark with ❌ and continue
  • If no task directories: Suggest running
    task-system-init
  • 若未找到任务:显示创建任务的提示信息
  • 若任务文件损坏:标记为 ❌ 并继续执行
  • 若无任务目录:建议运行
    task-system-init

Example

示例

bash
undefined
bash
undefined

List all tasks

列出所有任务

task-list
task-list

Show only focused task

仅显示焦点任务

task-list --dir focus
task-list --dir focus

Show all in-progress tasks

显示所有进行中的任务

task-list --status in_progress
task-list --status in_progress

Get JSON for automation

获取JSON格式用于自动化

task-list --format json > tasks.json
task-list --format json > tasks.json

Show only active directory in list format

以列表格式仅显示active目录的任务

task-list --dir active --format list
undefined
task-list --dir active --format list
undefined

Implementation Tips for Claude Code

Claude Code实现建议

  1. Efficient Parsing: Cache parsed headers for performance
  2. Smart Sorting: Focus first, then by priority and progress
  3. Dependency Tracking: Show dependency chains if relevant
  4. Time Calculations: Sum estimates and actuals by directory
  5. Visual Appeal: Use Unicode characters for better formatting
  1. 高效解析:缓存已解析的头部以提升性能
  2. 智能排序:先展示焦点任务,再按优先级和进度排序
  3. 依赖跟踪:若相关则展示依赖链
  4. 时间计算:按目录汇总预估和实际耗时
  5. 视觉效果:使用Unicode字符优化格式