Install WhatCable as a command-line tool on its own
What's new
-
A CLI-only Homebrew install. If you don't want a menu bar app sitting in the corner, you can now install just the
whatcablecommand-line tool:brew install darrylmorley/whatcable/whatcable-cliSame signed and notarised binary as the one shipped inside the .app, just packaged on its own. Useful if you want to script around the JSON output, run
whatcable --watchin a terminal pane, or just don't have a use for the menu bar UI.The full menu bar app is unchanged:
brew install --cask whatcable. Pick one. Thanks to @Chamiu for the suggestion (#188). -
The CLI now errors on unknown flags and ambiguous combinations.
whatcable --watch --typoused to ignore the typo silently; it now errors with a clear message and exits non-zero. Running two subcommands at once (which the CLI couldn't honestly run together anyway) is rejected with the matched flag names. Smaller cliff for scripting.
Pro from the command line
If you buy Pro and install the CLI on its own, the activation lifecycle now lives on the command line. Same applies if you prefer managing your licence from the terminal rather than the menu bar app's Settings:
whatcable --activate XXXX-XXXX-XXXX-XXXX
whatcable --licence
whatcable --deactivate
whatcable --pro
Existing Pro users on the menu bar app don't need to do anything. Your licence and unlock state carry across the upgrade; the new commands just become available on the whatcable binary you already had.
Activations sync between the CLI and the menu bar app (they share the same store), so activating from one unlocks Pro in the other on the same Mac. If WhatCable.app is running when you activate from the CLI, quit and reopen it to pick up the change.
There's also a one-line footer the CLI prints under its normal output for unlicensed users that points at whatcable --pro. It's there because Pro pays the bills and the CLI-only install has nowhere else to mention it. Suppressed automatically when output is piped, redirected, or used with --json. Run whatcable --silence-pro-hints to hide it; whatcable --show-pro-hints to bring it back.
Under the hood
- The CLI-only install puts the binary and its bundled resources (cable database, USB-IF vendor list) in
libexec/, with a small shell wrapper atbin/whatcable. This was the layoutBundle.moduleneeded to find its resources outside the .app. - The standalone CLI zip is notarised separately from the .app. Stapling isn't possible for bare binaries, so Gatekeeper does an online check on first launch.
Install
brew upgrade --cask whatcable to get the menu bar app as usual, or brew install darrylmorley/whatcable/whatcable-cli for the CLI on its own. Both can coexist, but they ship the same whatcable binary, so running one is normally enough.
Existing menu bar users see no behaviour change.