自主任务管理器 - 让 AI 能自主安排、执行、跟踪任务
原创技能 - 让 AI 从被动响应变为主动执行!
uv run scripts/auto-task.py create "检查未读邮件" --priority high
uv run scripts/auto-task.py create "每日备份 workspace" --schedule "0 9 * * *"
uv run scripts/auto-task.py list
uv run scripts/auto-task.py list --status pending
uv run scripts/auto-task.py list --priority high
uv run scripts/auto-task.py run <task-id>
uv run scripts/auto-task.py run --all # 执行所有待处理任务
uv run scripts/auto-task.py complete <task-id>
uv run scripts/auto-task.py cancel <task-id>
uv run scripts/auto-task.py create "整理 downloads 文件夹" --type once
# 每天早上 9 点
uv run scripts/auto-task.py create "每日自检" --schedule "0 9 * * *"
# 每周一上午 10 点
uv run scripts/auto-task.py create "周报生成" --schedule "0 10 * * 1"
# 每小时执行
uv run scripts/auto-task.py create "检查更新" --schedule "0 * * * *"
# 每 30 分钟
uv run scripts/auto-task.py create "检查新消息" --interval 30m
# 每 2 小时
uv run scripts/auto-task.py create "同步数据" --interval 2h
# 任务 B 在任务 A 完成后执行
uv run scripts/auto-task.py create "任务 A" --id task-a
uv run scripts/auto-task.py create "任务 B" --depends-on task-a
uv run scripts/auto-task.py create "备份代码" --tags backup,code,daily
uv run scripts/auto-task.py list --tags backup
uv run scripts/auto-task.py stats
uv run scripts/auto-task.py history --days 7
| 状态 | 说明 |
|---|---|
| pending | 待处理 |
| running | 执行中 |
| completed | 已完成 |
| failed | 执行失败 |
| cancelled | 已取消 |
| skipped | 已跳过 |
| 优先级 | 说明 | 执行顺序 |
|---|---|---|
| critical | 紧急重要 | 最先执行 |
| high | 高优先级 | 优先执行 |
| normal | 普通 | 默认 |
| low | 低优先级 | 最后执行 |
在 ~/.openclaw/auto-tasks/config.json 中配置:
{
"dataDir": "~/.openclaw/auto-tasks",
"autoRun": true,
"maxConcurrent": 3,
"retryFailed": true,
"retryAttempts": 3,
"notifyOnComplete": true,
"logLevel": "info"
}
{
"id": "daily-check",
"name": "每日自检",
"type": "recurring",
"schedule": "0 9 * * *",
"priority": "high",
"actions": [
{"type": "exec", "command": "git status"},
{"type": "check", "path": "~/Downloads", "action": "organize"},
{"type": "notify", "message": "每日自检完成"}
]
}
{
"id": "watch-downloads",
"name": "监控下载文件夹",
"type": "recurring",
"interval": "1h",
"priority": "normal",
"actions": [
{"type": "watch", "path": "~/Downloads"},
{"type": "organize", "rules": {"images": "Pictures", "docs": "Documents"}}
]
}
uv run scripts/auto-task.py create <name> [options]
选项:
--id <id> - 自定义任务 ID--type <type> - 任务类型(once/recurring)--schedule <cron> - Cron 表达式--interval <time> - 时间间隔(30m/1h/2d)--priority <priority> - 优先级(critical/high/normal/low)--tags <tags> - 标签(逗号分隔)--depends-on <id> - 依赖的任务 ID--notify - 完成后通知uv run scripts/auto-task.py list [options]
选项:
--status <status> - 按状态过滤--priority <priority> - 按优先级过滤--tags <tags> - 按标签过滤--format <format> - 输出格式(table/json)uv run scripts/auto-task.py run <task-id|--all>
uv run scripts/auto-task.py complete <task-id>
uv run scripts/auto-task.py cancel <task-id>
uv run scripts/auto-task.py delete <task-id>
uv run scripts/auto-task.py pause <task-id>
uv run scripts/auto-task.py resume <task-id>
uv run scripts/auto-task.py stats
uv run scripts/auto-task.py history --days <days>
uv run scripts/auto-task.py log <task-id>
~/.openclaw/auto-tasks/logs/pendinguv run scripts/auto-task.py log <task-id>欢迎提交 Issue 和 PR!
作者: 米仔
创建日期: 2026-03-21
许可证: MIT