llm-tui is a terminal client for LocalScript, built with Rust, Ratatui, and Crossterm. It renders a generation session as a chat interface and lets you drive the full plan → code → done workflow without writing curl commands.
With the full stack up (see Quick Start):
docker compose run --rm --no-deps -it llm-tuiLocally (requires llm-service running):
cd llm-tui
LLM_SERVICE_URL=http://localhost:8080 cargo runThe TUI connects to the URL in the LLM_SERVICE_URL environment variable (default http://localhost:8080). It sends each user message as a POST /generate request — the first message creates the session, subsequent ones continue it with the returned session_id.
| Key | Action |
|---|---|
Enter |
Submit the current input line. |
Esc / Ctrl+C / Ctrl+Q |
Quit the TUI. |
Backspace |
Delete the last character. |
F3 |
Copy the last generated code to the clipboard and export it to files (see below). |
F4 |
Cancel the in-flight request, or reset the session if idle. |
↑ / ↓ |
Scroll the message history. |
| Paste | Bracketed paste is supported (newlines/tabs are collapsed to spaces). |
- Enter a task. Type your natural-language description and press
Enter. The TUI sends it and, when the plan arrives, displays it and transitions to the awaiting-plan state. - Approve or revise the plan. Send an approval word (e.g.
approve) to move to code generation, or type revision feedback to get an updated plan. - Approve or revise the code. The validated code is shown together with any
sandbox_feedback. Sendподтвердитьto complete the session, or type revision feedback for another iteration. - Done. The session shows the final approved code.
The status bar shows the current session state and whether a request is in flight. Input is disabled while a request is loading.
Pressing F3 (Copy Last Code):
- Copies the latest generated code to the system clipboard (
arboard). - Writes it to:
/app/exports/llm_last_code.lua— the raw Lua source./app/exports/llm_last_code.json— the source wrapped for the LowCode import format:{"result": "lua{...}lua"}with indentation normalized to tabs.
When running under Docker,
./exportson the host is bind-mounted to/app/exportsinside the container, so the files appear in your project'sexports/directory.
The TUI writes structured logs to llm-tui.log in the current working directory (created automatically). The default level is info; override with the RUST_LOG environment variable. Logs include each HTTP request and response shape (task length, plan length, state, etc.), which is useful for debugging a session.