使用 Agent Pulse 检查本地 AI 代理活动,涵盖 Hermes、Claude Code、Codex、DeepSeek、OpenClaw、Copilot、Aider、Qwen、OpenCode、Goose、Cursor、Antigravity 和 Amp 日志。当用户询问 AI 代理会话、令牌、工具/搜索调用、模型使用、预估成本、预算、预测、健康检查、报告、设置诊断、Web/API/指标导出或 MCP 集成时使用。
Agent Pulse
目的
使用已安装的 agent-pulse CLI 作为本地 AI 代理活动的真实来源。PyPI 包名为 agentpulse-cli,命令仍为 agent-pulse。优先运行命令并总结其输出,而不是阅读 Agent Pulse 源代码。
在 Windows 上运行命令前始终启用 UTF-8,因为 Agent Pulse 输出包含表情符号和方框绘制字符:
$env:PYTHONUTF8='1'
$env:PYTHONIOENCODING='utf-8'
如果 agent-pulse 不在 PATH 中,请先询问是否安装依赖项。如果用户同意,安装 PyPI 包或尝试从本地项目检出运行:
pip install agentpulse-cli
python -m agent_pulse.cli --version
来源键
当用户询问某个代理工具而非所有本地数据时,使用 -P/--platform:
hermes, claude, codex, deepseek, openclaw, copilot, aider, qwen,
opencode, goose, cursor, antigravity, amp
选择命令
首先使用此命令选择表:
| 用户需求 | 运行命令 |
|---|---|
| 当前状态 | agent-pulse status --json |
| 完整仪表盘 | agent-pulse --json 或 agent-pulse --no-banner |
| 演示数据 | agent-pulse demo --json |
| 设置诊断 | agent-pulse doctor --json |
| 最近会话 | agent-pulse --json --hours 24 --limit 20 |
| 最多会话 | agent-pulse top --sort tokens --json |
| 最贵会话 | agent-pulse top --sort cost --json --hours 168 |
| 模型成本分析 | agent-pulse models --json |
| 模型排名 | agent-pulse leaderboard --json --rank-by efficiency |
| 成本节省 | agent-pulse optimize --json |
| 预算状态 | agent-pulse budget --json |
| 成本预测 | agent-pulse forecast --json |
| 成本异常检查 | agent-pulse anomaly --json |
| 健康/CI 检查 | agent-pulse health --json |
| 综合评分 | agent-pulse score --json |
| 搜索会话 | agent-pulse search "<query>" --json |
| 比较时间段 | agent-pulse compare --json |
| 比较项目 | agent-pulse compare-projects --json |
| 活动日历 | agent-pulse heatmap --json |
| 智能推荐 | agent-pulse insights --json |
| Prometheus 指标 | agent-pulse metrics --format prometheus |
| 导出报告 | agent-pulse export -f markdown 或 agent-pulse export-html |
| Web 仪表盘 | agent-pulse web --port 8765 |
| REST API | agent-pulse api --port 8766 |
| MCP 工具 | agent-pulse mcp --list-tools |
如果安装的命令缺少某个选项,运行 agent-pulse <command> --help 并调整。
工作流程
- 仅当用户询问为什么数据缺失、寻求设置帮助或常规数据命令未返回会话时,才以
agent-pulse doctor --json开始。 - 尽可能使用 JSON 输出。总结重要字段:会话数、令牌数、工具调用、搜索调用、模型分解、来源分解、预估成本、警告。
- 对于限定范围的问题使用时间过滤器。默认“最近”为 24 小时,“本周”为 168 小时:
agent-pulse status --json --hours 24
agent-pulse --json --hours 168 --limit 50
- 当用户询问特定代理系统时使用平台过滤器:
agent-pulse --json -P codex --hours 24
agent-pulse --json -P claude --hours 24
agent-pulse top --json -P aider --sort cost
agent-pulse status --json -P cursor
- 对于成本问题,结合摘要、模型和顶级会话视图:
agent-pulse status --json --hours 24
agent-pulse models --json --hours 24
agent-pulse top --sort cost --json --hours 24
agent-pulse optimize --json --hours 168
- 对于趋势和风险问题,使用预测/历史/比较/异常:
agent-pulse forecast --json
agent-pulse history --json
agent-pulse compare --json
agent-pulse anomaly --json
- 对于设置,先使用发现命令再猜测路径:
agent-pulse doctor --json
agent-pulse scan --json --details
agent-pulse config show
解释结果
- 将
total_cost_usd视为基于 Agent Pulse 本地模型定价表的估算值。 - 同时报告成本和令牌量;低成本模型仍可能有非常高的令牌使用量。
- 区分来源,如
codex、claude、hermes、deepseek、openclaw、aider、cursor、opencode和goose。 - 如果
doctor报告缺少可选来源、缺少dev_root或可选的 Web 依赖项,请提及。 - 如果没有出现会话,检查
doctor,然后尝试更宽的时间窗口,如--hours 168。 - 在给出总体总数之前,检查用户是否要求了来源(
-P)过滤器、模型过滤器或项目比较。 - 如果命令输出纯文本而不是 JSON,或者由于安装版本较旧而失败,运行
agent-pulse <command> --help并使用最接近的受支持选项。
报告
对于简短的人类可读答案,运行 JSON 命令并总结。
对于工件,优先使用:
agent-pulse report --period daily
agent-pulse export -f markdown
agent-pulse export-html
不要虚构确切的节省或成本。使用 CLI 输出。
集成
仅当用户要求浏览器仪表盘或程序化服务器时,才使用 Web 和 API 扩展。在安装缺少的扩展前询问:
pip install "agentpulse-cli[web]"
agent-pulse web --port 8765
agent-pulse api --port 8766
对于监控管道:
agent-pulse metrics --format prometheus
agent-pulse health --cost-limit 100 --token-limit 1000000 --json
MCP
当用户希望其他 AI 客户端查询 Agent Pulse 时,使用 MCP 模式:
agent-pulse mcp --list-tools
agent-pulse mcp
在解释 MCP 时,提及它暴露了诸如状态、预测、顶级会话、模型分析、优化、健康、搜索和排行榜等工具。
本地辅助脚本
此技能包含 scripts/run_agent_pulse_snapshot.py,它运行一组紧凑的 JSON 友好型 Agent Pulse 检查并打印组合摘要:
python scripts/run_agent_pulse_snapshot.py --hours 24 --days 7




