kurahi api
Call the gateway API through the generated client. The gateway publishes an OpenAPI 3.1 document
at GET /doc; every operation in it, and every WebSocket method, is reachable here.
kurahi api list [--json] # HTTP operations with method, path, auth and scopekurahi api list --ws # WebSocket methods and eventskurahi api <operationId> [-p k=v ...] [-b <json>] [--raw]kurahi api ws <method> [json] [--expect-final]kurahi api discover # what the discovered gateway and credential areOptions
Section titled “Options”-p, --param <k=v>: path, query or header parameter (repeatable).-b, --body <json>: request body as inline JSON,@file, or@-for stdin.--raw: compact JSON output (the default is pretty-printed).--url <url>: gateway base URL (default: discovered fromKOLO_HOME).--timeout <ms>: request timeout.--json: forlist, machine-readable output.--expect-final: forws, wait past an interim{status: "accepted"}answer.
Authentication
Section titled “Authentication”The credential is discovered from KOLO_HOME: the owner token file, else the paired device
credential. No flag takes a token. A credential limited by scope sees the operations its scope
allows; kurahi api list shows the minimum scope of each.
Examples
Section titled “Examples”kurahi api health --rawkurahi api listJobs -p status=runningkurahi api getJob -p id=job_01h...kurahi api runCodeMode -b '{"script":"return await tools.time_now({})"}'kurahi api ws sessions.listExit codes
Section titled “Exit codes”- 0: the operation returned a success status.
- 1: the gateway answered with an error status (including 401 and 403).
- 2: usage (unknown operation, bad parameter, invalid JSON body).
- 3: the gateway was unreachable.