lsusbc

command module
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 6 Imported by: 0

README

lsusbc

A CLI utility to display USB Type-C device and USB Power Delivery (PD) information from Linux's typec sysfs interface.

Demo

Features

  • Display connected USB-C and USB devices in a tree view
  • Show power information (max power, current/voltage capabilities, Power Delivery version, energy flow)
  • Details on connection speed, manufacturer info, driver, etc.
  • Show alternate modes (DisplayPort, Thunderbolt, etc.)

Installation

Install via

go install github.com/cpulvermacher/lsusbc@latest

or downoad a pre-built binary from the Releases page.

Usage

Run without arguments for an interactive TUI:

lsusbc

Or use it like lsusb for quick one-shot output:

lsusbc -l        # tree overview
lsusbc -v        # full details for every device

When stdout is not a terminal (e.g. piping to grep), tree overview is used automatically.

TUI keyboard shortcuts
Key Action
/ k Select previous item
/ j Select next item
q / Esc Quit
Ctrl+C Quit
Ctrl+Z Suspend

Limitations

  • Amount of information available depends on hardware and kernel version.
  • It's possible for the /sys/class/typec information to get stuck. rmmod ucsi_acpi; modprobe ucsi_acpi may help, or a reboot may be required.

Bug Reports

If you encounter any issues, please create and share a snapshot of your USB devices. Create one by running bash ./scripts/snapshot-sys.sh Create a tarball using the displayed command.

Alternatives

References

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
model
Package model defines data structures representing USB-C ports and connected devices.
Package model defines data structures representing USB-C ports and connected devices.
parser
Package parser parses /sys file-system into model
Package parser parses /sys file-system into model
svid
Package svid decodes SVID strings to vendor names
Package svid decodes SVID strings to vendor names
ui
Package ui implements the terminal user interface
Package ui implements the terminal user interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL