Command Runner is a small Python web application and a practice project focused on Server-Sent Events (SSE).
It's intended as a learning playground to explore realtime one-way event streams.
Clone this repo and cd into it:
git clone 'https://github.com/max-4-3/command-runner.git'
cd command-runner/Run with uv:
uv run main.pyVisit:
localhost
src/:
Contains the server logicstatic/:
Contains the client logic
Educational only not for real world application
- Experimentation with Server-Sent Events (SSE) in Python
- Learn to structure an ASGI app that emits events and a minimal frontend that consumes them.
- The client subscribes to a text/event-stream endpoint exposed by the server (EventSource in the browser).
- SSE provides a simple, reliable way to stream server events to browsers (one-way from server to client). It's well-suited for notifications, logs, progress updates, and other use cases where the client only needs to receive updates.
- Pay attention to reconnection behavior: EventSource automatically reconnects; you can control retry intervals on the server with the "retry" field if needed.
- If you later need two-way comms, consider adding websockets; for many use cases SSE is simpler and lighter.
- Treat it with extreme caution. It can run command on the server (though it is used for local development but still keep in mind)
