From 665bd389a0a1c8adadcaa1122e846cc81f5ead31 Mon Sep 17 00:00:00 2001 From: T Date: Tue, 5 Aug 2025 11:37:02 -0600 Subject: WIP TUI --- internal/commands/tui.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 internal/commands/tui.go (limited to 'internal/commands/tui.go') diff --git a/internal/commands/tui.go b/internal/commands/tui.go new file mode 100644 index 0000000..529e937 --- /dev/null +++ b/internal/commands/tui.go @@ -0,0 +1,29 @@ +package commands + +import ( + "fmt" + + punchctx "punchcard/internal/context" + "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 +} -- cgit v1.2.3