Show HN: WhatCable, a tiny menu bar app for inspecting USB-C cables

Show HN: WhatCable, a tiny menu bar app for inspecting USB-C cables

WhatCable What can this USB-C cable actually do? A small macOS menu bar app that tells you, in plain English, what each USB-C cable plugged into your Mac can actually do, and why your Mac might be charging slowly. USB-C hides a lot under one connector. Anything from a USB 2.0 charge-only cable to a 240W / 40 Gbps Thunderbolt 4 cable, all looking identical in your drawer. macOS already exposes the relevant info via IOKit; WhatCable surfaces it as a friendly menu bar popover.

WhatCable 这条 USB-C 线到底能做什么?这是一个小巧的 macOS 菜单栏应用,它能用通俗易懂的语言告诉你,插入 Mac 的每根 USB-C 线缆的具体功能,以及为什么你的 Mac 可能充电缓慢。USB-C 在同一个接口下隐藏了太多信息:从仅支持充电的 USB 2.0 线缆到 240W / 40 Gbps 的雷电 4(Thunderbolt 4)线缆,它们在你的抽屉里看起来一模一样。macOS 其实已经通过 IOKit 暴露了相关信息,而 WhatCable 将其转化为一个友好的菜单栏弹出窗口。


What it shows Per port, in plain English:

  • At-a-glance headline: Thunderbolt / USB4, USB device, Charging only, Slow USB / charge-only cable, Nothing connected
  • Charging diagnostic: when something’s plugged in, a banner identifies the bottleneck:
    • “Cable is limiting charging speed” (cable rated below the charger)
    • “Charging at 30W (charger can do up to 96W)” (Mac is asking for less, e.g. battery near full)
    • “Charging well at 96W” (everything matches)
  • Cable e-marker info: the cable’s actual speed (USB 2.0, 5 / 10 / 20 / 40 / 80 Gbps), current rating (3 A / 5 A up to 60W / 100W / 240W), and the chip’s vendor
  • Charger PDO list: every voltage profile the charger advertises (5V / 9V / 12V / 15V / 20V…) with the currently negotiated profile highlighted in real time
  • Connected device identity: vendor name and product type, decoded from the PD Discover Identity response
  • Attached USB devices: storage, hubs, and peripherals listed under the physical port they’re plugged into, with their negotiated speed
  • Active transports: USB 2 / USB 3 / Thunderbolt / DisplayPort

它显示的内容 针对每个端口,以通俗语言显示:

  • 概览标题: 雷电 / USB4、USB 设备、仅充电、慢速 USB/仅充电线缆、未连接设备。
  • 充电诊断: 当插入设备时,横幅会识别瓶颈所在:
    • “线缆限制了充电速度”(线缆规格低于充电器)
    • “以 30W 充电(充电器最高支持 96W)”(Mac 请求的功率较低,例如电池接近充满)
    • “以 96W 正常充电”(一切匹配)
  • 线缆 E-marker 信息: 线缆的实际速度(USB 2.0, 5 / 10 / 20 / 40 / 80 Gbps)、电流额定值(3A / 5A,最高 60W / 100W / 240W)以及芯片供应商。
  • 充电器 PDO 列表: 充电器声明的每个电压配置文件(5V / 9V / 12V / 15V / 20V…),并实时高亮显示当前协商的配置文件。
  • 已连接设备身份: 从 PD Discover Identity 响应中解码出的供应商名称和产品类型。
  • 已连接的 USB 设备: 列出插入物理端口的存储设备、集线器和外设,以及它们的协商速度。
  • 活动传输协议: USB 2 / USB 3 / 雷电 / DisplayPort。

⌥-click the menu bar icon (or flip the toggle in Settings) to reveal the underlying IOKit properties for engineers. Click the gear icon in the popover header to open Settings, where you can: Hide empty ports, Launch at login, Run as a regular Dock app instead of a menu bar icon, Get notifications when cables are connected or disconnected. Right-click the menu bar icon for Refresh, a Keep window open toggle (handy for screenshots and demos), Check for Updates…, About, WhatCable on GitHub, and Quit.

