summaryrefslogtreecommitdiff
path: root/internal/cli/tui.go
blob: ff4f2aaeff8de0a82b6700d7b69a9f4b182a04ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package cli

import (
	tuiapp "codeberg.org/snonux/timr/internal/tui"
	tea "github.com/charmbracelet/bubbletea"
	"github.com/spf13/cobra"
)

func newTUICmd() *cobra.Command {
	return &cobra.Command{
		Use:   "tui",
		Short: "Launch full-screen TUI",
		RunE: func(cmd *cobra.Command, args []string) error {
			model, err := tuiapp.NewModelWithConfig(currentConfig(cmd))
			if err != nil {
				return err
			}
			program := tea.NewProgram(model)
			return program.Start()
		},
	}
}