使用 Agent Pulse 檢查本機 AI 代理活動,涵蓋 Hermes、Claude Code、Codex、DeepSeek、OpenClaw、Copilot、Aider、Qwen、OpenCode、Goose、Cursor、Antigravity 和 Amp 日誌。當使用者詢問 AI 代理工作階段、Token、工具/搜尋呼叫、模型使用量、預估成本、預算、預測、健康檢查、報告、設定診斷、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 輸出。摘要重要的欄位:工作階段數、Token、工具、搜尋呼叫、模型分佈、來源分佈、預估成本、警告。
- 針對特定範圍的問題使用時間篩選。預設「近期」為 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 本機模型定價表的預估值。 - 同時回報成本和 Token 數量;低成本模型仍可能使用極大量 Token。
- 區分來源,例如
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






