package commands import ( "fmt" punchctx "git.tjp.lol/punchcard/internal/context" "git.tjp.lol/punchcard/internal/tui" "github.com/spf13/cobra" ) func NewTUICmd() *cobra.Command { cmd := &cobra.Command{ Use: "tui", Short: "Start the terminal user interface", Long: `Start an interactive terminal user interface for time tracking with real-time updates.`, Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { q := punchctx.GetDB(cmd.Context()) if q == nil { return fmt.Errorf("database not available in context") } return tui.Run(cmd.Context(), q) }, } return cmd }