tui

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package tui implements chunder's terminal user interface: a Bubble Tea download experience with Lip Gloss styling, gradients, and live progress.

Index

Constants

View Source
const (
	ActionNone     = ""
	ActionDownload = "download"
	ActionAudio    = "audio"
	ActionWatch    = "watch"
)

Search actions the user can pick from the results browser.

Variables

This section is empty.

Functions

func AccentText

func AccentText(s string) string

AccentText styles s in the brand color.

func Badge

func Badge(text, bg string) string

Badge renders a small colored chip like ` 1080p `.

func Banner() string

Banner returns the logo with a vertical pink→amber gradient plus tagline.

func DimText

func DimText(s string) string

DimText styles s as secondary text.

func ErrorText

func ErrorText(s string) string

ErrorText styles s as an error line.

func GradientText

func GradientText(s, from, to string) string

GradientText colors s with a horizontal gradient from one hex color to another.

func RenderInfo

func RenderInfo(video *youtube.Video) string

RenderInfo returns the full styled output for `chunder info`: a video card followed by a table of every available stream.

func RunClip

func RunClip(ctx context.Context, client *downloader.Client, opts downloader.Options) error

RunClip extracts a clip segment inside the interactive TUI.

func RunDownload

func RunDownload(ctx context.Context, client *downloader.Client, opts downloader.Options) error

RunDownload executes a download inside the interactive TUI. It blocks until the download finishes, fails, or the user cancels.

func RunPlaylist

func RunPlaylist(ctx context.Context, client *downloader.Client, opts downloader.Options, plOpts downloader.PlaylistOptions) error

RunPlaylist downloads a whole playlist inside the interactive TUI.

func RunSearch

func RunSearch(ctx context.Context, query string, results []search.Result) (string, search.Result, error)

RunSearch shows the interactive results browser and returns the action the user chose and for which video. action is ActionNone if they just quit.

func RunWatch

func RunWatch(ctx context.Context, params WatchParams) error

RunWatch plays a video inside the terminal until it ends or the user quits.

func Sparkline

func Sparkline(values []float64, width int) string

Sparkline renders values as a compact bar graph like ▂▃▅▆▇█, colored with the brand gradient. Values are normalized against the series maximum.

func Wordmark

func Wordmark() string

Wordmark renders the inline ` chunder ` brand chip used above live views.

Types

type WatchParams

type WatchParams struct {
	Title    string
	Duration time.Duration
	Pipeline *player.Pipeline
	FPS      int
	HasAudio bool
}

WatchParams configures an in-terminal playback session.

Jump to

Keyboard shortcuts

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