Skip to content

lucidust/wnlctl

Repository files navigation

wnlctl

wnlctl is a small Windows 11 Night Light CLI for schedule-preserving state control.

wnlctl on, wnlctl off, and wnlctl toggle preserve the configured Night Light schedule and only force the current state.

Features

  • Turn Windows Night Light on or off without disabling the configured schedule
  • Toggle Night Light from scripts or keyboard shortcut wrappers
  • Print plain on / off output for simple shell integration
  • Print JSON output for scripts and other automation

Install

With Scoop:

scoop bucket add lucidust https://github.com/lucidust/scoop-bucket
scoop install wnlctl

Or download wnlctl-windows-x64.zip from the latest GitHub Release, extract it, and place wnlctl.exe somewhere on your PATH.

To verify the downloaded archive, compare its SHA256 hash with the published .sha256 file:

Get-FileHash .\wnlctl-windows-x64.zip -Algorithm SHA256

Commands

wnlctl status
wnlctl status --json
wnlctl on
wnlctl off
wnlctl toggle
wnlctl toggle --json
wnlctl diagnose
wnlctl diagnose --json

Plain output is on or off.

  • status reads the current Night Light state and settings.
  • on writes the Night Light state value and preserves the schedule.
  • off writes the Night Light state value and preserves the schedule.
  • toggle switches the current state and preserves the schedule.
  • diagnose reads additional Night Light diagnostic details without changing any settings.

JSON Output

Use --json for scripts, automation, status bars, and other integrations:

wnlctl status --json

Example output:

{"enabled":false,"scheduleMode":"sunset-to-sunrise","colorTemperatureKelvin":4751,"scheduleStart":"21:00","scheduleEnd":"05:00","sunsetTime":"00:00","sunriseTime":"00:00"}

diagnose --json prints a larger read-only snapshot intended for issue reports and troubleshooting. It includes the default Night Light CloudStore state, per-device Night Light CloudStore entries when present, and basic Windows build information.

Diagnostics

Use diagnose when the visible Night Light tint does not match status, or when reporting behavior that may depend on Windows build, HDR, display color management, or per-device Night Light state:

wnlctl diagnose
wnlctl diagnose --json

The command does not attempt to repair Windows state. It only reads the current user's default and per-device Night Light CloudStore values so that registry state can be compared with what is visible on screen.

Limitations

Windows does not expose a stable public Night Light management API. wnlctl uses Windows CloudStore registry data, so behavior should be verified when using it on a Windows version that has not been tested before.

wnlctl currently supports Windows 11 only. It has been tested by the maintainer on Windows 11 24H2 (OS Build 26100.8246). Windows 10 and other Windows versions have not been tested.

Privacy

wnlctl has no networking code. Runtime access is limited to the current user's Windows registry values for Night Light state and settings:

  • HKCU\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\DefaultAccount\Current\default$windows.data.bluelightreduction.bluelightreductionstate\windows.data.bluelightreduction.bluelightreductionstate
  • HKCU\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\DefaultAccount\Current\default$windows.data.bluelightreduction.settings\windows.data.bluelightreduction.settings

The diagnose command also reads matching per-device Night Light CloudStore values under the same Current store when Windows has created them, plus basic Windows version values from:

  • HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion

Windows itself may sync Night Light settings through Windows Backup or Enterprise State Roaming when those OS features are enabled.

Build

cargo build --release

The binary will be written to:

target\release\wnlctl.exe

Provenance

The registry parsing and serialization code is vendored from kvnxiao/win-nightlight-cli at commit 7a94ef98ee83d287241d46485b48490a48ac16ee.

The upstream project also provides a CLI command named wnl. This project uses the separate wnlctl name to avoid command-name overlap while keeping the tool's purpose explicit. See THIRD_PARTY_NOTICES.md for attribution details.