core-tui

module
v0.32.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2026 License: Apache-2.0

README

core-tui

CI Go Reference License

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).

Status

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.

Documentation

Install

go get github.com/go-steer/core-tui

Requires Go ≥ 1.23.

Quick start

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 the Notifier capability: 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 an attachclient talking 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-agent and go run ./examples/core-agent -flavor attach.

Contributing

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

License

Apache License 2.0.

Directories

Path Synopsis
examples
core-agent command
Command core-agent is the reference-host adapter sketch (issue #82): what a core-agent-shaped host writes to satisfy core-tui's plug-in surface, in the two flavors requirements.md I-CORE-AGENT names — the local in-process agent, and the `attachclient` flavor talking to a remote agent over HTTP.
Command core-agent is the reference-host adapter sketch (issue #82): what a core-agent-shaped host writes to satisfy core-tui's plug-in surface, in the two flavors requirements.md I-CORE-AGENT names — the local in-process agent, and the `attachclient` flavor talking to a remote agent over HTTP.
core-agent/fakehost
Package fakehost stands in for the parts of github.com/go-steer/core-agent that a host adapter touches: the in-process agent type (`pkg/agent.Agent`, whose Run yields ADK `*session.Event` values), the attach API's HTTP+SSE client (`internal/attachclient.Client`), and a toy daemon to point that client at.
Package fakehost stands in for the parts of github.com/go-steer/core-agent that a host adapter touches: the in-process agent type (`pkg/agent.Agent`, whose Run yields ADK `*session.Event` values), the attach API's HTTP+SSE client (`internal/attachclient.Client`), and a toy daemon to point that client at.
local command
Command local is the visual-preview binary for core-tui.
Command local is the visual-preview binary for core-tui.
notifier-smoke command
Command notifier-smoke is a focused smoke-test binary for the out-of-band Notifier capability (issue #30 / PR #39).
Command notifier-smoke is a focused smoke-test binary for the out-of-band Notifier capability (issue #30 / PR #39).
tui
Package tui is the core-tui Bubble Tea TUI library.
Package tui is the core-tui Bubble Tea TUI library.
testagent
Package testagent provides in-process stand-ins for a real tui.Agent.
Package testagent provides in-process stand-ins for a real tui.Agent.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL