buttons serve runs a local HTTP API that exposes the same press path as the CLI.
127.0.0.1:8080.
Endpoints
Press a button
Auth
Every endpoint except/api/health requires a bearer token when an API key is configured.
The key comes from the first available source:
--api-keyAPI_KEYbatteryBUTTONS_API_KEYenvironment variable
Binding rules
Without an API key,buttons serve only allows loopback binding. Binding 0.0.0.0 without auth is refused.
HTTP buttons are gated
Pressing HTTP buttons through the REST API is disabled by default because an exposed API can otherwise trigger outbound requests. Enable it explicitly:Trigger engine
buttons serve also runs the in-process button trigger engine and mounts webhook trigger routes alongside the API. Button triggers (buttons trigger add) fire here:
crontriggers run on their schedule.watchtriggers poll their watched file (mtime/size, 500ms).webhooktriggers mount aPOST <path>route on the same listener, gated by the optional shared--token(X-Buttons-Tokenheader or?token=).
buttons webhook listen.