diff options
author | T <t@tjp.lol> | 2025-08-05 11:37:02 -0600 |
---|---|---|
committer | T <t@tjp.lol> | 2025-08-05 11:37:08 -0600 |
commit | 665bd389a0a1c8adadcaa1122e846cc81f5ead31 (patch) | |
tree | f34f9ec77891308c600c680683f60951599429c3 /internal/commands/tui.go | |
parent | dc895cec9d8a84af89ce2501db234dff33c757e2 (diff) |
WIP TUI
Diffstat (limited to 'internal/commands/tui.go')
-rw-r--r-- | internal/commands/tui.go | 29 |
1 files changed, 29 insertions, 0 deletions
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 +} |