f922b855eb
Reimplement the TUI in Go using Bubble Tea, replacing the Kotlin/Tamboui app. Same WebSocket protocol, soft-rounded layout with blue accent theme.
31 lines
589 B
Go
31 lines
589 B
Go
// Command preview prints a single static TUI frame for screenshotting.
|
|
// Usage: preview <kind> [cols] [rows]
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"strconv"
|
|
|
|
"github.com/charmbracelet/lipgloss"
|
|
"github.com/correx/tui-go/internal/app"
|
|
"github.com/muesli/termenv"
|
|
)
|
|
|
|
func main() {
|
|
lipgloss.SetColorProfile(termenv.TrueColor)
|
|
|
|
kind := "idle"
|
|
if len(os.Args) > 1 {
|
|
kind = os.Args[1]
|
|
}
|
|
cols, rows := 140, 36
|
|
if len(os.Args) > 2 {
|
|
cols, _ = strconv.Atoi(os.Args[2])
|
|
}
|
|
if len(os.Args) > 3 {
|
|
rows, _ = strconv.Atoi(os.Args[3])
|
|
}
|
|
fmt.Print(app.PreviewFrame(kind, cols, rows))
|
|
}
|