584da2d825
Set up the Rust crate, baseline module layout, and project docs so the repository matches the design bundle and builds cleanly as a starting point.
1.4 KiB
1.4 KiB
API.md
tvctl HTTP API Specification
tvctl exposes a loopback-only HTTP API for tool builders at /v1/....
This file captures the v1 surface promised by the design bundle so the
repository has a dedicated API spec from day one.
Base URL
http://127.0.0.1:7272/v1
Response Envelope
Successful responses:
{ "ok": true, "data": { "...": "..." } }
Error responses:
{
"ok": false,
"error": {
"code": "device_not_found",
"message": "No device with id 'living-room' exists.",
"hint": "Run tvctl device list to see known devices."
}
}
Planned Routes
GET /devicesPOST /devices/discoverGET /devices/{id}DELETE /devices/{id}GET /devices/{id}/stateGET /devices/{id}/appsPOST /devices/{id}/apps/launchPOST /devices/{id}/apps/stopPOST /devices/{id}/apps/refreshPOST /devices/{id}/remote/keyPOST /devices/{id}/remote/sequencePOST /devices/{id}/dev/installPOST /devices/{id}/dev/reloadGET /devices/{id}/dev/logsGET /daemon/statusGET /configPATCH /configPOST /config/reload
API Rules
- All routes return the standard JSON envelope.
error.codevalues are stable machine contracts.error.hintis optional but recommended for user-actionable failures.- Devices may be addressed by UUID or friendly name.
- Platform-specific field names must not leak past the adapter layer.