usbtree

Your USB device tree,
live in the terminal.

A cross-platform TUI for inspecting USB devices — hubs, classes, speeds, hot-plug events and live bandwidth. Pure Rust via nusb: no root, no libusb. One static binary, ~1.5 MB download (~5–7 MB on disk). Linux · macOS · Windows.

$ curl -fsSL https://raw.githubusercontent.com/gnomeria/usbtree/main/scripts/install.sh | sh
GitHub ↗ Releases Install options

#Features

Everything lsusb -t shows — plus names that make sense, hot-plug awareness, and live traffic.

🌳

Live device tree

Color-coded class gutter, per-class icons, tree rails, and speed badges (▂ 12M█ 10G). Rescans every second; collapse hubs to a +N badge.

🏷️

Names that make sense

Resolution chain: your overrides.ids → descriptor strings → a downloadable usb.ids (--updatelist) → the embedded snapshot → vendor + class heuristics.

Hot-plug watch

Plugged devices flash green, unplugged ones linger as red crossed-out ghosts for 30 s, and every event lands in a timestamped log panel.

📈

Live bandwidth

Per-device sparklines in the tree and a bandwidth graph in the detail panel. Unprivileged URBs/s; real bytes/s with root + the usbmon module. Linux only — macOS/Windows expose no unprivileged per-device counter (sudo won't help).

🧩

Smart composite handling

Misc/IAD (0xef) devices are classified by their interface classes — a MOTU M2 shows as Audio, not Misc.

⏏️

Safe eject

Hit e on a USB drive to unmount it and cut port power through udisks2 — a confirmation dialog, then a clean pull. No root, no sudo. Linux only for now.

🎛️

PCI view

Press p to flip to a flat PCI device list with a detail pane — prog-if, subsystem, link speed/width, NUMA node, IOMMU group, and power state.

🦀

Pure Rust, zero setup

Built on nusb and ratatui: no root, no libusb, no drivers. One static binary per OS — a ~1.5 MB download (~5–7 MB on disk), no runtime deps. --dump for scripts, --demo to try it without hardware.

#Platform support

The tree, names, hot-plug log and detail panel work everywhere. Live per-device traffic is Linux-only — macOS and Windows expose no unprivileged per-device counter.

Feature Linux macOS Windows
Device tree — hubs, classes, speeds
Friendly names — overrides + usb.ids
Hot-plug watch + event log
Detail panel — path, vid:pid, serial
Device power bMaxPower, advertised
Live sparklines URBs/s
Real bandwidth usbmon bytes/s, root
Safe eject unmount + power-off, no root
Prebuilt binaries amd64 · arm64 arm64 amd64

#Install

Release archives ship for linux-amd64, linux-arm64, darwin-arm64, and windows-amd64, each sha256-listed in checksums.txt.

The shell installer and prebuilt binary links require a published GitHub release. If no release is available yet, install from source.

Homebrew — Linux · macOS

brew install usbtree

Prebuilt binary from Homebrew. Apple Silicon and Linux only.

Shell script — Linux · macOS

curl -fsSL https://raw.githubusercontent.com/gnomeria/usbtree/main/scripts/install.sh | sh

Installs to /usr/local/bin or ~/.local/bin. Pin with USBTREE_VERSION, override dir with USBTREE_INSTALL_DIR. Checksums verified automatically.

PowerShell — Windows

irm https://raw.githubusercontent.com/gnomeria/usbtree/main/scripts/install.ps1 | iex

Installs to %LOCALAPPDATA%\usbtree\bin and adds it to PATH. Pin with $env:USBTREE_VERSION. Binaries are unsigned — SmartScreen may warn on first run.

Prebuilt binary — all platforms

tar -xzf usbtree_*_linux-amd64.tar.gz && ./usbtree

Grab the archive from the latest release. Windows: unzip usbtree_*_windows-amd64.zip and run usbtree.exe.

Binaries are not code-signed/notarized. macOS: xattr -d com.apple.quarantine ./usbtree (shell installer and Homebrew formula clear quarantine). Windows: SmartScreen → More infoRun anyway.

Cargo — from source

cargo install --git https://github.com/gnomeria/usbtree

Or clone and cargo build --release. Stable toolchain, edition 2024.

#Keyboard

j / k · ↑↓move selection
↵ · Spacecollapse / expand hub
h / l · ← →fold / unfold
g / Gjump top / bottom
/filter tree
Tabfocus tree / events
y / Yyank id / details
esafe-eject storage
ptoggle USB / PCI
rforce rescan
q · Escquit