双击运行启动器脚本,根据菜单选择运行模式:
scripts\start_task_scheduler.bat
启动器支持以下模式:
cd G:\code-lab\DataOps-platform-new
python scripts\auto_execute_tasks.py [选项]
可用选项:
| 选项 | 说明 |
|---|---|
--once |
只执行一次检查,不循环 |
--interval N |
设置检查间隔(秒),默认 300 |
--enable-chat |
启用自动 Cursor Chat |
--chat-input-pos "x,y" |
指定 Chat 输入框位置 |
--chat-message "消息" |
自定义 Chat 消息内容 |
示例:
# 执行一次
python scripts\auto_execute_tasks.py --once
# 每 10 分钟检查一次
python scripts\auto_execute_tasks.py --interval 600
# 启用自动 Chat
python scripts\auto_execute_tasks.py --enable-chat --chat-input-pos "1180,965"
# 完整示例
python scripts\auto_execute_tasks.py --interval 300 --enable-chat --chat-input-pos "1180,965"
┌─────────────────────────────────────────────────────────────┐
│ auto_execute_tasks.py │
└─────────────────────────────┬───────────────────────────────┘
│
┌───────────────────────┼───────────────────────┐
▼ ▼ ▼
┌─────────────┐ ┌─────────────────┐ ┌──────────────┐
│ 1. 同步完成 │ │ 2. 获取pending │ │ 3. 生成文件 │
│ 状态 │ │ 任务 │ │ │
└─────────────┘ └─────────────────┘ └──────────────┘
│ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ 4. 创建任务文件 │ │
│ │ 更新状态为 │ │
│ │ processing │ │
│ └─────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────────────────┐ │
│ │ 5. 写入 pending_tasks.json │ │
│ │ 6. 生成 instructions.md │ │
│ └──────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────────────────┐ │
│ │ 7. (可选) 发送 Cursor Chat │ │
│ └──────────────────────────────┘ │
│ │ │
└───────────────────────┼───────────────────────┘
▼
┌─────────────────┐
│ 等待下一次检查 │
└─────────────────┘
| 文件 | 说明 |
|---|---|
.cursor/pending_tasks.json |
待处理任务列表(JSON 格式) |
.cursor/task_execute_instructions.md |
Cursor 执行指令文件 |
.cursor/task_trigger.txt |
触发器标记文件 |
logs/auto_execute.log |
日志文件(后台模式) |
app/core/data_flow/*.py |
任务占位文件(可配置路径) |
编辑文件:mcp-servers/task-manager/config.json
{
"database": {
"uri": "postgresql://user:password@host:5432/database"
}
}
启用自动 Chat 需要安装以下依赖:
pip install pywin32 pyautogui pyperclip
获取 Chat 输入框位置:
--chat-input-pos "x,y" 参数指定检查:
python --versionpip show psycopg2-binarypip install psycopg2-binary检查:
mcp-servers/task-manager/config.json 配置是否正确检查:
pip install pywin32 pyautogui pyperclip解决方法:
logs\auto_execute.log查看日志:
# 查看全部日志
type logs\auto_execute.log
# 查看最后 50 行
powershell "Get-Content logs\auto_execute.log -Tail 50"
| 文件 | 说明 |
|---|---|
scripts/auto_execute_tasks.py |
核心调度脚本 |
scripts/start_task_scheduler.bat |
启动器脚本 |
mcp-servers/task-manager/config.json |
数据库配置 |
祝您使用愉快!🚀