For limiting a MacBook battery's charge in order to prolong its life I find bclm a lot more straightforward than AlDente.
sudo bclm write 81 keeps the hardware battery percentage at 80% on both my MacBooks (I haven't found a reason to use persist, yet).
I would often set the bclm to 100 for a full charge before heading to a coffee shop. With this script I don't have to remember to reset it.
I include it in a script that does other undocking stuff, like making sure Dropbox syncs while it's charging and making sure the VPN is connected.
Thanks to a tip from this very informative gist, I now have passwordless sudo set up.
sudo visudo
..opens /etc/sudoers in vim. I added this to the bottom:
[my username] ALL=(ALL) NOPASSWD: /usr/local/bin/bclm
Now sudo bclm (as well as bclm-cc) no longer requires a password.