A minimal terminal user interface for the AI Hydra simulation system built with Textual.
Install the TUI dependencies:
pip install -e .[tui]
Start the TUI client (assumes server is running on localhost:5555):
ai-hydra-tui
Connect to a different server:
ai-hydra-tui --server tcp://192.168.1.100:5555
Enable detailed logging:
ai-hydra-tui --verbose
You can also run it as a Python module:
python -m ai_hydra.tui.client --server tcp://localhost:5555
┌─────────────────────────────────────────────────────────────┐
│ AI Hydra - Snake Game AI Monitor │
├─────────────────┬───────────────────────────┬───────────────┤
│ Control │ │ Status │
│ Panel │ Game Board │ Panel │
│ │ │ │
│ [Start] [Stop] │ ████████████████ │ State: Running│
│ [Pause][Resume] │ █▓▓▓▓▓▓▓▓▓▓▓▓▓█ │ Score: 42 │
│ [Reset] │ █▓░░░░░░░░░░░░▓█ │ Moves: 156 │
│ │ █▓░░░●░░░░░░░▓█ │ Length: 8 │
│ Grid: 20,20 │ █▓░░░░░░░░░░░▓█ │ Runtime: 2:34 │
│ Budget: 100 │ █▓░░░░░░░░░░░▓█ │ │
│ │ █▓▓▓▓▓▓▓▓▓▓▓▓▓█ │ │
│ │ ████████████████ │ │
├─────────────────┴───────────────────────────┴───────────────┤
│ Messages │
│ [12:34:56] Connected to server at tcp://localhost:5555 │
│ [12:34:57] Simulation started │
│ [12:34:58] Score increased to 42 │
└─────────────────────────────────────────────────────────────┘
Ctrl+C or q: Quit the applicationTab: Navigate between UI elementsEnter: Activate buttonsArrow Keys: Navigate in input fieldsThe TUI client communicates with the AI Hydra server using ZeroMQ:
ping: Test server connectivitystart_simulation: Start simulation with configurationstop_simulation: Stop current simulationpause_simulation: Pause running simulationresume_simulation: Resume paused simulationreset_simulation: Reset simulation stateget_status: Get current simulation statusheartbeat: Maintain connectionThe TUI client follows a reactive architecture:
To add new features:
HydraClient classcompose() methodprocess_status_update()hydra_client.tcssIf you can’t connect to the server:
ai-hydra-serverai-hydra-tui --verboseIf the interface looks wrong:
If the interface is slow:
Planned features for future versions:
To contribute to the TUI client:
GPL-3.0 - See the main project LICENSE file for details.