Kaishi is a terminal UI for conversing with Hermes Agent—an AI agent that lives in your terminal. It speaks the Agent Communication Protocol over stdio, rendering streaming markdown as it arrives, token by token.
Built in Rust with ratatui. Syntax highlighting via syntect. No Electron, no web view, no runtime—just a 4MB binary that starts in under 50ms. Named for the paper held beneath cherry blossoms to catch what falls.
Tokens arrive over JSON-RPC and render as they land—thinking spinners, live markdown reflow, tool calls that update in place. No buffering.
Fenced code blocks pass through syntect with the base16-eighties.dark theme. Rust, Python, TOML, YAML—200+ grammars, zero configuration.
Sessions persist across restarts. The picker shows titles, timestamps, and message counts—select one and the full history replays into view.
Type @ to fuzzy-search your project tree. Selected files attach as context—no copy-paste, no leaving the conversation.
Kaishi spawns Hermes as a child process and speaks ACP over stdin/stdout—a JSON-RPC 2.0 wire protocol designed for agent communication. Every tool call, every thinking block, every token delta arrives as a typed event on an async channel. The TUI never blocks.
Rendering is immediate-mode via ratatui—each frame redraws from state, no retained widget tree. A dual-rate tick system drives the UI: fast ticks (50ms) for spinner animation during streaming, slow ticks (500ms) at idle. Markdown is parsed to styled spans at ingestion time and cached; the viewport only renders visible lines.
~5,300 lines of Rust. Eleven source files. Compiles to a 4MB static binary.