| type | Package Documentation |
|---|---|
| title | CoreCLI frame — opt-in TUI sub-module |
| description | The Frame live TUI AppShell — an isolated sub-module wrapping bubbletea and lipgloss behind the HLCRF region model, with focus navigation and ready-made components |
| repo | core/cli |
| module | dappco.re/go/cli/frame |
Frame is a live compositional AppShell for TUIs. It lives in its own Go module (dappco.re/go/cli/frame, own go.mod) so its dependencies — charmbracelet/bubbletea, charmbracelet/lipgloss, charmbracelet/x/ansi — never reach consumers that need only output and command registration. Source: go/pkg/cli/frame/.
Components implement one interface; the frame allocates width and height per region:
type Model interface {
View(width, height int) string
}
type ModelFunc func(width, height int) string // func adapterNewFrame(variant) takes an HLCRF variant string (the same Header/Left/Content/Right/Footer region model as the lib's Layout); region methods slot models in:
f := frame.NewFrame("HCF").
Header(frame.StatusLine("app", "env", "dev")).
Content(myModel).
Footer(frame.KeyHints("q quit", "tab focus"))
f.Run() // live bubbletea programme (TTY)
f.RunFor(5 * time.Second)
s := f.String() // one-shot render, no programmeNavigate(m)pushes a model into Content and records history;Back()pops it.Focus(region),Focused()— explicit focus;WithKeyMap(km)rebinds keys.KeyMapfields:FocusNext,FocusPrev,FocusUp,FocusDown,FocusLeft,FocusRight,Back,Quit(alltea.KeyType). Focus cycles a ring of populated regions; arrow-style keys move spatially.Send(msg)injects atea.Msg;Stop()ends the programme. Frame itself implementstea.Model(Init/Update/View).
Ready-made single-line models in frame_components.go:
| Component | Renders |
|---|---|
StatusLine(title, pairs...) |
Title plus key/value pairs |
KeyHints(hints...) |
Key-binding hints row |
Breadcrumb(parts...) |
Navigation trail |
StaticModel(text) |
Fixed text block |
- Output defaults to stderr;
WithOutput(w)redirects (used by tests andString()). - Non-TTY environments get the one-shot render path rather than a live programme.
- The sub-module pins its own
dappco.re/goversion independently of the parent lib.
| File | Contents |
|---|---|
go/pkg/cli/frame/frame.go |
Frame, Model, navigation, focus ring, bubbletea integration |
go/pkg/cli/frame/frame_components.go |
StatusLine, KeyHints, Breadcrumb, StaticModel |
go/pkg/cli/frame/frame_model.go |
Internal model plumbing |
go/pkg/cli/frame/layout.go |
Region geometry for the frame |
go/pkg/cli/frame/style.go |
lipgloss styles |
go/pkg/cli/frame/io.go |
Writer plumbing |
go/pkg/cli/frame/go.mod |
Module boundary — bubbletea/lipgloss stay here |