How to reliably determine battery health from terminal?

You can snoop the script from [root tip] [Utility Script] Charger Notifier - battery state to get an idea.

If by battery health you mean compared to factory state you can use upower

upower -i /org/freedesktop/UPower/devices/battery_BAT0

Look at the battery properties

Example

 $ upower -i /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          BAT0
  vendor:               Sunwoda
  model:                5B11M90050
  serial:               823
  power supply:         yes
  updated:              2025-03-09T10:41:44 CET (17 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               discharging
    warning-level:       none
    energy:              20,05 Wh
    energy-empty:        0 Wh
    energy-full:         51,63 Wh
    energy-full-design:  54,7 Wh
    energy-rate:         6,511 W
    voltage:             15,074 V
    charge-cycles:       43
    time to empty:       3,1 hours
    percentage:          38%
    capacity:            94,3876%
    technology:          lithium-polymer
    charge-start-threshold:        75%
    charge-end-threshold:          80%
    charge-threshold-supported:    yes
    icon-name:          'battery-good-symbolic'
  History (charge):
    1741513274  38,000  discharging
  History (rate):
    1741513304  6,511   discharging
    1741513274  6,536   discharging
    1741513244  7,176   discharging
    1741513214  8,279   discharging