lser-0.2.0 is not a library.
lser
lser is a fast, cross-platform CLI tool written in Rust that lists all available serial ports on your machine — including USB-to-serial adapters, JTAG probes, and built-in UART controllers.
It reads port metadata directly from the OS (vendor name, product string, USB VID:PID) and presents it in a polished terminal table. Three output formats are supported so lser fits equally well in interactive terminal sessions and automation scripts.
Features
- Beautiful terminal table with Unicode borders (powered by rich_rust)
--plain: CSV output for use withawk,grep,cut,csvkit, and other text tools--json: JSON array output for shell scripts, Python, or any tooling that speaks JSON- Results sorted alphabetically by port name
- Detects USB vendor/product info and VID:PID automatically
- Falls back to kernel driver name when USB metadata is unavailable
- Supports Linux (x86, x86_64, arm, aarch64) and Windows
- Single static binary, zero configuration
Supported Platforms
| Platform | Target triple | Release binary |
|---|---|---|
| Linux x86_64 | x86_64-unknown-linux-gnu |
lser-linux-x86_64 |
| Linux arm (soft-float) | arm-unknown-linux-gnueabi |
lser-linux-arm-eabi |
| Linux arm (hard-float) | arm-unknown-linux-gnueabihf |
lser-linux-arm-eabihf |
| Linux aarch64 | aarch64-unknown-linux-gnu |
lser-linux-aarch64 |
| Windows x86_64 | x86_64-pc-windows-msvc |
lser-windows-x86_64.exe |
| macOS | — | Untested |
Install
Or download a pre-built binary from the Releases page.
Usage
Default output (rich table)
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ Name ┃ Vendor ┃ Product ┃ USB ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩
│ /dev/ttyACM0 │ Espressif │ USB JTAG/serial debug unit:00 │ 303a:1001 │
│ /dev/ttyACM1 │ wch.cn │ WCH-Link:01 │ 1a86:8010 │
└──────────────┴───────────┴───────────────────────────────┴───────────┘
--plain — CSV output
One port per line with a header row. Works with awk, cut, csvkit, etc.
$ lser --plain
name,vendor,product,usb
/dev/ttyACM0,Espressif,USB JTAG/serial debug unit:00,303a:1001
/dev/ttyACM1,wch.cn,WCH-Link:01,1a86:8010
# Example: print only device names
| |
--json — JSON output
Outputs a JSON array, ideal for shell scripts or third-party tools.
$ lser --json
[
{
"name": "/dev/ttyACM0",
"vendor": "Espressif",
"product": "USB JTAG/serial debug unit:00",
"usb": "303a:1001"
},
{
"name": "/dev/ttyACM1",
"vendor": "wch.cn",
"product": "WCH-Link:01",
"usb": "1a86:8010"
}
]
# Example: extract all device names with jq
|
Output columns
| Column | Description |
|---|---|
| Name | Device path (e.g. /dev/ttyACM0, COM3) |
| Vendor | USB vendor name or kernel driver name |
| Product | USB product string |
| USB | USB Vendor ID and Product ID in VID:PID format |
Fields without information are shown as --.
Build from source
The binary will be at target/release/lser.
Dependencies
- serial_enumerator — cross-platform serial port enumeration
- rich_rust — beautiful terminal output (Rust port of Python's Rich)
- clap — command-line argument parsing
- serde / serde_json — JSON serialization
License
MIT — see LICENSE