tui

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(cfg Config) error

func RunMonitor

func RunMonitor(cfg Config) error

RunMonitor launches the TUI in standalone monitor mode. cfg.InitialDashboard selects which dashboard is shown first ("network", "provider", "bme", or "" for the default network).

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App is the root bubbletea model for the akt TUI.

func (App) Init

func (a App) Init() tea.Cmd

Init implements tea.Model.

func (App) Update

func (a App) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model.

func (App) View

func (a App) View() tea.View

View implements tea.Model.

type Config

type Config struct {
	Viper            *viper.Viper
	RPCEndpoint      string // resolved from active context; may be empty
	RESTEndpoint     string // resolved from active context; may be empty
	CacheDir         string // path to cache directory (e.g. ~/.config/akt/cache)
	Insecure         bool   // skip TLS verification for provider queries
	Standalone       bool   // when true, disables command palette and view switching (e.g. akt monitor)
	InitialDashboard string // which monitor dashboard to start on: "network" (default), "provider", "bme"

	// Data sources (optional — TUI works in degraded mode without them)
	Store       store.Store         // local deployment store (nil = no store)
	ResolvedCtx *aktctx.Context     // resolved akt context (nil = no context info)
	LightClient aclient.LightClient // chain query client; nil = no chain queries

	// Provider auth (optional — nil = no log streaming)
	Keyring   sdkkeyring.Keyring // keyring for provider auth
	ClientCtx sdkclient.Context  // SDK client context for provider auth
}

Config holds the parameters needed to start the TUI.

type Router

type Router struct {
	// contains filtered or unexported fields
}

Router manages a navigation stack of ViewComponent values. The active view (top of stack) receives Update() and View() calls. Views below the top are frozen until they become active again via Pop().

func NewRouter

func NewRouter() Router

NewRouter creates an empty Router.

func (*Router) Active

func (r *Router) Active() views.ViewComponent

Active returns the top view on the stack, or nil if the stack is empty.

func (*Router) Breadcrumb

func (r *Router) Breadcrumb() string

Breadcrumb returns the navigation trail by joining all stack views' Breadcrumb() values with " > ".

func (*Router) Depth

func (r *Router) Depth() int

Depth returns the number of views on the stack.

func (*Router) Pop

func (r *Router) Pop() tea.Cmd

Pop removes the top view from the stack. If the stack has only one view (the root), this is a no-op and returns nil.

func (*Router) Push

func (r *Router) Push(v views.ViewComponent) tea.Cmd

Push adds a view to the top of the stack, sets its size, and returns its Init() command.

func (*Router) Replace

func (r *Router) Replace(v views.ViewComponent) tea.Cmd

Replace swaps the top view with a new one, sets its size, and returns its Init() command. If the stack is empty, it behaves like Push.

func (*Router) SetSize

func (r *Router) SetSize(w, h int)

SetSize stores the available dimensions and propagates to the active (top) view only.

func (*Router) Update

func (r *Router) Update(msg tea.Msg) tea.Cmd

Update delegates the message to the active view. The returned tea.Model from the view's Update() replaces the top of the stack (to support bubbletea's immutable model pattern).

func (Router) View

func (r Router) View() tea.View

View returns the active view's rendered output.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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