api-websocket supports:
callhistoryreportreport-from-cmd
Default command behavior:
- bare positional request path is treated as
call.
0: success1: operational/validation failure3: history file exists but contains no records (history)
call(text mode): stdout prints the last received message.history(text mode): stdout prints selected history records.report/report-from-cmd: stdout prints generated report path.- stderr is used for human-readable diagnostics in text mode.
- Explicit only:
--format json - Supported commands:
call,history - Human-readable mode remains default.
Guideline reference:
docs/specs/cli-service-json-contract-guideline-v1.md
{
"schema_version": "cli.api-websocket.call.v1",
"command": "api-websocket call",
"ok": true,
"result": {
"target": "ws://127.0.0.1:9001/ws",
"last_received": "{\"ok\":true}",
"transcript": []
}
}{
"schema_version": "cli.api-websocket.call.v1",
"command": "api-websocket call",
"ok": false,
"error": {
"code": "request_not_found",
"message": "Request file not found: ..."
}
}{
"schema_version": "cli.api-websocket.history.v1",
"command": "api-websocket history",
"ok": true,
"result": {
"history_file": ".../.ws_history",
"count": 1,
"records": ["..."]
}
}{
"schema_version": "cli.api-websocket.history.v1",
"command": "api-websocket history",
"ok": false,
"error": {
"code": "history_not_found",
"message": "History file not found: ..."
}
}request_not_foundrequest_parse_errorsetup_resolve_errorendpoint_resolve_errorauth_resolve_errorjwt_validation_errorwebsocket_execute_errorexpectation_failed
history_resolve_errorhistory_not_foundhistory_read_errorhistory_empty
- JSON output must not include bearer token material.
- Tokens are never emitted in
resultpayloads. - history command snippets mask token values (
REDACTED) in suite artifacts.