battery is a macOS utility for analyzing battery properties.
brew tap nickolasburr/pfa brew install battery
battery to your
PATH (e.g. /usr/local/bin):
curl -fsL https://raw.githubusercontent.com/nickolasburr/battery/master/battery > /usr/local/bin/battery
chmod +x /usr/local/bin/battery
--amperage: Show battery amperage (in milliamps).
--is-charging: Show whether battery potential is under capacity and in a power-gain (charging) state.
--is-fully-charged: Show whether battery is at capacity and not in a power-gain (charging) state.
--cycle-count: Show number of completed charge/discharge cycles.
--minutes-until-charged: Show minutes remaining until battery is fully charged.
--minutes-until-discharged: Show minutes remaining until battery is fully discharged.
--is-power-connected: Show whether battery is connected to an external power source (e.g. AC power outlet).
--serial-number: Show battery serial number.
--temperature: Show battery temperature in Fahrenheit, Celsius, and Kelvin.
--voltage: Show battery voltage (in millivolts).
--manufacturer: Show battery manufacturer.
Show battery amperage
battery -A # => 673mA
Show the number of completed charge/discharge cycles
battery -K # => 249
Show minutes until battery is fully discharged
battery -O # => 35
Show if the battery is connected to a power source
battery -P # => false
Show battery serial number
battery -S # => E93VG22TC81H0B1F3
Show battery temperature (in Fahrenheit, Celsius, and Kelvin)
battery -T # => 30.66 °C # 87.18 °F # 303.81 °K
Show battery voltage
battery -V # => 12375mV
Show battery manufacturer
battery -W # => SMP