嘉立创EDA专业版 AI Skill — 让AI直接操控嘉立创EDA。EasyEDA Pro AI Skill - Enable AI to directly control EasyEDA.
嘉立创EDA专业版AI SKILL,为AI编程工具提供完整的EasyEDA Pro API接口和WebSocket桥接能力。
- 📚 完整API参考 — 120+ 类、62+ 枚举、70+ 接口、19+ 类型别名
- 🔌 WebSocket桥接 — 在运行的EasyEDA Pro客户端中执行代码
- 🛠️ 代码模式 — PCB、原理图、库、项目管理的常用操作
- 🌐 多窗口支持 — 同时连接多个EasyEDA窗口
- 🔍 自动端口发现 — 自动扫描并连接可用端口(49620-49629)
- 下载本仓库并解压
- 放入AI编程工具的SKILL目录
git clone https://github.com/easyeda/easyeda-api-skill.git
cd easyeda-api-skill
npm installcd easyeda-api-skill
npm run server桥接服务将在端口范围 49620-49629 中自动选择可用端口启动。
在EasyEDA Pro中安装 run-api-gateway.eext 扩展:
👉 下载扩展
扩展加载后将自动连接桥接服务。
# 检查桥接服务状态
curl http://localhost:49620/health
# 查看已连接的EDA窗口
curl http://localhost:49620/eda-windowscurl -X POST http://localhost:49620/execute \
-H "Content-Type: application/json" \
-d '{"code": "return await eda.dmt_Project.getCurrentProjectInfo();"}'┌──────────┐ HTTP/WS ┌────────────────┐ WebSocket ┌──────────┐
│ AI Agent │ ◄───────────► │ Bridge Server │ ◄───────────► │ EasyEDA │
│ │ Port Range │ (Node.js) │ Port Range │ (Client) │
└──────────┘ 49620-49629 └────────────────┘ 49620-49629 └──────────┘
完整的API文档位于 references/ 目录:
- 📑 API索引 — 所有类、枚举、接口的完整列表
- ⚡ 快速参考 — 所有方法签名快速查找
- 📁 类文档 — 120个类的详细文档
DMT_*— 文档管理 (Board, Project, Schematic, Pcb...)PCB_*— PCB与封装操作SCH_*— 原理图操作LIB_*— 库管理 (Symbol, Footprint, Device...)SYS_*— 系统功能 (Dialog, FileSystem, Message...)
- 📁 枚举文档 — 62个枚举
- 📁 接口文档 — 70个接口定义
- 📁 类型文档 — 19个类型别名
// 获取当前项目信息
return await eda.dmt_Project.getCurrentProjectInfo();
// 列出所有电路板
return await eda.dmt_Board.getAllBoardsInfo();
// 创建新电路板
return await eda.dmt_Board.createBoard();// 在铜膜层创建导线
await eda.pcb_PrimitiveLine.create(
"GND", // 网络
1, // 层 (顶层铜膜)
0, // 起点X (单位: 1mil)
0, // 起点Y
1000, // 终点X
0, // 终点Y
10, // 线宽
false // 是否锁定
);
// 修改图元 (异步模式)
const prim = await eda.pcb_PrimitiveComponent.get([id]);
const asyncPrim = prim.toAsync();
asyncPrim.setState_X(newX);
asyncPrim.setState_Y(newY);
asyncPrim.done();// 获取所有页面
return await eda.dmt_Schematic.getAllSchematicDocumentsInfo();
// 创建元件
await eda.sch_PrimitiveComponent.create(
"device-uuid", // 元件UUID
5000, // X坐标 (单位: 0.01inch)
5000, // Y坐标
"", // 子部件名称
0, // 旋转角度
false, // 镜像
true, // 加入BOM
true // 加入PCB
);// 显示提示消息
eda.sys_Message.showToastMessage("操作完成!");
// 显示确认对话框
const confirmed = await eda.sys_Dialog.showConfirmationMessage("确认继续?");
// 运行DRC检查
const passed = await eda.pcb_Drc.check(true, true, false);不同域使用不同的坐标单位:
| 域 | 单位 | 换算 |
|---|---|---|
| PCB | 1mil | 1mm ≈ 39.37 units |
| 原理图 | 0.01inch (10mil) | 1mm ≈ 3.937 units |
这是AI最常犯的错误! 单位错误会导致元件放置位置偏差10倍。
操作前必须验证:
- ✅ 项目已打开 — 使用
eda.dmt_Project.getCurrentProjectInfo()验证 - ✅ 文档类型匹配 — PCB API需要活动PCB文档,SCH API需要活动原理图文档
- ✅ 正确的文档已激活 — 使用
eda.dmt_SelectControl.getCurrentDocumentInfo()检查
- 中文名:嘉立创EDA
- 英文名:EasyEDA
- Run API Gateway — EasyEDA扩展,用于连接桥接服务
- extension-dev-skill — EasyEDA扩展开发Skill
- extension-dev-mcp-tools — EasyEDA扩展开发MCP工具
EasyEDA Pro AI Skill for AI programming tools, providing complete API reference and WebSocket bridge capabilities.
- 📚 Complete API Reference — 120+ classes, 62+ enums, 70+ interfaces, 19+ type aliases
- 🔌 WebSocket Bridge — Execute code in the running EasyEDA Pro client
- 🛠️ Code Patterns — Common operations for PCB, schematic, library, and project management
- 🌐 Multi-Window Support — Connect multiple EasyEDA windows simultaneously
- 🔍 Auto Port Discovery — Automatically scan and connect to available ports (49620-49629)
- Download this repository and extract
- Place it in your AI programming tool's SKILL directory
git clone https://github.com/easyeda/easyeda-api-skill.git
cd easyeda-api-skill
npm installcd easyeda-api-skill
npm run serverThe bridge server will automatically start on an available port in the range 49620-49629.
Install the run-api-gateway.eext extension in EasyEDA Pro:
The extension will automatically connect to the bridge service after loading.
# Check bridge service status
curl http://localhost:49620/health
# List connected EDA windows
curl http://localhost:49620/eda-windowscurl -X POST http://localhost:49620/execute \
-H "Content-Type: application/json" \
-d '{"code": "return await eda.dmt_Project.getCurrentProjectInfo();"}'┌──────────┐ HTTP/WS ┌────────────────┐ WebSocket ┌──────────┐
│ AI Agent │ ◄───────────► │ Bridge Server │ ◄───────────► │ EasyEDA │
│ │ Port Range │ (Node.js) │ Port Range │ (Client) │
└──────────┘ 49620-49629 └────────────────┘ 49620-49629 └──────────┘
Complete API documentation is located in the references/ directory:
- 📑 API Index — Complete list of all classes, enums, and interfaces
- ⚡ Quick Reference — Quick lookup for all method signatures
- 📁 Class Docs — Detailed documentation for 120 classes
DMT_*— Document Management (Board, Project, Schematic, Pcb...)PCB_*— PCB & Footprint OperationsSCH_*— Schematic OperationsLIB_*— Library Management (Symbol, Footprint, Device...)SYS_*— System Functions (Dialog, FileSystem, Message...)
- 📁 Enum Docs — 62 enums
- 📁 Interface Docs — 70 interface definitions
- 📁 Type Docs — 19 type aliases
- 🚀 How to Start
- 📝 Extension JSON Configuration
- 🔗 Invoke APIs
- 🌍 Internationalization
⚠️ Error Handling- 🔒 Stability
- 🖼️ Inline Frame
- 📦 Extensions Marketplace
- 🔧 Ancillary Projects
// Get current project info
return await eda.dmt_Project.getCurrentProjectInfo();
// List all boards
return await eda.dmt_Board.getAllBoardsInfo();
// Create a new board
return await eda.dmt_Board.createBoard();// Create a trace on copper layer
await eda.pcb_PrimitiveLine.create(
"GND", // net
1, // layer (top copper)
0, // startX (unit: 1mil)
0, // startY
1000, // endX
0, // endY
10, // lineWidth
false // primitiveLock
);
// Modify primitive (async mode)
const prim = await eda.pcb_PrimitiveComponent.get([id]);
const asyncPrim = prim.toAsync();
asyncPrim.setState_X(newX);
asyncPrim.setState_Y(newY);
asyncPrim.done();// Get all pages
return await eda.dmt_Schematic.getAllSchematicDocumentsInfo();
// Create a component
await eda.sch_PrimitiveComponent.create(
"device-uuid", // component UUID
5000, // X coordinate (unit: 0.01inch)
5000, // Y coordinate
"", // subPartName
0, // rotation
false, // mirror
true, // addIntoBom
true // addIntoPcb
);// Show toast message
eda.sys_Message.showToastMessage("Operation complete!");
// Show confirmation dialog
const confirmed = await eda.sys_Dialog.showConfirmationMessage("Proceed?");
// Run DRC check
const passed = await eda.pcb_Drc.check(true, true, false);Different domains use different coordinate units:
| Domain | Unit | Conversion |
|---|---|---|
| PCB | 1mil | 1mm ≈ 39.37 units |
| Schematic | 0.01inch (10mil) | 1mm ≈ 3.937 units |
This is the most common mistake made by AI! Unit errors will cause components to be placed 10x off position.
Must verify before operations:
- ✅ Project is opened — Use
eda.dmt_Project.getCurrentProjectInfo()to verify - ✅ Document type matches — PCB APIs require active PCB document, SCH APIs require active Schematic document
- ✅ Correct document is active — Use
eda.dmt_SelectControl.getCurrentDocumentInfo()to check
- Chinese: 嘉立创EDA
- English: EasyEDA
- Run API Gateway — EasyEDA extension for connecting to bridge service
- extension-dev-skill — EasyEDA extension development Skill
- extension-dev-mcp-tools — EasyEDA extension development MCP tools
Version: 1.0.3
Author: JLCEDA
Compatibility: Node.js 18+, EasyEDA Pro desktop client (extension support required)