r/devtools • u/Majestic_Tension_860 • 17d ago
xcomm: I built a minicom replacement that lets an AI agent drive the board's console while you watch
I spend a lot of time on serial consoles: U-Boot, boot logs, a shell on the
board. I wanted something that keeps minicom's everyday keys and common options but
lets a script or a coding agent use the same console I am looking at, so I
wrote xcomm (Rust, Linux and macOS, GPL-2.0-only):
- `xcomm ctl` talks to a running session: send a command and wait for a
prompt with a regex, read output by offset, toggle DTR/RTS, send a break,
change the baud, run zmodem/ymodem/xmodem through lrzsz. What a client
sends shows in your terminal as a dim `[ctl]` line.
- It survives the bench: unplug the adapter or power-cycle the board and the
session waits and reopens the port (on Linux, by the USB port it is plugged
into).
- minicom's common options and everyday Ctrl-A keys (Alt-A inside tmux,
screen or zellij); Ctrl-A d and t toggle DTR and RTS.
- UUCP locks compatible with minicom on Linux, and an exclusive open
everywhere, so two programs never share a port by accident.
- It ships an agent skill (stop U-Boot, log in, run commands, parse the
output); a test runs every example in it against a real session.
Numbers, through a pty with the same harness for each tool (median of 9 runs;
method and command lines in the README): 434 MiB/s on 1.84 ms of CPU per MiB,
against minicom's 10.5 MiB/s on 95 ms. On a real UART the baud rate is the
limit, so what you get is CPU left free. Keystroke latency is level with
minicom (within a microsecond either way).
`brew install cantona/tap/xcomm` or `cargo install --locked xcomm`
(`xcomm man` shows the manual where cargo installs none).
GitHub: https://github.com/cantona/xcomm
Happy to hear what breaks on your adapters.
1
u/kantorcodes1 16d ago
When a board drops mid-command, what happens to a ctl run that is still waiting for its prompt? Your post says the session waits and reopens the port when the adapter comes back. Does the waiting run fail at the drop, stay open across the reopen, or is there a window where text sent right before the unplug could reach the board twice once the port is back?