返回顶部
c

codemendAI错误监控

AI-powered error monitoring — report errors, get AI fixes, and list recent errors

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.1.0
安全检测
已通过
77
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

codemend

Codemend AI 技能

Codemend 捕获生产环境中的 JavaScript/TypeScript 错误,通过 AI 进行分析,并生成修复方案——既可以作为 GitHub PR 提交,也可以生成粘贴提示,供 Lovable、Replit 和 Cursor 等 AI 编码工具使用。

工具

report_error

向 Codemend 报告一个生产环境错误。AI 将在数秒内分析该错误。

bash
curl -X POST https://codemend.ai/api/errors/ingest \
-H Content-Type: application/json \
-d {
key: $CODEMENDAPIKEY,
message: TypeError: Cannot read properties of undefined (reading \map\),
stack: TypeError: Cannot read properties of undefined\n at renderList (src/components/List.tsx:15:23),
source_url: https://myapp.com/dashboard,
source_type: openclaw
}

响应:
json
{ status: queued, error_id: uuid-here }

get_fix

获取针对已报告错误的 AI 生成修复方案。包含解释、根本原因、置信度分数以及可粘贴到 AI 编码工具中的修复提示。

bash
curl -s https://codemend.ai/api/errors/{ERROR_ID}/fix \
-H x-api-key: $CODEMENDAPIKEY

响应:
json
{
error: {
id: uuid,
status: analyzed,
message: TypeError: Cannot read properties of undefined,
stack_trace: ...,
source_url: https://myapp.com/dashboard
},
fix: {
id: uuid,
explanation: map() 调用失败,因为首次渲染时 data 为 undefined,
root_cause: 数组操作前缺少空值检查,
confidence: 0.92,
fix_prompt: 在 src/components/List.tsx 中,如果 data 为 undefined,则添加提前返回...,
pr_url: https://github.com/user/repo/pull/42
},
dashboard_url: https://codemend.ai/errors/uuid
}

如果错误仍在分析中,fix 字段将为 null。请先使用 check_status 轮询。

check_status

检查错误是否已被分析。

bash
curl -s https://codemend.ai/api/errors/{ERROR_ID}/status \
-H x-api-key: $CODEMENDAPIKEY

响应:
json
{
status: analyzed,
message: TypeError: Cannot read properties of undefined,
has_fix: true,
fix_id: uuid-here,
dashboard_url: https://codemend.ai/dashboard/errors/uuid
}

状态:new → analyzing → analyzed / fix_applied / ignored

list_errors

列出该项目最近的错误。

bash
curl -s https://codemend.ai/api/errors?limit=10&status=analyzed \
-H x-api-key: $CODEMENDAPIKEY

响应:
json
{
errors: [
{
id: uuid,
status: analyzed,
message: TypeError: Cannot read properties of undefined,
source_type: openclaw,
has_fix: true,
fix_id: uuid,
created_at: 2026-03-11T12:00:00Z
}
],
total: 42
}

在项目中的设置

浏览器端(React、Next.js、Vue 等)

添加到 HTML 的 中:

html

或者,如果使用 AI 编码工具(Lovable、Replit、Bolt 等),粘贴以下提示:

将以下错误监控脚本添加到我的应用中。将其放在 index.html 的 部分:

Node.js / 后端

bash
npm install codemend

javascript
const codemend = require(codemend);
codemend.init({ apiKey: process.env.CODEMENDAPIKEY });
codemend.setupProcessHandlers();

Express

javascript
const codemend = require(codemend);
codemend.init({ apiKey: process.env.CODEMENDAPIKEY });
app.use(codemend.expressErrorHandler());

React Native

javascript
import codemend from codemend/react-native;
codemend.init({ apiKey: YOURAPIKEY });
codemend.setupErrorHandler();

典型工作流程

  1. 1. 在项目中设置错误监控(如上所述)
  2. 错误会被自动捕获并发送到 Codemend
  3. 使用 listerrors 查看最近的错误
  4. 使用 getfix 获取 AI 生成的修复方案
  5. 应用修复:将 fix_prompt 粘贴到 AI 工具中,或在 GitHub 上审查 PR

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 codemend-1775883602 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 codemend-1775883602 技能

通过命令行安装

skillhub install codemend-1775883602

下载

⬇ 下载 codemend v1.1.0(免费)

文件大小: 4.06 KB | 发布时间: 2026-4-12 09:30

v1.1.0 最新 2026-4-12 09:30
- Added new "check_status" tool for tracking error analysis progress.
- Expanded tool and API documentation with detailed usage examples and JSON schema.
- Clarified setup instructions for different environments (Browser, Node.js, Express, React Native).
- Improved workflow guidance for reporting errors and applying AI-generated fixes.
- Updated response examples and explanations for all endpoints.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部