# ``ParcelIPC`` A local, versioned JSON protocol for the CLI and scripts. ## Connect The app listens on `$TMPDIR/parcel-$UID.sock` with mode `0600`. The CLI accepts an absolute `PARCEL_SOCKET` override; paths must fit the Unix socket limit of 103 UTF-8 bytes. The CLI never launches the app for you. Messages are UTF-8 JSON followed by one newline, with a 1 MiB frame limit. A connection can carry multiple requests. Each request has `v`, `id`, `command`, and `args`; replies echo the ID and include either a result or a structured error. The current protocol version is `1`. ```json {"v":1,"id":"sample","command":"query","args":["windows"]} ``` Use `IPCClient` for request/reply work and `IPCServer` to expose an `IPCCommandHandler`. Transport failures throw; application rejections arrive as error responses. Neither should be mistaken for an empty successful result. ## Commands and events The CLI provides queries, directional commands, layouts, reload, diagnostics, and window explanations. `prcl run` forwards an engine command and its arguments. Put `--json` before the forwarded command; everything after it is passed through unchanged. Window queries and explanations distinguish `frame` (last accepted or observed geometry) from `target_frame` (the requested layout geometry). Diagnostics list suspended screens with a reason and the time that reason began. `subscribe` watches `focus`, `layout`, `workspace`, and `window` topics. Events have no replay, and slow subscribers are disconnected rather than accumulating unbounded work. Treat notifications as a reason to query current state, not as a durable event log. Most commands need a running app. Help, `version`, and `schema` are local; schema output comes from ParcelConfig and does not use this protocol.