This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
EcuBus-Pro is an open-source automotive ECU (Electronic Control Unit) development and testing tool built with Electron. It serves as an alternative to commercial tools like CAN-OE.
Key Features:
- Cross-platform (Windows, Linux, macOS)
- Multi-hardware support (PEAK, Kvaser, Vector, ZLG, Toomotss, EcuBus-LinCable, SLCAN, GS_USB)
- Protocol support: CAN/CAN-FD, LIN, DoIP, SOME/IP
- UDS diagnostic capabilities
- TypeScript-based scripting and HIL testing framework
- DBC/LDF database support
- Panel builder for custom UI creation
This is an Electron application with a clear separation between main and renderer processes:
Main Process (src/main/):
docan/- CAN protocol native module (C++)dolin/- LIN protocol native module (C++)doip/- DoIP protocol implementationuds/- Unified Diagnostic Servicesvsomeip/- SOME/IP protocol with C++ bindingsworker/- Third-party scripts provided to users (must runnpm run worker:jsafter any changes)ipc/- IPC communication handlers
Renderer Process (src/renderer/src/):
- Vue 3 + TypeScript frontend
views/- UI pages (home, uds, ostrace, etc.)stores/- Pinia state managementrouter/- Vue Routerdatabase/- DBC/LDF/ORTI parsers
CLI (src/cli/): Command-line interface for automation
| Command | Description |
|---|---|
npm run dev |
Start development server with HMR |
npm run build |
Build production version (runs typecheck first) |
npm run start |
Preview production build |
npm run test |
Run tests with Vitest |
npm run lint |
Run ESLint with auto-fix |
npm run format |
Run Prettier format |
npm run typecheck |
Run TypeScript type checks for both node and web |
npm run worker |
Build worker processes (requires Python/build tools) |
npm run worker:js |
Build worker scripts (JS only) - MUST RUN after any changes to src/main/worker/ |
npm run native |
Build all native modules (docan, dolin, someip) |
npm run docan |
Build CAN native module |
npm run dolin |
Build LIN native module |
npm run someip |
Build SOME/IP native module |
npm run build:win |
Build for Windows (NSIS installer) |
npm run build:linux |
Build for Linux (deb, rpm) |
npm run build:mac |
Build for macOS |
npm run docs:dev |
Start VitePress docs dev server |
npm run docs:build |
Build VitePress documentation |
Note: Native module builds require Python and build tools (Visual Studio on Windows, gcc on Linux).
package.json- Dependencies, scripts, and vendor hardware support configelectron-builder.yml- Electron builder configurationelectron.vite.config.ts- Vite configuration for Electrontsconfig.json,tsconfig.node.json,tsconfig.web.json- TypeScript configsvitest.config.ts- Vitest test configurationwebpack.config.js- Webpack config for workers
The project uses i18next for internationalization with support for English and Chinese. Translation files are located in resources/locales/.
UI Component Library:
- Prefer using Element Plus components for all UI implementation
- For tables:
- Simple tables: Use
el-table(from Element Plus) - Complex tables: Use
vxe-table
- Simple tables: Use
SWIG Generated Files: All *_wrap.cxx files are generated by SWIG (Simplified Wrapper and Interface Generator). These files should be ignored and never modified manually. They are generated from the corresponding .i interface files.
Worker Scripts: The src/main/worker/ directory contains scripts provided to third-party users, all code in here should has detailed typedoc format comments. Any changes to this directory must be followed by running npm run worker:js to rebuild the worker scripts.