feat(tui): replace Textual with a Go/Bubble Tea interface (#941)

This commit is contained in:
oyasumi
2026-08-03 19:23:07 -07:00
committed by GitHub
parent a51ca18666
commit 5bb9fe896b
128 changed files with 16229 additions and 6562 deletions
+35
View File
@@ -0,0 +1,35 @@
package main
import (
"fmt"
"os"
tea "github.com/charmbracelet/bubbletea"
"github.com/usestrix/strix/tui/internal/app"
"github.com/usestrix/strix/tui/internal/render"
)
func main() {
app.SetVersion(os.Getenv("STRIX_VERSION"))
render.DetectKittyGraphics()
client, err := app.ConnectFromEnvironment()
if err != nil {
fmt.Fprintln(os.Stderr, "connect to Strix backend:", err)
os.Exit(1)
}
defer client.Close()
if err := client.Handshake(); err != nil {
fmt.Fprintln(os.Stderr, "negotiate Strix TUI protocol:", err)
os.Exit(1)
}
program := tea.NewProgram(app.New(client), tea.WithAltScreen(), tea.WithMouseCellMotion())
finalModel, err := program.Run()
if err != nil {
fmt.Fprintln(os.Stderr, "run TUI:", err)
os.Exit(1)
}
if model, ok := finalModel.(interface{ FatalError() error }); ok && model.FatalError() != nil {
fmt.Fprintln(os.Stderr, "run TUI:", model.FatalError())
os.Exit(1)
}
}