whatcable-macos-usb-inspector
БесплатноБез исполняемых скриптовНе проверенmacOS menu bar app that identifies USB-C cable capabilities and charging diagnostics using IOKit
от reason-machines★ 99 звёзд на GitHubОб этом скилле
WhatCable macOS USB-C Inspector
Skill by ara.so — Daily 2026 Skills collection.
WhatCable is a macOS 14+ menu bar app (Swift/SwiftUI) that reads IOKit services to surface what each USB-C cable plugged into your Mac can actually do — speed, power rating, e-marker data, PDO profiles, and connected device identity — in plain English.
Project Structure
Sources/WhatCable/
├── WhatCableApp.swift # App entry point, menu bar setup
├── ContentView.swift # Main popover UI
├── PortSummary.swift # Plain-English logic per port
├── PDVDO.swift # PD VDO bit-twiddling / spec decoding
├── IOKitReader.swift # IOKit service queries
└── ...
scripts/
└── build-app.sh # Universal binary + notarisation
Install / Build
# Run locally (development)
swift run WhatCable
# Build distributable universal app (arm64 + x86_64)
./scripts/build-app.sh
# → dist/WhatCable.app
# → dist/WhatCable.zip
Requires Swift 5.9 / Xcode 15+, macOS 14 (Sonoma) or later.
Signed + Notarised Build
cp .env.example .env
# Edit .env:
# DEVELOPER_ID="Developer ID Application: Your Name (TEAMID)"
# NOTARY_PROFILE="WhatCable-notary"
# Store notarytool credentials once
xcrun notarytool store-credentials "WhatCable-notary" \
--apple-id "$APPLE_ID" \
--team-id "$TEAM_ID" \
--password "$APP_SPECIFIC_PASSWORD"
./scripts/build-app.sh
Key Concepts
IOKit Service Families
| Service | Purpose |
|---|---|
AppleHPMInterfaceType10/11/12 (M3+) |
Per-port state, transports, plug orientation, e-marker presence |
AppleTCControllerType10 (M1/M2) |
Same, older HPM interface |
IOPortFeaturePowerSource |
Full PDO list + live negotiated PDO |
IOPortTransportComponentCCUSBPDSOP |
PD Discover Identity VDOs (SOP = partner, SOP' = cable e-marker) |
USB PD VDO Decoding (PDVDO.swift)
The core bit-twiddling follows USB Power Delivery 3.x spec. Cable e-marker VDOs encode speed and current in specific bit fields.
// Example: decode cable speed from Passive Cable VDO
struct PassiveCableVDO {
let raw: UInt32
// Bits [5:3] — USB SuperSpeed signalling support
var usbSSSignalling: UInt8 {
UInt8((raw >> 3) & 0b111)
}
var dataRate: String {
switch usbSSSignalling {
case 0b000: return "USB 2.0 only"
case 0b001: return "USB 3.2 Gen 1 (5 Gbps)"
case 0b010: return "USB 3.2 Gen 2 (10 Gbps)"
case 0b011: return "USB 3.2 Gen 2x2 / USB4 Gen 2 (20 Gbps)"
case 0b100: return "USB4 Gen 3 (40 Gbps)"
default: return "Unknown"
}
}
// Bits [6:5] — VBUS current handling
var currentCapability: String {
switch (raw >> 5) & 0b11 {
case 0b00: return "USB Type-C Default (≤3A)"
case 0b01: return "3A"
case 0b10: return "5A"
default: return "Reserved"
}
}
}
Reading IOKit Properties
import IOKit
func readPortProperties(serviceName: String) -> [String: Any]? {
var iterator: io_iterator_t = 0
let matchDict = IOServiceMatching(serviceName)
guard IOServiceGetMatchingServices(kIOMainPortDefault,
matchDict, &iterator) == KERN_SUCCESS else {
return nil
}
defer { IOObjectRelease(iterator) }
var service = IOIteratorNext(iterator)
var results: [String: Any] = [:]
while service != 0 {
defer {
IOObjectRelease(service)
service = IOIteratorNext(iterator)
}
if let props = copyProperties(service) {
results.merge(props) { _, new in new }
}
}
return results.isEmpty ? nil : results
}
private func copyProperties(_ service: io_service_t) -> [String: Any]? {
var propsRef: Unmanaged<CFMutableDictionary>?
guard IORegistryEntryCreateCFProperties(service, &propsRef,
kCFAllocatorDefault, 0) == KERN_SUCCESS,
let props = propsRef?.takeRetainedValue() as? [String: Any] else {
return nil
}
return props
}
Port Summary Plain-English Logic (PortSummary.swift)
enum PortHeadline: String {
case thunderbolt = "Thunderbolt / USB4"
case usbDevice = "USB device connected"
case chargingOnly = "Charging only"
case slowCable = "Slow USB / charge-only cable"
case nothing = "Nothing connected"
}
struct PortSummary {
let headline: PortHeadline
let chargingDiagnostic: String?
let dataRate: String?
let currentRating: String?
let negotiatedPDO: PDO?
let allPDOs: [PDO]
static func from(ioKitProps: [String: Any]) -> PortSummary {
let hasThunderbolt = ioKitProps["Thunderbolt"] as? Bool ?? false
let hasUSB3 = ioKitProps["USB3"] as? Bool ?? false
let isConnected = ioKitProps["Connected"] as? Bool ?? false
let emarkerPresent = ioKitProps["CableEMa
Установить whatcable-macos-usb-inspector в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл whatcable-macos-usb-inspector?
macOS menu bar app that identifies USB-C cable capabilities and charging diagnostics using IOKit
Как установить скилл whatcable-macos-usb-inspector?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл whatcable-macos-usb-inspector запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic