A simple, low-dependency Bash script for controlling Elgato Key Lights over the network using their HTTP API.
klc is a CLI tool for discovering, querying, and controlling Elgato Key Lights using their
native HTTP interface. It supports toggling the light, adjusting brightness, and setting the color
temperature β all without requiring any heavy frameworks or package managers.
Elgato Key Lights expose an unauthenticated HTTP API (see here), and many tools already exist to interact with them.
However:
- One tool I tried offered a GUI but outright refused to work.
- Another was written in Go and brought in a full framework just to send a few HTTP requests β the logic was completely obscured.
- A Python tool required a
pip installand came with a handful of dependencies. - A seemingly promising Bash project prioritized output formatters (JSON, XML, YAML, ...) over actually turning the light on.
So I wrote my own β just a clean Bash script with:
- β
No dependencies beyond
avahi-browse,curl, andjq - β No installers, no GUIs, no package managers
- β Clear, readable logic
- π΅οΈββοΈ Auto-discovers the first available Elgato Key Light on the network via
avahi - π§ Caches the discovered IP for faster reuse on subsequent calls
- π‘ Turns light on/off
- π Adjusts brightness (
NUM,increase,decrease,min,max) - π‘οΈ Adjusts temperature in either Mired or Kelvin units
- β‘ Accepts abbreviated commands (e.g.
br,temp,inc,dec)
$ klc on
$ klc off
$ klc status
$
$ klc brightness 75 # brightness to 75%
$ klc brightness increase
$ klc brightness decrease
$ klc brightness min
$ klc brightness max
$
$ klc temperature 5000 # Kelvin input
$ klc temperature 200 # Mired input
$ klc temperature increase
$ klc temperature decrease
$ klc temperature min
$ klc temperature maxYou can abbreviate most commands:
status:s,stbrightness:b,br,brighttemperature:t,te,tempincrease:i,incdecrease:d,dec
- π§ The script always uses the first discovered device via Avahi.
- ποΈ Temperature values can be entered as Kelvin or Mired. Conversion rounding is approximate but visually negligible.
- β Only one command can be executed per call (e.g., you can't change brightness and temperature at once).
bashavahi-browse(for discovery)curl(for HTTP requests)jq(for parsing JSON)
All are commonly available on modern Linux distributions and macOS with Homebrew.
Just clone or copy the script. No build, no install, no hassle.
$ chmod +x klc
$ ./klc onFor better calling convenience, you may choose to append the script's location to your PATH or copy it into your executables directory:
$ PATH=$(readlink -f .):$PATH # Option 1: temporary (for this shell session only)
$ cp klc ~/.local/bin # Option 2: permanent (path may be different on your system)
$ sudo cp klc /usr/bin # Option 3: permanent, system-wide (if you really want to)Contributions are welcome.
MIT β Do what you want, but don't blame me if your lights go disco mode. π