ofirgalcon / whatcable
WhatCable USB-C port snapshot module for munkireport.
Requires
None
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Stores a snapshot of each USB-C port from the WhatCable command-line tool. The module does not ship the whatcable binary.
WhatCable 1.5.1 or later must already be installed on the client for full display, charging, and adapter fields. Older 1.4+ CLIs still report ports; new columns stay empty until clients update. Useful port data requires macOS 14 or later on Apple Silicon. Other Macs still report not_installed or error.
Install the CLI without Homebrew by unpacking whatcable-cli-<version>.zip into /usr/local/whatcable/ (the binary and both .bundle directories must stay side by side) and installing this wrapper as /usr/local/bin/whatcable:
#!/bin/bash exec "/usr/local/whatcable/whatcable" "$@"
The module runs /usr/local/whatcable/whatcable directly. It also accepts /usr/local/bin/whatcable, /opt/homebrew/bin/whatcable, and /Applications/WhatCable.app/Contents/Helpers/whatcable.
Each check-in replaces every row for that serial. Unplugging a cable clears that cable's fields on the next report. A missing whatcable binary uploads one not_installed row and removes the previous port rows.
Enable the module by adding whatcable to MODULES in .env, then rebuild and redistribute the client package.
Table Schema
One row per USB-C port. A machine with no usable snapshot has a single sentinel row and an empty port_name.
- serial_number - VARCHAR - Client serial number
- tool_status - VARCHAR -
ok,not_installed, orerror - tool_version - VARCHAR - Output of
whatcable --version - is_desktop - BOOLEAN - WhatCable
isDesktopMac - port_name - VARCHAR - Port name, such as
USB-C@1 - connection_active - BOOLEAN - Something is attached
- status - VARCHAR - WhatCable status code
- headline - VARCHAR - Short WhatCable headline
- subtitle - VARCHAR - Second line under the headline
- data_detail - TEXT - Longer data-link explanation
- charging_summary - VARCHAR - Charging status, when WhatCable reports one
- charging_detail - TEXT - Why charging is or is not at full speed
- charging_bottleneck - VARCHAR - WhatCable charging bottleneck code (e.g.
possibleCableLimit) - charging_verdict - VARCHAR -
cable(possible cable limit),other, ornone - charger_rated_w - INTEGER - Charger rating watts when bottleneck is
possibleCableLimit - offered_w - INTEGER - Top offered watts when bottleneck is
possibleCableLimit - adapter_name - VARCHAR - Machine AC/MagSafe adapter name
- adapter_watts - INTEGER - Adapter watts
- adapter_source - VARCHAR - Adapter source (e.g.
AC) - bullets - TEXT - WhatCable detail lines (from
bulletGroupswhen present) - thunderbolt_peer - VARCHAR - Downstream Thunderbolt device and link speed
- live_link - VARCHAR - Thunderbolt controller link speed, or the active USB 3 speed
- cio_raw - TEXT - Unlabeled Thunderbolt controller fields, as key: value
- power_contract - VARCHAR - Negotiated USB-PD contract and offered wattages
- accessory_access - TEXT - Transports macOS is restricting
- tunnels - TEXT - Active Thunderbolt tunnels other than the cable lane
- connected_devices - TEXT - Device names and speeds on the port, including WhatCable's otherUSBDevices tree, without serial numbers
- trust_tier - VARCHAR -
green,amber,red, ornone - cable_emarker - BOOLEAN - An e-marker was read
- cable_speed - VARCHAR - Decoded cable speed
- cable_watts - INTEGER - Cable max watts
- cable_current - VARCHAR - Cable current rating
- cable_vendor - VARCHAR - E-marker vendor name
- cable_type - VARCHAR -
passiveoractive - cable_plug_type - VARCHAR - E-marker plug type (e.g.
Type-C) - cable_type_source - VARCHAR - How passive/active was decided (e.g.
emarker) - cable_certified - BOOLEAN - USB-IF certification present, null when there is no e-marker
- data_bottleneck - VARCHAR - WhatCable data-link code
- data_verdict - VARCHAR -
cable(cable is limiting speed),warning(host limit, degraded link, or e-marker disagrees with the live link),fine,device, ornone - data_summary - VARCHAR - Short data-link summary
- device_kind - VARCHAR - PD partner kind
- device_vendor - VARCHAR - PD partner vendor
- display_name - VARCHAR - First display name on the port
- display_summary - VARCHAR - Display diagnostic summary
- display_detail - TEXT - Longer display diagnostic
- display_bottleneck - VARCHAR - WhatCable display bottleneck code
- display_verdict - VARCHAR -
cable,warning,fine,settings(monitor set below max), ornone - display_mode - VARCHAR - Current mode, e.g.
1920x1080@60 - display_cable_assessment - VARCHAR - Whether the cable is blamed for the display limit
- transports - VARCHAR - Active transports, comma-separated (includes DisplayPort lane text when present)
- error_detail - VARCHAR - Truncated stderr when
tool_statusiserror
The USB device tree behind a port is not stored. The usb module already collects those devices.