opensourceprojects.dev

A broadsheet for software that doesn't ask for your email

A cross-platform lsusb replacement written in Rust, with tree and JSON output
GitHub RepoImpressions3

Project Description

View on GitHub

Cyme: A Cross-Platform lsusb Replacement That Actually Respects Your Terminal

If you've ever worked with embedded devices or USB hardware debugging, you've probably leaned on lsusb more times than you can count. And you've probably also noticed its rough edges—the verbose output that drowns you in details you don't need, the tree view that barely tells you anything useful, and the fact that it's essentially Linux-only. Cyme is a Rust-based reimagining of lsusb that keeps what works, fixes what doesn't, and adds features you'll actually use.

What It Does

Cyme lists system USB buses and devices across platforms. It profiles your USB buses and the devices connected to them, including full device descriptors. The project started as a macOS system_profiler parser, evolved to use a libusb-based profiler, and now defaults to a pure Rust profiler built on nusb.

The tool maintains compatibility with lsusb through a --lsusb argument, supporting all the standard arguments including --verbose output with fully parsed device descriptors. But it also goes further: you get an improved --tree mode that shows devices, configurations, interfaces, and endpoints as a proper tree depending on your verbosity level. There's JSON output that honors filters and tree structure, making it easy to pipe into other tools. Cyme can also be used as a library, with system profiler modules, USB descriptor modules, and a display module for printing.

Why It's Cool

  • It fixes the verbose dump problem. The developer—who works with embedded devices—found that lsusb's verbose output is mostly too verbose. Cyme gives you controllable display blocks for devices, buses, configurations, interfaces, and endpoints. You decide what to show, and --more reveals additional detail when you need it.

  • Filters that actually work with tree output. Unlike lsusb, Cyme's filters work when printing --tree. You get --filter-name, --filter-serial, --filter-class, and options to hide empty buses or hubs. There's also --filter-exclude to invert your filter. This is the kind of thing that sounds minor until you're trying to find one specific device in a dense tree.

  • Modern terminal features, not afterthoughts. Cyme supports colored output, UTF-8 characters, and icon lookups based on device data. You can control the encoding with --encoding (glyphs, utf8, or ascii), toggle color with --color, and manage icons with --icon. The auto icon mode only shows icons if your chosen encoding supports them all—a small detail that prevents broken output.

  • Practical privacy features. The --mask-serials option lets you either replace serial strings with asterisks or randomize them. If you've ever wanted to share a USB dump without leaking device serial numbers, this is genuinely useful.

  • Auto-scaling that respects your terminal. Variable-length strings like descriptors get truncated with ... when they exceed your terminal width. You can disable this with a config option or set a fixed maximum length. It's a small thing, but it means Cyme looks right whether you're in a narrow tmux pane or a full-screen terminal.

  • Cross-platform by design. The original lsusb barely works outside Linux. Cyme is built from the start to work across platforms, which matters if you're developing embedded devices on macOS or Windows.

How to Try It

Cyme is available on crates.io, so if you have Rust installed, you can grab it with:

cargo install cyme

Once installed, basic usage is straightforward:

cyme

For tree output with more detail:

cyme --tree --more

For JSON output (useful for scripting):

cyme --json --tree

If you want lsusb-compatible output:

cyme --lsusb

The project is also usable as a library. Check the docs.rs page for the API, or browse the repository for examples and configuration options.

Final Thoughts

Cyme started as a quick Rust refresher project and grew into something genuinely useful through feature creep—the good kind. It's not perfect (the developer says so themselves), but it solves real problems that lsusb users have been working around for years. If you work with USB devices on any platform, especially if you're doing embedded development, it's worth adding to your toolkit. The fact that it's also a library means you can build your own tools on top of it. Give it a try and see if it fits your workflow better than the old standby.


Follow @githubprojects for more developer tools and open source projects.

Back to Projects
Project ID: c6465ba5-6dfb-4a67-b9cc-217773c95f87Last updated: September 18, 2026 at 02:46 AM