ui/theme package. It defines a semantic palette (colors named by role, not by hue), detects the terminal’s color capability, and ships 12 ready-made themes (dark, light, grafite + 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 14 themes in total. Each strip shows the name and the palette’s real colors, in the order model · accent (reasoning) · ok · warn · error:dark, light, grafite, onyx and onyx-light are ChatCLI’s own 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.onyx and onyx-light also change the glyphs. They render with plain one-cell glyphs instead of colored emoji: an emoji that carries a meaning becomes its glyph (❌ → ✗, ✅ → ✓, ⚠ → ▲, ⏳ → ↻) and one that only decorates a heading is dropped. The other themes keep their emoji.Colorize and the ansiColorToLip converter route through the active theme — there’s no call-site churn.
The flat turn in onyx
In onyx and onyx-light a coder or agent turn is drawn as one timeline instead of framed cards: one aligned line per tool call, with a state glyph on the left and the duration, exit code and size on the right, and the result under a thin rail.
↻running,✓done,✗failed,⊘did not run — with the reason spelled out:denied(you said no),blocked(policy or a hook),skipped(an earlier step failed),canceled,parked.- On an interactive terminal the line of a running call is updated in place when it finishes. When output is piped, in one-shot mode, and over ACP or the web, the same final lines are printed without the transient one.
- The three
CHATCLI_CODER_UIstyles still apply:compactshows the line only,minimaladds the first row of the result,fullthe result. - Squad dispatches, retries, compaction, background-job and park notices use the same compact form.
~, and is replaced by the provider’s real usage when the call ends; cost is only ever computed from real usage. The estimate moves where the reply text arrives as a stream (today the Anthropic OAuth login and the OpenAI ChatGPT backend); with the other providers the figure advances once per model call.
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:The input line and the completion dropdown
The REPL prompt is drawn bygo-prompt, which owns its own render loop and never sees the ANSI strings the rest of the UI builds. Until v1.199 its colors were literals — the text you typed was hardcoded to white — so a light theme on a light terminal printed white on white. Every one of those colors now comes from the active palette:
Ink is always chosen against the fill it lands on, never against the terminal —
Background is the theme’s own ground, so it is the readable ink on a saturated row under a dark and a light palette.
go-prompt copies these onto its renderer when the prompt is built and never re-reads them, so /config ui theme rebuilds the prompt on the spot. That is the one surface where a theme switch does more than wait for the next render.Legibility contract
Every built-in palette is held to a machine-checked floor, so “opinionated about hue” never becomes “unreadable”:- Body text (
Text,TextStrong) clears 4.5:1 against the theme’s own ground;Muted— secondary text — clears 3:1. - On a 16-color terminal a light palette never reaches into the bright range (9–15, which is painted for a dark ground), and a dark palette never uses index 0.
- Each dropdown fill/ink pair clears 3:1 and never collapses onto the same 16-color index.
Border is deliberately exempt from the contrast floor: Nord, Solarized, Catppuccin and One Dark all define their border tone as a near-ground fill on purpose, and raising it would replace the palette’s identity with ours.
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.
Detection honors the usual signals (
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.
The startup banner uses the profile too. On a truecolor terminal its block letters are painted column by column with a left-to-right gradient: coral through orange to amber on the dark and light themes, and from the theme’s Primary to its Secondary on every other theme. A 256-color terminal gets the nearest palette entry per column. A 16-color terminal, NO_COLOR and piped output keep the single-color banner.
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.