bclm
Set a custom charge limit on MacBooks. tldr-pages
On macOS
macOS
Set the charge limit to about 80% (for Intel machines, the battery charge level may be slightly lower than the set value)
sudo bclm write 77IdentifyRead the current charge limit
bclm readIdentifyKeep the charge limit after rebooting/smc reset
sudo bclm persistIdentifyRemove the persistent charge limit
sudo bclm unpersistIdentify