Battery is a macOS CLI and menu bar application that limits the battery charge to 80% to extend battery life. It is available via brew install battery.
CLI
brew install battery