[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-17":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":25,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":40,"readmeContent":41,"aiSummary":42,"trendingCount":16,"starSnapshotCount":16,"syncStatus":43,"lastSyncTime":44,"discoverSource":45},17,"whatcable","darrylmorley\u002Fwhatcable","darrylmorley","macOS menu bar app that tells you, in plain English, what each USB-C cable plugged into your Mac can actually do","https:\u002F\u002Fgithub.com\u002Fdarrylmorley\u002Fwhatcable\u002Freleases\u002Flatest",null,"Swift",5678,171,9,21,0,26,308,2444,137,37.71,"MIT License",false,"main",true,[27,28,29,30,31,32,33,34,35,36,37,38,39],"apple-silicon","hardware-info","iokit","mac-app","macos","menubar","menubar-app","swift","swiftui","thunderbolt","usb-c","usb-power-delivery","utility","2026-06-12 02:00:06","# WhatCable\n\n> **What can this USB-C cable actually do?**\n\nA 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**.\n\nUSB-C hides a lot under one connector. Anything from a USB 2.0 charge-only cable to a 240W \u002F 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.\n\n[![Latest release](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fv\u002Frelease\u002Fdarrylmorley\u002Fwhatcable)](https:\u002F\u002Fgithub.com\u002Fdarrylmorley\u002Fwhatcable\u002Freleases\u002Flatest)\n[![Platform](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fplatform-macOS%2014%2B-blue)](https:\u002F\u002Fgithub.com\u002Fdarrylmorley\u002Fwhatcable)\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-green)](LICENSE)\n\n![WhatCable popover](docs\u002Fscreenshot.png)\n\n> [!IMPORTANT]\n> **Upgrading from 0.5.x to 0.6.0?** WhatCable's bundle ID changed from `com.bitmoor.whatcable` to `uk.whatcable.whatcable` in 0.6.0 to match the new `whatcable.uk` domain. The in-app \"Check for Updates\" path in 0.5.x will refuse to install 0.6.0 because the downloaded bundle ID won't match what it expects. Upgrade through Homebrew (`brew upgrade --cask whatcable`) or by downloading [the latest release zip](https:\u002F\u002Fgithub.com\u002Fdarrylmorley\u002Fwhatcable\u002Freleases\u002Flatest) and replacing `WhatCable.app` manually. Your preferences and notification permissions will reset on first launch of 0.6.0; re-enable launch-at-login from Settings if you had it on. This only affects the 0.5.x → 0.6.0 transition.\n\n## What it shows\n\nPer port, in plain English:\n\n- **At-a-glance headline:** Thunderbolt \u002F USB4, USB device, Charging only, Slow USB \u002F charge-only cable, Nothing connected\n- **Charging diagnostic:** when something's plugged in, a banner identifies the bottleneck:\n  - *\"Cable is limiting charging speed\"* (cable rated below the charger)\n  - *\"Charging at 30W (charger can do up to 96W)\"* (Mac is asking for less, e.g. battery near full)\n  - *\"Charging well at 96W\"* (everything matches)\n- **Cable e-marker info:** the cable's actual speed (USB 2.0, 5 \u002F 10 \u002F 20 \u002F 40 \u002F 80 Gbps), current rating (3 A \u002F 5 A up to 60W \u002F 100W \u002F 240W), and the chip's vendor\n- **Cable trust signals:** an orange card appears when the e-marker reports values that look unusual against the USB-PD spec, like a zero vendor ID, a reserved bit pattern in the speed \u002F current \u002F cable-latency fields, or a VID that isn't in USB-IF's published list. Wording is hedged on purpose: a flag means \"this looks unusual,\" not \"this cable is fake.\"\n- **Charger PDO list:** every voltage profile the charger advertises (5V \u002F 9V \u002F 12V \u002F 15V \u002F 20V…) with the currently negotiated profile highlighted in real time\n- **Connected device identity:** vendor name and product type, decoded from the PD Discover Identity response\n- **Attached USB devices:** storage, hubs, and peripherals listed under the physical port they're plugged into, with their negotiated speed\n- **Active transports:** USB 2 \u002F USB 3 \u002F Thunderbolt \u002F DisplayPort\n- **⌥-click** the menu bar icon (or flip the toggle in Settings) to reveal the underlying IOKit properties for engineers\n\nClick the **gear icon** in the popover header to open Settings, where you can:\n\n- Hide empty ports\n- Launch at login\n- Run as a regular Dock app instead of a menu bar icon\n- Get notifications when cables are connected or disconnected\n\nRight-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**.\n\n## Install\n\nVisit [whatcable.uk](https:\u002F\u002Fwhatcable.uk) for an overview and screenshots, or install directly below.\n\nDownload the latest `WhatCable.zip` from the [Releases page](https:\u002F\u002Fgithub.com\u002Fdarrylmorley\u002Fwhatcable\u002Freleases\u002Flatest), unzip, and drag `WhatCable.app` to `\u002FApplications`.\n\nThe app is universal (Apple silicon + Intel), signed with a Developer ID, and notarised by Apple, so there are no Gatekeeper warnings.\n\nRequires macOS 14 (Sonoma) or later. Apple Silicon only. On Intel Macs, the USB-C ports are driven by Intel Titan Ridge \u002F 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.\n\n> **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](#command-line-interface) section below for the one-line symlink. Or install via Homebrew, which sets up the CLI automatically.\n\n### Homebrew\n\n```bash\nbrew tap darrylmorley\u002Fwhatcable\nbrew install --cask whatcable\n```\n\nThis installs the menu bar app and symlinks the `whatcable` CLI into your PATH.\n\n## Command-line interface\n\nA `whatcable` binary ships alongside the menu bar app, driven by the same diagnostic engine:\n\n```bash\nwhatcable                # human-readable summary of every port\nwhatcable --json         # structured JSON, pipe into jq\nwhatcable --watch        # stream updates as cables come and go (Ctrl+C to exit)\nwhatcable --raw          # include underlying IOKit properties\nwhatcable --version\nwhatcable --help\n```\n\nIf you installed the `.app` manually rather than via Homebrew, the CLI lives at `WhatCable.app\u002FContents\u002FHelpers\u002Fwhatcable`. Symlink it into your PATH if you want it on the shell:\n\n```bash\nln -s \u002FApplications\u002FWhatCable.app\u002FContents\u002FHelpers\u002Fwhatcable \u002Fusr\u002Flocal\u002Fbin\u002Fwhatcable\n```\n\nThe Homebrew install does this for you automatically.\n\n## How it works\n\nWhatCable reads four families of IOKit services. No entitlements, no private APIs, no helper daemons:\n\n| Service | What it gives us |\n| --- | --- |\n| `AppleHPMInterfaceType10\u002F11\u002F12` (M3-era), `AppleTCControllerType10\u002F11` (M1 \u002F M2), and `IOPort` (M4 Mac mini front ports) | Per-port state: connection, transports, plug orientation, e-marker presence. `Type11` is what M2 MacBook Air uses for its MagSafe 3 port. |\n| `IOPortFeaturePowerSource` | Full PDO list from the connected source, with the live \"winning\" PDO |\n| `IOPortTransportComponentCCUSBPDSOP`, `...SOPp`, `...SOPpp` | PD Discover Identity VDOs from the port partner (SOP), the cable's near-end e-marker (SOP'), and the far-end e-marker (SOP'') if present |\n| XHCI controller subtree | Each connected USB device is paired to its physical port via the XHCI port node's `UsbIOPort` registry path, falling back to a bus-index derived from the controller's `locationID` upper byte and the port's `hpm` SPMI ancestor on machines that don't expose `UsbIOPort`. |\n\nCable speed and power decoding follow the USB Power Delivery spec (aligned to USB-PD R3.2 V1.2, March 2026). Vendor names come from USB-IF's published vendor-ID list, bundled as a TSV refreshed by `scripts\u002Fupdate-vendor-db.sh`.\n\n## Build from source\n\n```bash\nswift run WhatCable          # menu bar app\nswift run whatcable-cli      # CLI\n```\n\nRequires Swift 5.9 (Xcode 15+).\n\n## Build a distributable .app\n\n```bash\n.\u002Fscripts\u002Fbuild-app.sh\n```\n\nProduces a universal `dist\u002FWhatCable.app` (arm64 + x86_64) and `dist\u002FWhatCable.zip`.\n\n**Modes:**\n\n| Configuration | Result |\n| --- | --- |\n| No `.env` | Ad-hoc signed. Works locally; Gatekeeper warns on other Macs. |\n| `.env` with `DEVELOPER_ID` | Developer ID signed + hardened runtime. |\n| `.env` with `DEVELOPER_ID` + `NOTARY_PROFILE` | Full notarisation + stapled ticket. Gatekeeper-clean for everyone. |\n\n**Cutting a release:**\n\n```bash\n# write release-notes\u002Fv0.5.3.md first, then:\n.\u002Fscripts\u002Frelease.sh 0.5.3\n```\n\nThe wrapper does the whole pipeline: bumps the version, runs build-app.sh\n(which builds, signs, notarises, smoke-tests, and bumps the local cask),\ntags and pushes the commit, creates the GitHub release with the notes\nfile, verifies the uploaded asset's sha matches the local zip, copies the\nnotes into the tap, and pushes the tap. Use `--dry-run` first to validate\nstate. Requires `gh` (auth'd) and the env vars from `.env.example`.\n\n**One-time setup for full notarisation:**\n\n```bash\n# 1. Find your signing identity\nsecurity find-identity -v -p codesigning\n\n# 2. Store notarytool credentials in the keychain\nxcrun notarytool store-credentials \"WhatCable-notary\" \\\n    --apple-id \"you@example.com\" \\\n    --team-id \"ABCDE12345\" \\\n    --password \"\u003Capp-specific-password>\"   # generate at appleid.apple.com\n\n# 3. Create your .env from the template\ncp .env.example .env\n# ...and fill in DEVELOPER_ID\n```\n\n## Caveats\n\n- **Cable e-marker info only appears for cables that carry one.** Most USB-C cables under 60 W are unmarked. Any Thunderbolt \u002F USB4 cable, any 5 A \u002F 100 W+ cable, and most quality data cables will be e-marked.\n- **Some cables only reveal their e-marker once something is plugged in at the other end.** The chip in the cable's plug runs off VCONN (a small power rail your Mac feeds into the cable) and only answers when the host issues a \"Discover Identity\" message. With nothing attached, some Macs read the e-marker straight away, others wait until they see a real partner to negotiate with. If a cable shows up as basic when bare, plug a charger, dock, or device into the far end and check again.\n- **WhatCable trusts the e-marker for capabilities.** Cable speed, current rating, and vendor come straight from the chip in the cable's plug, and software cannot verify what's inside the jacket. If a cable claims 240W \u002F 40 Gbps but performs poorly, the chip is lying, not WhatCable. The trust-signals card flags a small set of internal-consistency tells (zero VID, reserved bit patterns in the Cable VDO, a VID not in the USB-IF list) that often appear on counterfeit or mis-flashed cables, but those flags are hedged signals, not proof.\n- **PD spec coverage:** the decoder is aligned to USB-PD R3.2 V1.2 (March 2026). Earlier 3.0 \u002F 3.1 cables work fine.\n- **Vendor name lookup uses USB-IF's published list** (~13,650 entries, March 2026 snapshot). VIDs assigned by USB-IF after that snapshot will show as \"Unregistered \u002F unknown\" and trip a trust-signal flag until the bundled list is refreshed.\n- **macOS only.** iOS sandboxing makes USB-C e-marker access much harder.\n- **Apple Silicon only.** Intel Macs route USB-C through Intel Thunderbolt 3 controllers (Titan Ridge \u002F JHL9580). Apple's IOKit driver for those chips does not expose the USB-PD negotiation state or the cable e-marker VDOs, so there's no path to surface the same information on Intel hardware.\n- **Not on the App Store.** App Sandbox blocks the IOKit reads we depend on.\n\n## Privacy\n\nWhatCable reads USB-C port state directly from IOKit on your Mac. All of that happens locally. Nothing is sent anywhere automatically.\n\n**Cable reports:** If you use the \"Report this cable\" button on an e-marked cable, WhatCable builds a pre-filled GitHub issue containing the cable's vendor ID, product ID, and capability flags (VDOs). Your browser opens with that data in the issue form. Nothing is submitted until you click the button in GitHub yourself. Once submitted, the issue is public.\n\n**Update checks:** WhatCable periodically checks the GitHub Releases API to see if a newer version is available. No personal data or hardware info is included in that request.\n\n## Contributing\n\nIssues and PRs welcome. The code is small and tries to stay readable. Start at [`Sources\u002FWhatCable\u002FContentView.swift`](Sources\u002FWhatCable\u002FContentView.swift) for the UI, [`Sources\u002FWhatCableCore\u002FPortSummary.swift`](Sources\u002FWhatCableCore\u002FPortSummary.swift) for the plain-English logic, or [`Sources\u002FWhatCableCore\u002FPDVDO.swift`](Sources\u002FWhatCableCore\u002FPDVDO.swift) for the bit-twiddling. Cross-platform models and the diagnostic engine live in `WhatCableCore`; the IOKit watchers (port state, PD identity, power sources, USB devices) live in [`Sources\u002FWhatCableDarwinBackend\u002F`](Sources\u002FWhatCableDarwinBackend\u002F). The same `WhatCableCore` powers the menu bar app and the `whatcable` CLI in [`Sources\u002FWhatCableCLI\u002F`](Sources\u002FWhatCableCLI\u002F).\n\n## Credits\n\nBuilt by [Darryl Morley](https:\u002F\u002Fgithub.com\u002Fdarrylmorley).\n\nInspired by every time someone has asked \"*is this cable any good?*\".\n","WhatCable 是一款 macOS 菜单栏应用，能够以简洁明了的语言告诉用户每根插入 Mac 的 USB-C 线缆的实际功能。其核心功能包括显示线缆的传输速度、充电能力以及连接设备的信息，并能诊断为什么 Mac 可能会充电缓慢。该应用利用 IOKit 框架获取硬件信息，并通过友好的菜单栏弹出窗口展示这些数据。它适用于需要快速了解当前所用 USB-C 线缆特性的场景，尤其是当用户遇到充电或数据传输问题时。WhatCable 采用 Swift 和 SwiftUI 开发，支持最新的 macOS 版本。",2,"2026-06-11 02:30:28","CREATED_QUERY"]