按住 ⌥ 键点击菜单栏图标(或在设置中切换开关),即可为工程师显示底层的 IOKit 属性。点击弹出窗口顶部的齿轮图标打开设置,你可以:隐藏空端口、开机自启、作为普通 Dock 应用运行(而非菜单栏图标)、获取线缆连接或断开的通知。右键点击菜单栏图标可进行刷新、保持窗口打开(方便截图和演示)、检查更新、关于、访问 GitHub 上的 WhatCable 以及退出。


Install Download the latest WhatCable.zip from the Releases page, unzip, and drag WhatCable.app to /Applications. The app is universal (Apple silicon + Intel), signed with a Developer ID, and notarised by Apple, so there are no Gatekeeper warnings. Requires macOS 14 (Sonoma) or later. Apple Silicon only. On Intel Macs, the USB-C ports are driven by Intel Titan Ridge / JHL9580 Thunderbolt 3 controllers, and the USB-PD state and cable e-marker data WhatCable depends on are not exposed through any public IOKit accessor.

安装 从 Releases 页面下载最新的 WhatCable.zip,解压并将 WhatCable.app 拖入“应用程序”文件夹。该应用为通用版本(Apple Silicon + Intel),已使用开发者 ID 签名并经过 Apple 公证,因此不会出现 Gatekeeper 警告。需要 macOS 14 (Sonoma) 或更高版本。仅限 Apple Silicon 机型。在 Intel Mac 上,USB-C 端口由 Intel Titan Ridge / JHL9580 雷电 3 控制器驱动,而 WhatCable 依赖的 USB-PD 状态和线缆 E-marker 数据无法通过任何公共 IOKit 访问器获取。


Note: The manual install gives you the menu bar app only. The whatcable CLI is bundled inside the .app and is not on your PATH by default. If you want to use it from the shell, see the Command-line interface section below for the one-line symlink. Or install via Homebrew, which sets up the CLI automatically.

注意: 手动安装仅包含菜单栏应用。whatcable 命令行工具(CLI)捆绑在 .app 内部,默认不在你的 PATH 中。如果你想在 Shell 中使用它,请参阅下方的“命令行界面”部分获取一行符号链接命令。或者通过 Homebrew 安装,它会自动配置 CLI。


Homebrew

brew tap darrylmorley/whatcable
brew install --cask whatcable

This installs the menu bar app and symlinks the whatcable CLI into your PATH.

Homebrew

brew tap darrylmorley/whatcable
brew install --cask whatcable

这将安装菜单栏应用并将 whatcable CLI 符号链接到你的 PATH 中。


Command-line interface A whatcable binary ships alongside the menu bar app, driven by the same diagnostic engine: whatcable # human-readable summary of every port whatcable --json # structured JSON, pipe into jq whatcable --watch # stream updates as cables come and go (Ctrl+C to exit) whatcable --raw # include underlying IOKit properties whatcable --version whatcable --help

If you installed the .app manually rather than via Homebrew, the CLI lives at WhatCable.app/Contents/Helpers/whatcable. Symlink it into your PATH if you want it on the shell: ln -s /Applications/WhatCable.app/Contents/Helpers/whatcable /usr/local/bin/whatcable The Homebrew install does this for you automatically.

命令行界面 whatcable 二进制文件随菜单栏应用一起提供,由相同的诊断引擎驱动: whatcable # 每个端口的人类可读摘要 whatcable --json # 结构化 JSON,可管道传输至 jq whatcable --watch # 实时流式更新线缆连接状态(Ctrl+C 退出) whatcable --raw # 包含底层 IOKit 属性 whatcable --version whatcable --help

如果你不是通过 Homebrew 而是手动安装的 .app,CLI 位于 WhatCable.app/Contents/Helpers/whatcable。如果你想在 Shell 中使用它,请将其符号链接到你的 PATH: ln -s /Applications/WhatCable.app/Contents/Helpers/whatcable /usr/local/bin/whatcable Homebrew 安装会自动为你完成此操作。