Skip to content
On this page

๐Ÿ“ Scripting and Custom Automation โ€‹

CoolerControl exposes a full REST API that the Desktop and Web UI use to communicate with the daemon. You can use the same API (or the official CLI) to build automations, integrate with other tools, or script routine tasks.

Options at a glance โ€‹

  • The official CLI/TUI: cctv
    • Great for shell scripts, cron/systemd timers, hooks, and quick terminal control.
    • Try cctv --help to see available commands and flags.
  • The HTTP API: OpenAPI Explorer
    • Browse endpoints and schemas, and try requests directly from the browser.
    • Copy ready-made curl or client snippets from the explorer for your language of choice.

TIP

If you need to protect access or use the API remotely, see Access Protection and Headless Servers for guidance on passwords, loopback binding, SSH tunneling, and reverse proxies.

Common cctv examples โ€‹

List available Modes, then activate one:

bash
cctv --list-modes
cctv --activate-mode Quiet

Dump information about the system to stdout as json:

bash
cctv --dump

These commands can be used in any automation context (udev hooks, tuned scripts, cron/systemd timers, etc.). For a more concrete example, see Synchronizing CoolerControl with Power Profiles.

Using the REST API โ€‹

Open the OpenAPI page to discover endpoints, their request/response shapes, and authorization requirements. From there you can:

  • Use the โ€œTry it outโ€ feature to prototype requests against your local daemon.
  • Copy curl examples or language-specific snippets to your codebase.

Notes:

  • The daemon binds to the loopback interface by default. For remote access, prefer SSH tunneling or a TLS reverse proxy.
  • If you enable access protection, supply the appropriate credentials/headers as shown in the OpenAPI explorer.

REST API Code example โ€‹

You can find a minimal Python example in the CoolerControl repository:

You can use this as a starting point to build richer automations and integrations.

Released under the GPLv3+ License.