tui

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package tui is rig's terminal control plane: one screen per concern (services, logs, metrics, traces, queries, key-value, data, load, manifests, hosts), all driven by the same engine as the CLI. Screens load nothing until opened and refresh only while showing; the service list is one runtime call per refresh.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chat

func Chat(ctx context.Context, a *engine.App, id string) error

Chat opens the UI with the assistant's chat open, on conversation id ("" a new one, "last" the newest).

func CloseSession

func CloseSession(projectDir, id string) error

CloseSession forgets a saved session.

func PickSession

func PickSession(rows [][]string, close func(i int) error) (int, error)

PickSession is `rig resume`'s chooser: rows are id, kind, saved, what; enter picks one, d closes the selected one (through close), q leaves. It returns the picked row, -1 for none.

func Resume

func Resume(ctx context.Context, open func(env string) (*engine.App, error), projectDir, id string) error

Resume opens the saved session's environment and the UI as it was.

func Run

func Run(ctx context.Context, a *engine.App) error

Types

type Session

type Session struct {
	ID      string    `json:"id"`
	Env     string    `json:"env"`
	Created time.Time `json:"created"`
	Saved   time.Time `json:"saved"`
	Tab     int       `json:"tab"`
	TabName string    `json:"tab_name,omitempty"`

	LogServices []string `json:"log_services,omitempty"`
	LogInstance string   `json:"log_instance,omitempty"`
	LogGrep     string   `json:"log_grep,omitempty"`

	Queries   map[string]*spec.Query   `json:"adhoc_queries,omitempty"`
	Scheduled map[string]bool          `json:"scheduled,omitempty"`
	Results   map[string]savedResult   `json:"results,omitempty"`
	Runs      []queryRun               `json:"runs,omitempty"`
	DataPaths map[string][]string      `json:"data_paths,omitempty"`
	Dashboard int                      `json:"dashboard,omitempty"`
	Load      map[string]savedLoadHist `json:"load,omitempty"`
}

Session is what S saves and `rig resume` brings back: the screen, what each screen was showing, and the query results and history of the run.

func ListSessions

func ListSessions(projectDir string) ([]Session, error)

ListSessions are the project's saved sessions, newest first, without their results.

func LoadSession

func LoadSession(projectDir, id string) (*Session, error)

LoadSession reads a saved session of the project; id "" or "last" is the newest.

func (Session) Summary

func (s Session) Summary() string

Summary is one line about a saved session for listings.

Jump to

Keyboard shortcuts

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