tui

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: MIT Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tui is the router panel: a Bubble Tea program over the control socket with tabs Now, Routes, Policy, Classifier and Usage, modelled on the claude-model-router 1.13.0 /router pane. Render is pure so docs images can be produced from fixture snapshots.

Index

Constants

This section is empty.

Variables

Presets lists the policy presets in cycling order.

Tabs lists the tabs in display order.

Functions

func Render

func Render(s route.Snapshot, tab Tab, width int) string

Render draws the panel for a snapshot with ANSI colors. Output depends only on its arguments.

func RenderPlain

func RenderPlain(s route.Snapshot, tab Tab, width int) string

RenderPlain draws the same panel without ANSI escapes.

func Run

func Run(ctx context.Context, o Options) error

Run shows the panel until the user quits or ctx ends. It redials the control socket when it is lost.

Types

type Options

type Options struct {
	Socket string
	Locate func() (string, error)
}

Options configure Run. Locate, when set, finds the socket again before every dial, so a panel follows a restarted session instead of redialing the dead one's socket.

type Tab

type Tab string

Tab is one panel tab, in key order 1-5.

const (
	TabNow        Tab = "now"
	TabRoutes     Tab = "routes"
	TabPolicy     Tab = "policy"
	TabClassifier Tab = "classifier"
	TabUsage      Tab = "usage"
)

Jump to

Keyboard shortcuts

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