tui

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 24 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 cchp's interactive home screen for people: a short task list, guided sign-in, searchable lists and plain-language errors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoneLine

func DoneLine(m *Model) string

DoneLine is the line a finished sign-in prints.

func Login

func Login(ctx context.Context, d Deps, server string) error

Login runs the guided sign-in and prints the outcome.

func Run

func Run(ctx context.Context, d Deps) error

Run opens the home screen.

Types

type Deps

type Deps struct {
	Runner  *runner.Runner
	Store   *auth.Store
	Version string
}

Deps is what the TUI needs from the rest of cchp.

type Model

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

Model is the whole TUI.

func NewModel

func NewModel(ctx context.Context, d Deps, login bool, server string) *Model

NewModel builds the home screen. With login set it starts on sign-in and quits once it succeeds.

func (*Model) Init

func (m *Model) Init() tea.Cmd

Init starts the first screen and checks the token in the background.

func (*Model) Update

func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update routes messages to the current screen.

func (*Model) View

func (m *Model) View() tea.View

View draws the header, the current screen and its key hints.

Jump to

Keyboard shortcuts

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