Skip to main content

Protocol

StdUI communicates with the controlling application via stdin/stdout using line-delimited JSON. Every message is a single line of JSON terminated by a newline character.

Message Format

{
"action": "action_type",
"data": {
/* optional data payload */
}
}
FieldTypeDescription
actionstring, requiredThe type of action being sent
dataany, optionalAction-specific payload (object, string, or array)

Action names use kebab-case (e.g. update-content, window-closed).

Minimal round-trip

App → stdui   {"action":"settings","data":{"title":"Hello","windowWidth":400,"windowHeight":300}}
stdui → App {"action":"ready"}
App → stdui {"action":"update-content","data":"<h1>Hi</h1><ui-button text=\"Click me\" action=\"hi\"></ui-button>"}
... user clicks the button ...
stdui → App {"action":"button-clicked","data":{"action":"hi","text":"Click me","pane":"main"}}
App → stdui {"action":"update-content","data":"<h1>You clicked it!</h1>"}
... user closes the window ...
stdui → App {"action":"window-closed"}

Sections