apiari-tui
Shared TUI design system library for the Apiari toolchain, built on ratatui.
Why
Apiari's tools — swarm (agent orchestrator) and apiari (CLI dashboard) — share terminal UIs that display agent conversations, tool calls, and status. apiari-tui extracts the common theme, rendering, and scroll logic so both tools look and behave consistently.
Modules
| Module | Purpose |
|---|---|
theme |
Honey/amber color palette and pre-built ratatui Style helpers |
scroll |
Visual-line-aware scrollable text rendering with auto-scroll |
markdown |
Markdown-to-ratatui renderer (headings, lists, code blocks, tables, links) |
conversation |
Shared conversation types (ConversationEntry) and turn rendering |
events_parser |
Parse agent events.jsonl logs into ConversationEntry items |
Theme
The color palette is built around warm honey and amber tones designed to pop against dark terminal backgrounds:
| Color | Name | Hex | Usage |
|---|---|---|---|
HONEY |
Warm amber | #FFB74D |
Titles, accents, active borders |
GOLD |
Bright gold | #FFD700 |
Selections, input cursor |
NECTAR |
Deep orange | #FF8A3D |
Warnings |
POLLEN |
Soft yellow | #FAE68C |
Inline code, completed status |
WAX |
Dark warm gray | #3C3830 |
Borders, dividers |
COMB |
Darker bg | #282520 |
Highlights background |
SMOKE |
Muted text | #8C877D |
Subtitles, timestamps |
ROYAL |
Purple accent | #A078FF |
Agent labels, merged PRs |
MINT |
Green | #64E6B4 |
Success, running status |
EMBER |
Red | #FF5A5A |
Errors, critical severity |
FROST |
Bright text | #DCDCE1 |
Primary body text |
Pre-built style functions like theme::title(), theme::error(), theme::border_active(), etc. compose these colors with appropriate modifiers (bold, italic) for common UI elements.
Usage
Add to your Cargo.toml:
[]
= "0.1"
Example: applying the theme
use theme;
use ;
let block = default
.title
.title_style
.borders
.border_style;
let paragraph = new
.style
.block;
Example: scrollable content
use ;
use Line;
use Block;
let mut scroll = new; // auto-scrolls to bottom
let lines: = vec!;
// In your render function:
render_scrollable;
// On key events:
scroll.scroll_up; // disables auto-scroll
scroll.scroll_down; // re-enables auto-scroll at offset 0
License
MIT