tui

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: MIT Imports: 6 Imported by: ? 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 exposes the interactive terminal UI used by the vminfo CLI so it can be embedded in other Go programs.

Run starts the same full-screen, keyboard-driven dashboard the vminfo binary shows: live CPU, memory, network, and disk metrics, TCP and conntrack state, a process list, and host metadata. It requires a real TTY on the provided Options.Stdin and Options.Stdout; in a non-interactive context Run returns an error.

The UI language is selected via Options.Lang (for example "en" or "zh"); when empty it is auto-detected from the VMINFO_LANG, LC_ALL, and LANG environment variables.

Example:

err := tui.Run(ctx, tui.Options{Lang: "en"})
if err != nil {
    log.Fatal(err)
}

Host metric collection lives in the root package at github.com/cloudapp3/vminfo.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

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

Run starts the vminfo interactive terminal UI.

Types

type Options

type Options struct {
	// Stdout receives the rendered terminal UI. Defaults to os.Stdout.
	Stdout io.Writer
	// Stdin provides keyboard input. Defaults to os.Stdin.
	Stdin io.Reader
	// Lang selects the UI language. Examples: "en", "zh", "zh-CN".
	// Empty means auto-detect from VMINFO_LANG, LC_ALL, or LANG.
	Lang string
}

Options configures the interactive terminal UI.

Jump to

Keyboard shortcuts

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