lsuart is a Rust-based serial port list program. The program uses serialport and clap as its main dependencies, providing a simple command-line interface to access system serial ports.
This project uses the following technical frameworks and libraries:
- Rust: As the main programming language, providing high performance and memory safety guarantees.
- serialport: Library for serial port communication, version 4.5.0.
- clap: Library for parsing command-line arguments, version 4.5.17, with
derivefeature enabled.
- Ensure Rust development environment is installed
- Install with Scoop on Windows:
scoop bucket add huanfeng https://github.com/huanfeng/scoop-bucket
scoop install huanfeng/lsuart- Or clone and build the project:
git clone https://github.com/huanfeng/lsuart.git
cd lsuart
cargo build --releasePush a tag like v0.1.0 to trigger the GitHub Release workflow. The workflow builds release archives, publishes the release assets, and sends a repository_dispatch event to huanfeng/scoop-bucket to update the Scoop manifest automatically.
lsuart [OPTIONS]
-
--sort <SORT>: Sorting mode [default: 1]- 0: Default sorting
- 1: Sort by port number
-
-u, --usb-only: Show only USB serial devices -
--pci-only: Show only PCI serial devices -
--bt-only: Show only Bluetooth serial devices -
-v, --verbose: Show detailed information -
-h, --help: Display help information -
-V, --version: Display version information
- List all serial devices:
lsuart- Show only USB devices sorted by port number:
lsuart --usb-only --sort 1- Display detailed device information:
lsuart --verboseThe program displays a list of found serial port devices, including:
- Port name
- Device type (USB/PCI/Bluetooth)
- Additional information in verbose mode (USB devices only):
- Vendor ID (VID)
- Product ID (PID)
- Serial number
- Manufacturer
- Product name
Issues and Pull Requests are welcome!
MIT License