| 方式 |
命令 |
用途 |
| 监控面板 |
python3 monitor.py |
一键查看整体状态 |
| 实时监控 |
python3 monitor.py --watch |
持续刷新监控 |
| 日志查看 |
tail -f .auto-coder/orchestrator.log |
查看详细日志 |
| 进程检查 |
pgrep -f orchestrator.py |
检查是否运行 |
| 任务管理 |
python3 task_manager.py list |
查看任务清单 |
# 检查 Orchestrator 是否在运行
pgrep -f orchestrator.py
# 输出 PID 表示运行中,无输出表示已停止
# 检查开发服务器
curl -s http://localhost:3000 > /dev/null && echo "✅ 运行中" || echo "❌ 已停止"
# 查看所有相关进程
ps aux | grep -E "(orchestrator|npm|node)" | grep -v grep
# 方式 1: 监控面板
python3 monitor.py
# 方式 2: 任务管理器
python3 task_manager.py progress
# 方式 3: 直接查看状态文件
cat .auto-coder/orchestrator_state.json
# 实时查看 Orchestrator 日志
tail -f .auto-coder/orchestrator.log
# 查看最近 100 行
tail -n 100 .auto-coder/orchestrator.log
# 搜索错误
grep -i "error\|failed\|❌" .auto-coder/orchestrator.log
# 查看特定任务日志
grep "STORY-003" .auto-coder/orchestrator.log
# 1. 检查是否意外停止
pgrep -f orchestrator.py || echo "已停止"
# 2. 查看最后日志
tail -n 50 .auto-coder/orchestrator.log
# 3. 检查错误
python3 monitor.py | grep -A 5 "错误"
# 4. 重新启动
python3 orchestrator.py --daemon 60
# 1. 查看失败任务
cat .auto-coder/orchestrator_state.json | grep failed
# 2. 查看具体错误
grep -B 5 -A 10 "failed\|❌" .auto-coder/orchestrator.log | tail -30
# 3. 手动重试(清除失败状态后重新运行)
# 编辑 .auto-coder/orchestrator_state.json,从 failed 数组中移除任务ID
python3 orchestrator.py
# 1. 检查端口占用
lsof -i :3000
# 2. 重启开发服务器
pkill -f "next dev"
npm run dev
# 3. 检查是否有编译错误
cd /Users/beihuang/Documents/github/aimarketing
npm run build 2>&1 | head -50
# 1. 检查 Aider 是否安装
which aider || echo "❌ Aider 未安装"
# 2. 检查 API Key
export NVIDIA_API_KEY="nvapi-xxx"
echo $NVIDIA_API_KEY
# 3. 测试 Aider
aider --model openai/minimaxai/minimax-m2.1 --message "test"
# 4. 检查 Aider 配置
cat ~/.aider.conf.yml
# 监控 Orchestrator 资源使用
ps aux | grep orchestrator.py | awk '{print $3, $4}' # CPU%, MEM%
# 监控开发服务器
ps aux | grep "next dev" | awk '{print $3, $4}'
# 系统整体资源
top -p $(pgrep -d',' -f orchestrator.py)
# 查看任务执行时长
grep -E "Starting|completed" .auto-coder/orchestrator.log
# 统计平均执行时间
awk '/Starting/ {start=$1" "$2} /completed/ {print $1" "$2" - "start}' .auto-coder/orchestrator.log
#!/bin/bash
# alert.sh - 系统异常时发送通知
# 检查 Orchestrator
if ! pgrep -f orchestrator.py > /dev/null; then
echo "⚠️ Orchestrator 已停止"
# 可添加: 发送邮件、Slack 通知等
fi
# 检查开发服务器
if ! curl -s http://localhost:3000 > /dev/null; then
echo "⚠️ 开发服务器无响应"
fi
# 检查错误
if grep -q "❌" .auto-coder/orchestrator.log | tail -5; then
echo "⚠️ 最近有任务失败"
fi
*/5 * * * * /Users/beihuang/Documents/github/aimarketing/alert.sh >> /Users/beihuang/Documents/github/aimarketing/.auto-coder/alerts.log 2>&1
================================================================================
🤖 全自动编码系统 - 状态监控
================================================================================
📊 系统状态
--------------------------------------------------------------------------------
时间: 2026-02-10 18:12:39
🟢 Orchestrator: 运行中
PID: 12345
🟢 开发服务器: 运行中 (http://localhost:3000)
📈 任务进度
--------------------------------------------------------------------------------
完成: 2/9 (22.2%)
|██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░|
✅ 成功: 2 ❌ 失败: 0
📝 当前任务
--------------------------------------------------------------------------------
正在执行: STORY-003
📋 最近日志 (最后 10 行)
--------------------------------------------------------------------------------
[18:10:23] Starting task: STORY-003
[18:10:25] Aider executing...
[18:11:30] Task completed successfully
💡 快速命令
--------------------------------------------------------------------------------
启动系统: python3 orchestrator.py --daemon 60
开发服务器: npm run dev
查看日志: tail -f .auto-coder/orchestrator.log
质量检查: ./quality_check.sh
停止系统: pkill -f orchestrator.py
================================================================================
# 安装 htop (如果未安装)
brew install htop
# 运行 htop 并过滤相关进程
htop -p $(pgrep -d',' -f "orchestrator|npm|node")
# 安装 glances
pip3 install glances
# 运行
glances
# 统计每天完成的任务数
grep "completed successfully" .auto-coder/orchestrator.log | awk '{print $1}' | sort | uniq -c
# 找出最慢的任务
grep -E "Starting|completed" .auto-coder/orchestrator.log | paste - - | awk '{print $1, $2}'
# 错误类型统计
grep "Error:" .auto-coder/orchestrator.log | awk -F":" '{print $2}' | sort | uniq -c | sort -rn
# 在其他终端 SSH 到服务器
ssh user@server
# 运行监控
cd /Users/beihuang/Documents/github/aimarketing
python3 monitor.py --watch 10
# 安装并启动 simple-http-server
pip3 install simple-http-server
cd /Users/beihuang/Documents/github/aimarketing/.auto-coder
python3 -m http.server 8080
# 然后访问 http://localhost:8080 查看日志文件