ui/theme package. It defines a semantic palette (colors named by role, not by hue), detects the terminal’s color capability, and ships 11 ready-made themes (dark, light + 9 community palettes) that re-skin the entire UI — chat, /coder and /agent cards, borders, markdown, code blocks, and spinners — with no restart.
The theme is process-global state. Switching applies on the next render, no restart needed. Unlike
CHATCLI_CODER_UI (the timeline style), which the renderer re-reads from the environment on every call.Switch themes at runtime
/config ui) shows the active theme, the source of the value (environment variable vs. default), the detected color profile, and the list of themes with the active one marked by →.
Available themes
There are 11 themes in total. Each strip shows the name and the palette’s real colors, in the order model · accent (reasoning) · ok · warn · error:dark and light are ChatCLI’s calibrated variants; the other nine are adaptations of the classic community palettes mapped onto ChatCLI’s semantic roles (same structure, different colors). All of them degrade to 256 and 16 colors while keeping the roles distinguishable.Colorize and the ansiColorToLip converter route through the active theme — there’s no call-site churn.
Semantic palette
Colors are named by the role they serve, not by hue. That’s what makes swapping the whole theme a matter of touching only the palette:| Group | Field | Use |
|---|---|---|
| Brand/Hierarchy | Primary | model name, primary actions |
Secondary | multi-agent, batch, secondary badges | |
Accent | reasoning / cognitive emphasis | |
Muted | neutral borders, secondary text, defaults | |
| Semantic state | Success | tool success, enabled |
Warning | warnings, disabled | |
Danger | errors, tool failure | |
Info | notes / explanations | |
| Structural | Border | default card border |
Text / TextStrong | body text / bold and headings | |
Background | code-block background |
Themed markdown
Markdown is rendered by glamour with aStyleConfig derived from the palette (replacing the legacy glamour.WithStandardStyle("dark")), so markdown and code-block colors share the UI’s hues. Syntax highlighting via chroma and a language chip above each code block. The document is rendered whole (not block by block), so reference links, footnotes, and paragraph spacing all resolve correctly.
Color profile and graceful degradation
ChatCLI detects the terminal’s capability and degrades gracefully. In pipes, CI, ordumb terminals, output becomes clean plain text with no color codes.
| Profile | Meaning |
|---|---|
TrueColor | 24-bit terminal |
ANSI256 | 8-bit (256-color) terminal |
ANSI | classic 16-color terminal (SGR 30–37 / 90–97) |
ASCII | no color — NO_COLOR, dumb, pipe/redirect |
NO_COLOR, CLICOLOR_FORCE, TERM, COLORTERM). The dark theme keeps the ANSI16 = 10 index for green, so 16-color terminals are identical to legacy behavior.
Persistence
A runtime switch applies only to the current process. To pin a default across sessions, add to your.env:
.env on its own. See CHATCLI_THEME in the environment-variable reference.
Parallel change in v1.125: the chat reply envelope gained a footer with per-turn cost and context usage, and spinners were unified into a single themed braille spinner, shown only when a terminal is present.