feat: bootstrap cli entrypoint with bubble tea and toml config

This commit is contained in:
2026-04-28 20:49:07 +02:00
parent 914b3b9eff
commit f738833aa8
10 changed files with 338 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
package tui
import (
"fmt"
"strings"
tea "github.com/charmbracelet/bubbletea"
)
// Model is the initial terminal UI for parasocial.
type Model struct {
streamers []string
}
// New returns a Bubble Tea model that displays configured streamers.
func New(streamers []string) Model {
return Model{streamers: append([]string(nil), streamers...)}
}
func (m Model) Init() tea.Cmd {
return nil
}
func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg := msg.(type) {
case tea.KeyMsg:
switch msg.String() {
case "ctrl+c", "esc", "q":
return m, tea.Quit
}
}
return m, nil
}
func (m Model) View() string {
var builder strings.Builder
builder.WriteString("Streamers\n")
for i, streamer := range m.streamers {
fmt.Fprintf(&builder, "%d. %s\n", i+1, streamer)
}
builder.WriteString("\n")
return builder.String()
}