开放任务
AI代理的存储层。\ 一个轻量级的、持久的任务管理系统,位于您的存储库中。
🚧 当前状态:OpenTask CLI完全支持且稳定。模型上下文协议(MCP)服务器集成目前正在进行中 积极发展 并且尚未完全调试。请暂时使用CLI进行任务管理。
______________________________________________________________________
📦 安装和设置
1.从源代码安装
由于此软件包目前正在开发中:
# Clone the repository
git clone https://github.com/yourusername/opentask.git
cd opentask
# Install dependencies and build
npm install
npm run build
# Link globally (makes 'opentask' command available)
npm link2.汽车集成
在目标项目根目录中运行此命令以自动配置AI工具:
# Ensure .cursor directory exists if you use Cursor (optional but recommended)
mkdir -p .cursor
# Run installer
opentask install这个魔法命令将:
- OpenCode:注入配置为使用CLI的“No Ticket No Code”系统提示。
- 光标:创建
.cursor/rules/opentask.mdc强制AI使用任务系统。
______________________________________________________________________
✨ 为什么选择OpenTask?
人工智能编码助理(Cursor、Claude、Aider)经常患有“健忘症”。他们忘记了在课间做什么。
开放任务 将您的工作流程从短暂的“聊天消息”升级为持久的 “项目记忆”.
- 状态任务管理:轨道
pending,in_progress,blocked,以及completed跨会议状态。 - Repo原住民:任务存储在
.opentask/tasks/作为JSON文件。它们由您的代码进行版本控制。 - 代理就绪(MCP): *\[开发中\]* 包括a 模型上下文协议(MCP) 服务器,允许AI代理自主读取、创建和更新任务。
______________________________________________________________________
🚀 工作流程
1.经理(人)
使用OpenTask为您的AI代理计划工作。
# Initialize project
npx opentask init
# Create tasks for your agent
npx opentask create "Implement Auth" "Login and Signup forms" --priority high
npx opentask create "Setup DB" "Initialize Prisma schema"
# View the board
npx opentask list2.工人(AI代理) _(即将推出)_
当您将OpenTask作为MCP服务器连接到您的AI时(例如,在Claude Desktop或Cursor中),AI可以:
- 阅读计划:
list_tasks(status='pending') - 选择任务:
update_task(id='...', status='in_progress', assignee='claude') - 标记完成:
update_task(id='...', status='completed')
这意味着你可以关闭你的编辑器,明天回来,人工智能就知道它在哪里停了下来。
______________________________________________________________________
🛠 CLI使用情况
任务
# Simple task
npx opentask create "Fix Bug" "Fix login error"
# Rich task with details and criteria
npx opentask create "Refactor API" "Migrate to tRPC" \
--details "This involves updating the backend router and frontend client." \
--criteria "All tests pass" "Type safety ensured"
# Specify explicit project root (useful for monorepos)
npx opentask create "Sub-package Task" "..." --root ./packages/ui列出任务
# List all
npx opentask list
# Filter by status
npx opentask list --status pending
# Show dependency tree
npx opentask list --tree更新任务
# Start working
npx opentask update --status in_progress
# Complete
npx opentask update --status completed
# Add dependency
npx opentask update --add-dep 显示详情
# View full task details including description and criteria
npx opentask show 归档
# Archive completed tasks to keep the active list clean
# (Moves tasks to .opentask/archive/)
npx opentask archive
# Archive tasks older than 7 days
npx opentask archive --days 7
# Restore a task from archive
npx opentask unarchive ______________________________________________________________________
📂 项目结构
OpenTask创建了一个轻量级 .opentask 在项目根目录中注册。
my-project/
├── .opentask/
│ └── tasks/
│ ├── 8a2f9c.json # Metadata: "Implement Auth"
│ └── b4d1e2.json # Metadata: "Setup DB"
└── package.json📝 任务定义架构
任务只是一个包含元数据和上下文的JSON文件。
interface TaskDefinition {
metadata: {
id: string;
status: 'pending' | 'in_progress' | 'blocked' | 'completed';
priority: 'low' | 'medium' | 'high';
dependencies: string[];
assignee?: string;
};
name: string;
description: string;
// Context for the AI
details?: string;
acceptance_criteria?: string[];
// Context for the AI
context?: {
files?: string[]; // Related files
notes?: string; // Extra context
};
}📄 许可证
阿帕奇-2.0
