Loading...
Loading...
Compare original and translation side by side
user: "every day at 9am summarize my memory MCP entries"
└→ You execute: /task-trigger:add
└→ You write crontab entry (Linux) or .plist (macOS)
└→ At scheduled time: CLI runs headless (opencode run or kiro chat)
└→ Output goes to log file
└→ User reads log when ready用户:“每天上午9点总结我的MCP记忆条目”
└→ 您执行:/task-trigger:add
└→ 您写入crontab条目(Linux)或.plist文件(macOS)
└→ 到预定时间:CLI以无头模式运行(opencode run或kiro chat)
└→ 输出内容写入日志文件
└→ 用户在需要时查看日志| Command | Description |
|---|---|
| Register a new task interactively (ALWAYS ask confirmation) |
| Start monitoring a file/directory for changes |
| Show all registered tasks |
| List active file watchers |
| Remove a task + clean scheduler |
| Stop monitoring a file/directory |
| View execution history |
| Execute task immediately |
| Check scheduler health + time remaining |
| 命令 | 描述 |
|---|---|
| 交互式注册新任务(必须先确认) |
| 开始监控文件/目录的变化 |
| 显示所有已注册任务 |
| 列出活跃的文件监控器 |
| 删除任务并清理调度器配置 |
| 停止监控文件/目录 |
| 查看任务执行历史 |
| 立即执行任务 |
| 检查调度器健康状态和任务剩余执行时间 |
| Script | Purpose | Usage |
|---|---|---|
| Detect OS platform | |
| Detect available CLI | |
| Add task to crontab | |
| Add task to launchd | |
| Detect file monitoring tools | |
| Start file/directory watcher | |
| Stop file watcher | |
| List registered tasks | |
| List active file watchers | |
| Remove task completely | |
| View task logs | |
| Execute task now | |
chmod +x scripts/*.sh| 脚本 | 用途 | 使用方式 |
|---|---|---|
| 检测操作系统平台 | |
| 检测可用的CLI | |
| 将任务添加到crontab | |
| 将任务添加到launchd | |
| 检测文件监控工具 | |
| 启动文件/目录监控器 | |
| 停止文件监控器 | |
| 列出已注册任务 | |
| 列出活跃的文件监控器 | |
| 完全删除任务 | |
| 查看任务日志 | |
| 立即执行任务 | |
chmod +x scripts/*.sh0 9 * * *0 * * * **/1 * * * *duration_minutes: 3030 8 * * 10 10 * * **/1 * * * *duration_minutes: 600 9 * * *0 * * * **/1 * * * *duration_minutes: 3030 8 * * 10 10 * * **/1 * * * *duration_minutes: 60detect-cli.sh/usr/local/bin/opencode/Users/you/.local/bin/kiro-cliCLI_PATH=$(./scripts/detect-cli.sh)
echo "Detected CLI: $CLI_PATH"detect-cli.sh/usr/local/bin/opencode/Users/you/.local/bin/kiro-cliCLI_PATH=$(./scripts/detect-cli.sh)
echo "检测到的CLI:$CLI_PATH"undefinedundefinedundefinedundefinedundefinedundefinedUser: "every day at 9am summarize my memory MCP entries using deepseek"
→ You extract:
- Trigger: "every day at 9am" → cron: `0 9 * * *`
- Prompt: "summarize my memory MCP entries"
- Model: "deepseek" (if mentioned, else null)
- CLI: detect with full path用户:“每天上午9点用deepseek总结我的MCP记忆条目”
→ 您提取以下信息:
- 触发条件:“every day at 9am” → cron表达式:`0 9 * * *`
- 提示词:“summarize my memory MCP entries”
- 模型:“deepseek”(如果用户提及,否则为null)
- CLI:通过脚本检测完整路径daily-memory-summarylog-analysis-30mindaily-memory-summarylog-analysis-30min$HOME/.task-trigger/tasks.json[{task1}, {task2}, ...]$HOME/.task-trigger/tasks.json[{task1}, {task2}, ...]{
"id": "daily-memory-summary",
"name": "Daily Memory Summary",
"enabled": true,
"trigger": {
"type": "cron",
"expression": "0 9 * * *",
"timezone": "local",
"duration_minutes": null,
"expires_at": null
},
"execution": {
"cli_path": "/usr/local/bin/opencode",
"agent": "opencode",
"model": "deepseek/deepseek-chat",
"prompt": "Check MCP memory for new entries since yesterday and summarize them. Write output to $HOME/.task-trigger/logs/daily-memory-summary.log",
"workingDirectory": "$HOME",
"timeout": 300
},
"created_at": "2026-03-18T10:00:00Z",
"log_path": "$HOME/.task-trigger/logs/daily-memory-summary.log"
}{
"id": "daily-memory-summary",
"name": "每日记忆总结",
"enabled": true,
"trigger": {
"type": "cron",
"expression": "0 9 * * *",
"timezone": "local",
"duration_minutes": null,
"expires_at": null
},
"execution": {
"cli_path": "/usr/local/bin/opencode",
"agent": "opencode",
"model": "deepseek/deepseek-chat",
"prompt": "检查MCP记忆中自昨天以来的新条目并进行总结。将输出写入$HOME/.task-trigger/logs/daily-memory-summary.log",
"workingDirectory": "$HOME",
"timeout": 300
},
"created_at": "2026-03-18T10:00:00Z",
"log_path": "$HOME/.task-trigger/logs/daily-memory-summary.log"
}{
"id": "log-file-watcher",
"name": "Log File Watcher",
"enabled": true,
"trigger": {
"type": "file",
"path": "/var/log/myapp.log",
"watch_events": ["create", "modify"],
"recursive": false,
"poll_interval": 5,
"debounce": 1
},
"execution": {
"agent": "opencode",
"model": "deepseek/deepseek-chat",
"prompt": "New log entry detected. Analyze the latest lines and notify if errors found. Write output to $HOME/.task-trigger/logs/log-analyzer.log",
"workingDirectory": "$HOME",
"timeout": 60
},
"created_at": "2026-03-18T10:00:00Z",
"log_path": "$HOME/.task-trigger/logs/log-analyzer.log"
}{
"id": "log-file-watcher",
"name": "日志文件监控器",
"enabled": true,
"trigger": {
"type": "file",
"path": "/var/log/myapp.log",
"watch_events": ["create", "modify"],
"recursive": false,
"poll_interval": 5,
"debounce": 1
},
"execution": {
"agent": "opencode",
"model": "deepseek/deepseek-chat",
"prompt": "检测到新的日志条目。分析最新的日志行,若发现错误则发出通知。将结果写入$HOME/.task-trigger/logs/log-analyzer.log",
"workingDirectory": "$HOME",
"timeout": 60
},
"created_at": "2026-03-18T10:00:00Z",
"log_path": "$HOME/.task-trigger/logs/log-analyzer.log"
}CLI_PATH=$(./scripts/detect-cli.sh)CLI_PATH=$(./scripts/detect-cli.sh)undefinedundefinedCLI_PATH=$(./scripts/detect-cli.sh)
if [[ "$CLI_PATH" == *opencode* ]]; then
COMMAND="$CLI_PATH run --prompt 'your prompt here'"
else
COMMAND="$CLI_PATH chat --no-interactive --trust-all-tools 'your prompt here'"
fi
./scripts/add-to-launchd.sh \
--task-id "daily-memory-summary" \
--hour 9 \
--minute 0 \
--command "$COMMAND"CLI_PATH=$(./scripts/detect-cli.sh)
if [[ "$CLI_PATH" == *opencode* ]]; then
COMMAND="$CLI_PATH run --prompt '你的提示词内容'"
else
COMMAND="$CLI_PATH chat --no-interactive --trust-all-tools '你的提示词内容'"
fi
./scripts/add-to-launchd.sh \
--task-id "daily-memory-summary" \
--hour 9 \
--minute 0 \
--command "$COMMAND"mkdir -p $HOME/.task-trigger/logs
mkdir -p $HOME/.task-trigger/launchd # macOS only
mkdir -p $HOME/.task-trigger/watchers # For file watchersmkdir -p $HOME/.task-trigger/logs
mkdir -p $HOME/.task-trigger/launchd # 仅适用于macOS
mkdir -p $HOME/.task-trigger/watchers # 用于文件监控任务daily-memory-summary0 9 * * */usr/local/bin/opencodedeepseek/deepseek-chat$HOME/.task-trigger/logs/daily-memory-summary.logdaily-memory-summary0 9 * * */usr/local/bin/opencodedeepseek/deepseek-chat$HOME/.task-trigger/logs/daily-memory-summary.logUser: "watch my log file at /var/log/app.log and analyze new entries"
→ You extract:
- Path: "/var/log/app.log"
- Events: ["modify"] (default for files)
- Prompt: "analyze new log entries"
- CLI: detect opencode/kiro用户:“监控我的日志文件/var/log/app.log并分析新条目”
→ 您提取以下信息:
- 路径:"/var/log/app.log"
- 事件:["modify"](文件监控的默认事件)
- 提示词:“analyze new log entries”
- CLI:检测opencode/kiro的完整路径log-file-watcherconfig-monitorlog-file-watcherconfig-monitorCLI_PATH=$(./scripts/detect-cli.sh)
if [[ "$CLI_PATH" == *opencode* ]]; then
COMMAND="$CLI_PATH run --prompt 'New log entry detected. Analyze the latest lines and notify if errors found.'"
else
COMMAND="$CLI_PATH chat --no-interactive --trust-all-tools 'New log entry detected. Analyze the latest lines and notify if errors found.'"
fi
./scripts/start-watcher.sh \
--task-id "log-file-watcher" \
--path "/var/log/app.log" \
--events "modify" \
--command "$COMMAND" \
--debounce 1CLI_PATH=$(./scripts/detect-cli.sh)
if [[ "$CLI_PATH" == *opencode* ]]; then
COMMAND="$CLI_PATH run --prompt '检测到新的日志条目。分析最新的日志行,若发现错误则发出通知。'"
else
COMMAND="$CLI_PATH chat --no-interactive --trust-all-tools '检测到新的日志条目。分析最新的日志行,若发现错误则发出通知。'"
fi
./scripts/start-watcher.sh \
--task-id "log-file-watcher" \
--path "/var/log/app.log" \
--events "modify" \
--command "$COMMAND" \
--debounce 1log-file-watcher/var/log/app.logmodifyinotifywaitopencodekirolog-file-watcher/var/log/app.logmodifyinotifywaitopencodekiroUser: "check logs every minute during the next 30 minutes"
→ cron: `*/1 * * * *`
→ duration_minutes: 30
→ expires_at: current_time + 30 minutesexpires_atduration_minutesexpires_atrun-task.shexpires_at/task-trigger:status用户:“接下来30分钟内每分钟检查一次邮件”
→ cron表达式:`*/1 * * * *`
→ duration_minutes: 30
→ expires_at: 当前时间 + 30分钟expires_atduration_minutesexpires_atrun-task.shexpires_at/task-trigger:statusUser: "using opencode/zen" or "con claude-3.5-sonnet"
→ Add to command: --model "opencode/zen"
→ If not specified: omit --model flag (uses last model)用户:“使用opencode/zen”或“con claude-3.5-sonnet”
→ 在命令中添加:--model "opencode/zen"
→ 如果用户未指定:省略--model参数(使用上次使用的模型){{TIMESTAMP}}{{FILE_PATH}}{{TASK_ID}}{{LOG_PATH}}"prompt": "Analyze {{FILE_PATH}} for errors since {{TIMESTAMP}}. Write results to {{LOG_PATH}}"run-task.sh{{TIMESTAMP}}{{FILE_PATH}}{{TASK_ID}}{{LOG_PATH}}"prompt": "分析{{FILE_PATH}}中自{{TIMESTAMP}}以来的错误信息。将结果写入{{LOG_PATH}}"run-task.sh$HOME~$HOME~createmodifydeletemovemodifycreatedeletemovemodifycreate,modify,deletecreatemodifydeletemovemodifycreatedeletemovemodifycreate,modify,delete/task-trigger:list/task-trigger:list./scripts/list-tasks.py./scripts/list-tasks.py/task-trigger:watchers/task-trigger:watchers./scripts/list-watchers.py./scripts/list-watchers.py/task-trigger:remove <id>/task-trigger:remove <id>./scripts/remove-task.sh <task-id>./scripts/remove-task.sh <task-id>/task-trigger:unwatch <id>/task-trigger:unwatch <id>./scripts/stop-watcher.sh <task-id>./scripts/stop-watcher.sh <task-id>/task-trigger:logs [id]/task-trigger:logs [id]undefinedundefinedundefinedundefined/task-trigger:run <id>/task-trigger:run <id>./scripts/run-task.sh <task-id>./scripts/run-task.sh <task-id>/task-trigger:status/task-trigger:statusexpires_atexpires_atopencode run --prompt "message"-m "provider/model"opencode run --prompt "Check memory" -m "deepseek/deepseek-chat"opencode run --prompt "消息内容"-m "provider/model"opencode run --prompt "检查记忆内容" -m "deepseek/deepseek-chat"kiro-clikirokiro-cli chat --no-interactive "message"--trust-all-tools--model "provider/model"kiro-cli chat --no-interactive --trust-all-tools "Check memory" --model "anthropic/claude-sonnet-4"--trust-all-toolskiro-clikirokiro-cli chat --no-interactive "消息内容"--trust-all-tools--model "provider/model"kiro-cli chat --no-interactive --trust-all-tools "检查记忆内容" --model "anthropic/claude-sonnet-4"--trust-all-tools$HOME/.task-trigger/logs/launchd/watchers/--helpdetect-cli.shchmod +x$HOME/.task-trigger/logs/launchd/watchers/--helpdetect-cli.sh--trust-all-tools--dry-runchmod +x--dangerously-skip-permissions--dangerously-skip-permissionssudosudoevery day at 9am summarize memorycada hora analiza logs usando deepseekevery minute during the next 30 minutes check emailscada minuto durante la próxima hora revisa sistemaMonday and Wednesday at 8:30am backup fileswatch my log file at /var/log/app.log and alert on errorsmonitor the downloads folder for new PDF filesif config.json changes, restart the servicewhen new files appear in /data/uploads, process themtrack changes to source code and run testsevery day at 9am summarize memorycada hora analiza logs usando deepseekevery minute during the next 30 minutes check emailscada minuto durante la próxima hora revisa sistemaMonday and Wednesday at 8:30am backup fileswatch my log file at /var/log/app.log and alert on errorsmonitor the downloads folder for new PDF filesif config.json changes, restart the servicewhen new files appear in /data/uploads, process themtrack changes to source code and run tests