How to Run The `sudo` Command in KM?

Apologies, @noisneil -- the proper way to do it these days is to add a file into /private/etc/sudoers.d/ (and I always forget that...). It's often done on a file-per-command basis, so:

In Terminal, type whoami and note your short username -- you can select and Copy it if you want. Then sudo visudo /private/etc/sudoers.d/pmset and enter your password if asked.

Terminal window will be empty except for a bunch of ~ down the left. So, with the cursor at the top, hit i to enter "Insert" mode. Type or paste in your short username, a space to tab, then ALL=NOPASSWD: /usr/bin/pmset (autocorrected path mistake corrected). Hit ESC to exit "Insert" mode and then :wq and Return to write-and-quit.