A reusable Bubble Tea TUI
for agentic assistants. core-tui owns the operator-facing surface — chat
loop, slash commands, command palette, @file expansion, permissions
modal, MCP elicitation, transcript persistence — and integrates with any
agent via a small Go interface.
It is intentionally agent-framework agnostic: nothing in package tui
imports an LLM SDK, an MCP SDK, or an agent runtime. Hosts adapt their
own agent types to the interface in
docs/design.md §3 and call tui.Run(ctx, opts).
Latest release: v0.9.1. Pre-1.0 — public API is largely stable but minor breaking changes can ship in 0.X minor bumps; see the release notes for what's in each version.
The reference host is
go-steer/core-agent, which
tracks the latest release and exercises the full capability surface:
theme picker, Notifier side channel, SSE push-mode subscriber, and
the v2 transcript schema.
- Requirements — user-visible behavior the library must deliver.
- Design — module layout, the plug-in surface, lifecycle, test strategy.
- Style — visual house style (palette, glyphs, spacing, modal composition).
- Decisions — every load-bearing choice with rationale + rejected alternatives.
- API audit — every exported symbol with its doc comment, the commit and release that introduced it, and whether it is part of the contract; decision material for the 1.0 freeze.
- UI references — observations from other agentic TUIs (Antigravity, Claude Code, Codex, Crush, Cursor).
- Migration guide — adapter contract + per-host capability mapping (cogo, core-agent local + attach) + sketches.
- Site — https://go-steer.github.io/core-tui/ (published once the first commit lands).
go get github.com/go-steer/core-tuiRequires Go ≥ 1.23.
A host implements the tui.Agent interface and calls tui.Run:
package main
import (
"context"
"github.com/go-steer/core-tui/tui"
)
func main() {
ctx := context.Background()
if err := tui.Run(ctx, tui.Options{
Agent: myAgent{}, // implements tui.Agent
// Optional: any capability interfaces the host wants to light up
// — ModelSwapper, Reloader, PermissionController, SlashProvider, …
}); err != nil {
panic(err)
}
}See docs/design.md §3 for the full interface set
and §6 for the host-adapter recipe. Worked examples live under
examples/:
examples/local— visual-preview binary running against a scripted test agent; exercises every renderer path (chat, tool calls, slash palette, modal forms, theme picker, status surfaces).examples/notifier-smoke— standalone harness for theNotifiercapability: a producer goroutine pushes realistic notices on a rotation (plus a periodic burst to demonstrate the drop-with-coalescence backpressure marker).examples/core-agent— the reference-host adapter sketch, in the two flavors a real host ships: an in-process agent, and anattachclienttalking to a remote agent over HTTP + SSE. Written against a local stand-in for core-agent's types (no dependency on that module), so it doubles as the compile-time canary on the plug-in surface. Start here if you are wiring your own host:go run ./examples/core-agentandgo run ./examples/core-agent -flavor attach.
See CONTRIBUTING.md for the development workflow,
DCO sign-off requirement, and the no-Co-Authored-By policy. Local CI
is one command:
dev/tools/ci