A command-line tool for controlling Philips Hue lights over your local Wi-Fi network.
- A Philips Hue bridge on your local network
- Rust toolchain (to build from source)
cargo install --path .Run once to connect to your bridge:
hue initThis will:
- Auto-discover the bridge on your network
- Prompt you to press the physical link button on the bridge
- Register the app and save credentials to
~/.config/hue-cli/config.json
If auto-discovery fails, provide the bridge IP manually:
hue init --bridge-ip 192.168.1.100You only need to do this once. The credentials are stored permanently and reused for every subsequent command.
hue groupsShows all rooms configured in your Hue app. Use these names with the other commands.
hue dim "living room" 80 # set to 80%
hue dim "living room" 0 # turn off
hue dim "living room" 100 # full brightnessLevel is a percentage from 0 to 100. Setting 0 turns the lights off.
hue rgb "living room" 255 128 0 # warm orange
hue rgb "living room" 0 0 255 # blue
hue rgb "living room" 255 255 255 # whiteValues are standard RGB, 0–255 per channel. The tool converts to the CIE xy color space the Hue API requires.
hue warm "living room" 370 # warm white
hue warm "living room" 153 # cool daylight
hue warm "living room" 500 # candlelightSets the color temperature in mirek (153–500). Use this instead of rgb when you want white light — it drives the bulb's dedicated white LED element, which produces better results than an RGB approximation.
| Feel | Mirek |
|---|---|
| Daylight | 153 |
| Neutral white | 250 |
| Warm white | 370 |
| Candlelight | 500 |
hue on "living room"
hue off "living room"Presets let you save a named lighting configuration and apply it with a single command.
Save a preset (creates or replaces):
hue preset save partymode --group "living room" --dim 60 --rgb 255,0,128At least one of --dim, --rgb, or --mirek must be provided.
Add more rooms to an existing preset:
hue preset add partymode --group "kitchen" --dim 40 --rgb 200,0,100
hue preset add evening --group "bedroom" --dim 30 --mirek 400Apply a preset:
hue preset apply partymodeList all presets:
hue preset listInspect a preset:
hue preset show partymodeDelete a preset:
hue preset delete partymode- Room names are case-insensitive —
"Living Room"and"living room"both work. - The tool uses the Hue API v2 over HTTPS. The bridge uses a self-signed certificate, which the tool accepts automatically.
- Credentials are stored in plain text at
~/.config/hue-cli/config.json. Anyone on your Wi-Fi network can control your lights, and access to that file gives them a ready-made API key to do so.