Skip to main content
Version: 0.15.0

Interface: ChatTuiOptions

Defined in: tui/chatTui.ts:28

Options of the chats (runChatTui(), and runChatInk() through InkChatOptions).

Extended by​

Properties​

PropertyTypeDescriptionDefined in
agentLabel?stringShown once per turn, right before the agent's streamed reply text starts (not before any action lines that precede it) — and, when set, also colors that reply text via ui.agent(). Pass a pre-colored string (e.g. ui.agent("Captain Whiskers>")); omit to keep the plain, unlabeled/uncolored text streaming this kit had before.tui/chatTui.ts:46
exitCommands?readonly string[]Lines (trimmed, case-insensitive) that end the chat.tui/chatTui.ts:48
formatAction?(toolName, input) => stringTurns a tool call into a one-line console label. Defaults to createFriendlyToolLabel() with no domain overrides — pass your own (e.g. createFriendlyToolLabel({ describe, extraLocalServers })) to cover a concrete agent's own domain-specific tools (Playwright's browser_*, etc.).tui/chatTui.ts:35
historyLimit?numberMax entries kept in historyPath (and in the in-session ↑/↓ list). Defaults to 100.tui/chatTui.ts:80
historyPath?stringWhen set, every non-empty line the human submits (including exit commands — a shell's own history keeps those too) is appended here as one JSON object per line ({ text: string, timestamp: string }, ISO 8601), trimmed to the most recent historyLimit entries (oldest dropped first). Loaded back at startup — including across separate runs of the same agent, since this path is normally a fixed file, not one under a per-run timestamped directory — into readline's own history, so ↑/↓ at the prompt cycles through prior prompts. Omit to skip persistence entirely (↑/↓ still works for the current session alone, via readline's own in-memory default).tui/chatTui.ts:78
initialPrompt?stringWhen set, submitted as the very first turn — before the human is ever prompted — exactly as if they'd typed it themselves (mirrored to sessionLogPath/history like any other line). For an agent that should act proactively at the start of a chat (log into a site, load some state) instead of sitting idle at the prompt until the human says something first. Omit for the plain "wait at the prompt" behavior this kit had before.tui/chatTui.ts:57
language?stringThe language of the kit's texts ("en", "es", "fr", "de"). --language=<code> on the command line wins; without either, the one buildSessionOptions() chose from config.language, or else the system's.tui/chatTui.ts:86
modeControl?ModeControlThe session's mode control (buildSessionOptions() returns it): /plan switches into plan mode and back (an autonomous session can't switch), and entering or leaving plan mode is told to the model with the next message. With a session opener, the one it returns is used instead.tui/chatTui.ts:103
promptLabel?stringShown before the cursor at each prompt.tui/chatTui.ts:39
runsDir?stringThe agent's runs folder, with a session opener in place of the options (e.g. (run) => buildSessionOptions(config, run.dir, spec, { run })): each run gets its own folder (<runsDir>/<timestamp>/) keeping its conversation, its session log (session.log, instead of sessionLogPath) and its transcript, and can be resumed: --continue on the command line starts with the latest run, and /resume lists them (date and the human's last message) to switch to one. The runs folder holds the whole conversation, tool results included and not redacted: keep it out of version control.tui/chatTui.ts:96
sessionLogPath?stringWhen set, mirrors everything this loop prints — the welcome message, each prompt line the human types, the agent's streamed reply, action lines, and any error/warning — into this file as it happens (appended, plain text with ANSI color codes stripped), so a session leaves behind an exact, always-present transcript of what the terminal showed even when the agent never calls a single tool (unlike transcriptPath from buildSessionOptions(), which only gets written to on the first tool call). Omit to skip session logging entirely. With runsDir, the run's own session.log is used instead.tui/chatTui.ts:67
theme?Partial<Theme>Colors for the kit's roles (see Theme), on top of the kit's defaults: only the roles given change, e.g. { toolResult: "yellow", selection: "#00ff00" }. One theme per process: without this option, the one already set stays.tui/chatTui.ts:109
welcomeMessage?stringPrinted once before the first prompt, if given.tui/chatTui.ts:37