buttons serve runs a local HTTP API that exposes the same press path as the CLI.
127.0.0.1:8080.
Endpoints
| Method | Path | Auth | Purpose |
|---|---|---|---|
GET | /api/health | No | Liveness check. |
GET | /api/buttons | Yes | List buttons. |
GET | /api/buttons/{name} | Yes | Read a button spec. |
POST | /api/buttons/{name}/press | Yes | Press a button. |
GET | /api/buttons/{name}/runs | Yes | Recent run history. |
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.