serial

A serial-monitoring command for reading data sent by an embedded device over a serial connection. It includes a command-line tool for automatically collecting logs and a graphical tool for watching the connection yourself.

In plain words
What is it for?
Use it to monitor firmware logs, save serial output, reset a microcontroller, and collect evidence while testing or debugging a board.
Why use it?
It provides a repeatable way to capture device output, including messages printed during startup after a reset.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/jzl-maker/ea-skill/serial
Clone the repo
git clone --depth 1 https://github.com/jzl-maker/EA-SKILL
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 923 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00923
Opus 5 $0.00000 $0.00462
Sonnet 5 $0.00000 $0.00185
Haiku 4.5 $0.00000 $0.00092

Measured 2d ago against content hash 309dbae626cb, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

serial scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/serial.md · 99 lines

How it starts

The opening of the file, as written. The whole thing — 99 lines — stays where its author put it; the contents beside it link to each section on GitHub.

命令: /ea serial (串口监控)

功能

串口数据监控和日志抓取

EA-SKILL 内置两个串口工具:

工具 路径 用途
serial-mcp (GUI) ~/.claude/skills/ea-skill/tools/serial-mcp/ 可视化串口监控,人工观察
serial-monitor (CLI) ~/.claude/skills/ea-skill/tools/serial-monitor/scripts/serial_monitor.py AI 自动抓取日志

serial-mcp 用于人工观察,serial-monitor 用于 AI 自动抓取日志。

串口监控 (CLI)

调用方式

python ~/.claude/skills/ea-skill/tools/serial-monitor/scripts/serial_monitor.py \
  --port <COM端口> \
  --baud <波特率>

完整参数示例(避免错过启动消息)

关键:必须指定 OpenOCD 参数,否则复位会失败!

python ~/.claude/skills/ea-skill/tools/serial-monitor/scripts/serial_monitor.py \
  --port COM5 \
  --baud 115200 \
  --duration 15 \
  --wait-reset \
  --auto-reset \
  --interface stlink \
  --openocd-config interface/stlink.cfg \
  --openocd-target target/stm32f4x.cfg \
  --save .ea/logs/serial_S9.log

参数说明

参数 必须 说明
--port 串口端口 (如 COM6)
--baud 波特率 (如 921600)
--duration 监控时长(秒)
--auto-reset 自动复位 MCU
--interface ✅(复位时) 烧录接口类型 (stlink/jlink/cmsis-dap)
--openocd-config ✅(复位时) OpenOCD 接口配置文件
--openocd-target ✅(复位时) OpenOCD 目标芯片配置文件
--save 日志保存路径

串口 GUI (MCP)

python ~/.claude/skills/ea-skill/tools/serial-mcp/serial_monitor.py

MCP 工具

工具 说明
serial_read 读取串口日志
serial_status 获取连接状态
serial_send 发送命令
serial_log_file 获取日志文件

工作流程

  1. 打开串口,开始监听
  2. 如果使用 --auto-reset,OpenOCD 执行 reset halt 复位开发板
  3. MCU 重启后输出完整启动日志
  4. 捕获完整的启动日志并保存

注意事项

⚠️ --interface 必须与烧录时使用的接口一致

⚠️ --openocd-config 和 --openocd-target 路径必须正确

⚠️ 避免错过启动消息:先打开串口,再执行复位

常见错误

错误 原因 解决方案
Unsupported transport 未传 --interface,OpenOCD 自动选择错误接口 添加正确的 --interface 参数
invalid command name --openocd-config 路径不对 检查 OpenOCD 配置文件路径
串口被占用 其他程序占用该端口 关闭占用串口的程序
连接失败 串口号错误或未连接 检查串口连接和设备管理器

相关文件

  • ~/.claude/skills/ea-skill/tools/serial-monitor/scripts/serial_monitor.py - CLI 工具
  • ~/.claude/skills/ea-skill/tools/serial-mcp/ - GUI MCP 工具
  • commands/build.md - 编译说明
  • commands/flash.md - 烧录说明

Read the full file on GitHub · 99 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 99 lines · 0 tokens per session scan A 309dbae626cb

Subscribe to this mod's changes

serial is a command published in the GitHub repository jzl-maker/EA-SKILL (6 stars, last pushed 5d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 923 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.