Install
# once, globally $ npm install -g @serialpilot/list @serialpilot/terminal @serialpilot/repl
# or per-project; they’re already there if you installedserialpilot$ npx serialpilot-list —format json
serialpilot-list
Enumerate every serial port the OS knows about. The fastest way to verify your device is even visible.
$ serialpilot-list /dev/tty.usbmodem1421 USB-VID_2341&PID_0043 Arduino LLC /dev/tty.Bluetooth-Incoming-Port$ serialpilot-list —format json [{“path”:“/dev/tty.usbmodem1421”,“manufacturer”:“Arduino LLC”,…}]
$ serialpilot-list —format jsonl # one JSON object per line
| Flag | Default | Notes |
|---|---|---|
-f, --format | text | One of text, json, jsonl / jsonline. |
-h, --help | — | Show usage. |
Pipe the JSON output into jq for ad-hoc filtering:
$ serialpilot-list --format json | jq '.[] | select(.manufacturer | test("arduino"; "i"))'
serialpilot-terminal
An interactive console for talking to a port. Connect, type, see live response, exit on Ctrl-C.
$ serialpilot-terminal --list # shows ports and exits
$ serialpilot-terminal -p /dev/tty.usbmodem1421 -b 115200 # interactive — bytes you type are sent, bytes received print live
| Flag | Default | Notes |
|---|---|---|
-l, --list | — | List ports and exit. |
-p, --path | — | Required when not listing. |
-b, --baud | — | Required when not listing. |
--databits | 8 | 5 / 6 / 7 / 8. |
--parity | none | none · even · odd · mark · space. |
--stopbits | 1 | 1 · 1.5 · 2. |
--no-echo | — | Don't print characters as you type them. |
--flow-ctl | — | XONOFF · RTSCTS. |
serialpilot-repl
A scriptable Node REPL with SerialPilot and a connected port already in scope. The fastest way to poke at a device interactively.
$ serialpilot-repl
# globals: SerialPilot, SerialPilotMock, path, port
> port = new SerialPilot({ path: '/dev/tty.usbmodem1421', baudRate: 9600 })
> port.on('data', console.log)
> port.write('PING\n')
Set the DEBUG environment variable to trace internals:
$ DEBUG=serialpilot* serialpilot-repl
Scripting tips
- Pair
serialpilot-list --format jsonwithjqto drive shell scripts off device fingerprints. - Run
serialpilot-terminal --no-echowhen piping into a logfile so you don't double-record what you typed. - The repl honours
NODE_OPTIONS— pass--inspectto attach a debugger.