feat: bootstrap cli entrypoint with bubble tea and toml config
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
|
||||
"parasocial/internal/config"
|
||||
"parasocial/internal/tui"
|
||||
)
|
||||
|
||||
// Run loads the application configuration and starts the terminal UI.
|
||||
func Run(ctx context.Context) error {
|
||||
cfg, err := config.LoadDefault()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
program := tea.NewProgram(
|
||||
tui.New(cfg.Streamers),
|
||||
tea.WithContext(ctx),
|
||||
tea.WithInput(os.Stdin),
|
||||
tea.WithOutput(os.Stdout),
|
||||
)
|
||||
_, err = program.Run()
|
||||
return err
|
||||
}
|
||||
Reference in New Issue
Block a user