Apple - Can I change the brightness on a secondary display?
On Apple displays, if you press Control-F1 or Control-F2 the brightness on a secondary display will adjust. I have tested this on my MacBook Air 2011 13" and 27" Thunderbolt Display.
Important note: You have to plug in the USB cable from the Display to the Macbook Pro in order that the keyboard shortcuts work.
If you're using a MacBook with Touch Bar, this works for the "brighter"/"less bright" Touch Bar buttons but NOT for the Touch Bar brightness slider.
Lunar is an app which allows you to automatically sync the system display brightness with the brightness of an external monitor.
With Lunar, you can use the standard display controls (and keyboard keys!) to adjust the brightness simultaneously on the main and external display, which is exactly what I wanted. It also supports tweaking of brightness and contrast ranges/offsets to get exactly the desired levels.
Lunar is not restricted to any specific display type or connection method, so it should work with most displays connected over USB-C, Thunberbolt, etc.
One of my favorite tools for doing this is Shades which is "donationware."
You can adjust each monitor separately, and set keyboard shortcuts for them as well.
If you want a command line solution, I found brightness.c which compiled cleanly using:
gcc -std=c99 -o brightness brightness.c -framework IOKit -framework ApplicationServices
It will let you set the brightness for either monitor.
Another tool available at: Command-line display brightness control for macOS or just
brew install screenbrightness.