CtrlK
BlogDocsLog inGet started
Tessl Logo

jbaruch/tui4j-chat

Build terminal chat UIs with TUI4J - Elm Architecture chat client for AI agent demos with Spring Boot integration

90

1.38x
Quality

90%

Does it follow best practices?

Impact

94%

1.38x

Average score across 3 eval scenarios

SecuritybySnyk

Advisory

Suggest reviewing before use

Overview
Quality
Evals
Security
Files

style-defaults.mdrules/

TUI4J Style Defaults

When building TUI4J chat interfaces, use these exact styling defaults. Do not substitute alternative values unless the user explicitly requests different ones.

Color Codes

RoleANSI CodeColor
User messagesColor.color("12")Blue
Agent/response messagesColor.color("10")Green
Status/dim textColor.color("8")Gray

Textarea Configuration

PropertyValue
Placeholder"Send a message..." or "Ask your agent..."
Prompt character"┃ " (box-drawing vertical bar + space)
Char limit500
Width70
Height3
Show line numbersfalse

View Composition Order

The view() method MUST render in this order:

  1. viewport.view() (message history, top)
  2. Status line (waiting indicator, middle)
  3. textarea.view() (input, bottom)

Separated by newlines.

Program Launch

Always use .withAltScreen() for full-screen chat UIs:

new Program(model).withAltScreen().run();

Initialization Order

NEVER call Style.render() in the constructor. The terminal is not initialized until Program.run() executes. Creating Style objects as fields is safe. Calling .render() is only safe inside init(), update(), or view().

Violating this causes NullPointerException on TerminalInfoProvider.provide().

tile.json