The same battery engine in your terminal.
Get a readable snapshot, stream changing values, feed JSON into scripts, or export Pro history without opening the menu bar app.
Run one command. Get the important facts.
The CLI and app share the same battery readers and formatting. The default output is designed for humans; --json exposes structured data for scripts.
- Battery health, with the raw capacities on a Pro licence
- Charge state and cycles
- Temperature, voltage, current, and live power
- Model and charger context
The example below shows the output with a Pro licence. Without one, the Health line is the percentage on its own. Current is the battery gauge's own reading, so it will not always multiply out against Power, which is measured on the system's live power rail.
Model MacBook Pro (14-inch, M5)
Health 99.6% (6,225 / 6,249 mAh)
Charge 100%, fully charged
Cycles 42 (design 1000)
Temperature 30.4°C
Power 0.0 W (100W PD charger)
Voltage 13.21 V
Current +0.00 A (gauge)
Readable, structured, or live.
whatbattery # readable battery summary
whatbattery --json # structured JSON
whatbattery --watch # refresh as values change
whatbattery --accessories # connected accessory levels
whatbattery --idevice # iPhone/iPad reading (Pro)
whatbattery --version
whatbattery --help
Pro commands
whatbattery --report
whatbattery --export csv --range month
whatbattery --export json --range all --out history.json
whatbattery --activate XXXX-XXXX-XXXX-XXXX
whatbattery --licence
whatbattery --deactivate
Install the CLI
Homebrew installs the menu bar app and symlinks the bundled command into your PATH:
brew install --cask darrylmorley/whatbattery/whatbatteryIf you installed the app manually, the binary is inside WhatBattery.app/Contents/Helpers/whatbattery.
Automation examples
Extract the current health with jq:
whatbattery --json | jq '.healthPercent'Keep a live view while testing chargers:
whatbattery --watchInstall the app and CLI together.
The Homebrew cask gives you both and keeps upgrades simple.