Workshop TUI¶
The workshop includes an interactive Terminal User Interface (TUI) that lets you browse, run, and inspect all exercises from a single window β no need to type commands manually.
Launching the TUI¶
This opens a full-screen terminal application:
ββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββ
β βΈ 0 β Setup β β
β Connection Test β (exercise README / output shown here) β
β βΈ 1 β LLM Foundationsβ β
β Chat Completion β β
β System Prompts β β
β Structured Outputs β β
β βΈ 2 β Tools & ... β β
β ... β β
ββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββ€
β Enter to run Β· F5 re-run β PASSED β
ββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββ
How It Works¶
| Action | What Happens |
|---|---|
| Arrow keys | Navigate the exercise list on the left β the README is shown on the right |
| Enter | Run the highlighted exercise |
| F5 | Re-run the currently selected exercise |
| q | Quit the TUI |
When you run an exercise:
- The TUI launches the exercise as a subprocess (
python exercises/...) - The right panel shows β³ Running while it executes
- When it finishes, the full output is displayed in the right panel
- A status badge shows β PASSED or β FAILED
Why a TUI?¶
During workshops, participants often struggle with:
- Remembering which exercise to run next
- Typing long file paths correctly
- Losing track of which exercises they've already completed
The TUI solves all of these β it shows the full exercise catalog, runs them with one keypress, and tracks pass/fail status.
Under the Hood¶
The TUI is built with Textual, a modern Python TUI framework. Here's what workshop.py does:
- Exercise catalog β A list of all exercises organized by chapter, defined as a simple Python data structure at the top of the file
- README display β When you highlight an exercise, it reads and renders the corresponding
README.mdfrom the exercise folder - Subprocess execution β Exercises run via
subprocess.run()in a background thread so the UI stays responsive - Output capture β stdout/stderr are captured and displayed as Markdown in the right panel
- Status tracking β Each exercise gets a pass/fail badge that persists while the TUI is open