Pglet is a language-agnostic UI server which can be run locally, self-hosted in your local network or used as a hosted service.
One of the design goals of Pglet was comfort progress updates from CI/CD workflows, internal tools and scheduled jobs written in Bash and PowerShell, so the protocol had to be simple and fast.
The protocol is text-based and was partially inspired by Redis protocol.
Pglet client is used to establish a communication channel with Pglet service. Client is a part of
pglet.exe on Windows) executable which is automatically downloaded by a client library you use or can be downloaded manually from releases.
- Command pipe - bi-directional pipe for sending command requests and receiving responses.
- Event pipe - read-only pipe with a constant stream of events (click, change, etc.) generated by a user.
Pglet client returns the name/path of command pipe and to get the name of event pipe append
.events to a command pipe name.
Each request to a command pipe represents a single- or multi-line command in the format:
<command> [value_1] [value_2] ... [property_1=value] [property_2=value] ...
For example, command adding a new
Text control to a page:
add text value="Hello, world!"
or adding multiple controls at once to a stack named
add to=footer textbox id=firstName button id=cancel text=Cancel
Properties parsing is quite relaxed. If the value doesn't have spaces you can ommit quotes, for example
text=Hello. Both single and double quotes can be used to enclose the value with spaces, for example:
value="World's best coffee", or
value='"quoted" text'. The following escape symbols are supported:
Successful response has the following format:
For example, the result of
get firstName value command reading the
value property of
firstName textbox might look like:
0 John Smith
If you are reading the value of
multiline=true textbox then the result will look like:
2 First lineSecond lineThird line
2 means "result has 2 more lines".
The response of commands non-returning any values is just
Certain commands may not have a response at all. These are fire-and-forget commands with the names ending on "f":
removef. Fire-and-forget commands are handy when you are quickly doing a lot of control modifications and don't care about the results, for example, updaing progress bar in a loop.
Read event pipe to wait and receive events fired by users interacting with a web page.
Each event message is a single line in the format:
<event_target> <event_name> [event_data]
<event_target> is ID of a control generated the event,
<event_name> is event name, e.g.
[event_data] is optional event data attached to a control with
data property (usually, used with buttons).
For example, a serie of event might look like:
firstName change JohnagreeTOS change trueok clickcancel click...