···33 &cobra.Group{ID: "task-ops", Title: "Basic Operations"},
34 &cobra.Group{ID: "task-meta", Title: "Metadata"},
35 &cobra.Group{ID: "task-tracking", Title: "Tracking"},
36+ &cobra.Group{ID: "task-reports", Title: "Reports & Views"},
37 )
3839 for _, init := range []func(*handlers.TaskHandler) *cobra.Command{
···60 root.AddCommand(cmd)
61 }
6263+ for _, init := range []func(*handlers.TaskHandler) *cobra.Command{
64+ nextActionsCmd, reportCompletedCmd, reportWaitingCmd, reportBlockedCmd, calendarCmd,
65+ } {
66+ cmd := init(c.handler)
67+ cmd.GroupID = "task-reports"
68+ root.AddCommand(cmd)
69+ }
70+71 return root
72}
73···93 project, _ := c.Flags().GetString("project")
94 context, _ := c.Flags().GetString("context")
95 due, _ := c.Flags().GetString("due")
96+ wait, _ := c.Flags().GetString("wait")
97+ scheduled, _ := c.Flags().GetString("scheduled")
98 recur, _ := c.Flags().GetString("recur")
99 until, _ := c.Flags().GetString("until")
100 parent, _ := c.Flags().GetString("parent")
···102 tags, _ := c.Flags().GetStringSlice("tags")
103104 defer h.Close()
105+ // TODO: Make a CreateTask struct
106+ return h.Create(c.Context(), description, priority, project, context, due, wait, scheduled, recur, until, parent, dependsOn, tags)
107 },
108 }
109 addCommonTaskFlags(cmd)
110 addDueDateFlag(cmd)
111+ addWaitScheduledFlags(cmd)
112 addRecurrenceFlags(cmd)
113 addParentFlag(cmd)
114 addDependencyFlags(cmd)
···133 priority, _ := c.Flags().GetString("priority")
134 project, _ := c.Flags().GetString("project")
135 context, _ := c.Flags().GetString("context")
136+ sortBy, _ := c.Flags().GetString("sort")
137138 defer h.Close()
139+ // TODO: TaskFilter struct
140+ return h.List(c.Context(), static, showAll, status, priority, project, context, sortBy)
141 },
142 }
143 cmd.Flags().BoolP("interactive", "i", false, "Force interactive mode (default)")
···147 cmd.Flags().String("priority", "", "Filter by priority")
148 cmd.Flags().String("project", "", "Filter by project")
149 cmd.Flags().String("context", "", "Filter by context")
150+ cmd.Flags().String("sort", "", "Sort by (urgency)")
151152 return cmd
153}
···465466 root.AddCommand(setCmd, clearCmd, showCmd)
467 return root
468+}
469+470+func nextActionsCmd(h *handlers.TaskHandler) *cobra.Command {
471+ cmd := &cobra.Command{
472+ Use: "next",
473+ Short: "Show next actions (actionable tasks sorted by urgency)",
474+ Aliases: []string{"na"},
475+ Long: `Display actionable tasks sorted by urgency score.
476+477+Shows tasks that can be worked on now (not waiting, not blocked, not completed),
478+ordered by their computed urgency based on priority, due date, age, and other factors.`,
479+ RunE: func(c *cobra.Command, args []string) error {
480+ limit, _ := c.Flags().GetInt("limit")
481+ defer h.Close()
482+ return h.NextActions(c.Context(), limit)
483+ },
484+ }
485+ cmd.Flags().IntP("limit", "n", 10, "Limit number of tasks shown")
486+ return cmd
487+}
488+489+func reportCompletedCmd(h *handlers.TaskHandler) *cobra.Command {
490+ cmd := &cobra.Command{
491+ Use: "completed",
492+ Short: "Show completed tasks",
493+ Long: "Display tasks that have been completed, sorted by completion date.",
494+ RunE: func(c *cobra.Command, args []string) error {
495+ limit, _ := c.Flags().GetInt("limit")
496+ defer h.Close()
497+ return h.ReportCompleted(c.Context(), limit)
498+ },
499+ }
500+ cmd.Flags().IntP("limit", "n", 20, "Limit number of tasks shown")
501+ return cmd
502+}
503+504+func reportWaitingCmd(h *handlers.TaskHandler) *cobra.Command {
505+ cmd := &cobra.Command{
506+ Use: "waiting",
507+ Short: "Show waiting tasks",
508+ Long: "Display tasks that are waiting for a specific date before becoming actionable.",
509+ RunE: func(c *cobra.Command, args []string) error {
510+ defer h.Close()
511+ return h.ReportWaiting(c.Context())
512+ },
513+ }
514+ return cmd
515+}
516+517+func reportBlockedCmd(h *handlers.TaskHandler) *cobra.Command {
518+ cmd := &cobra.Command{
519+ Use: "blocked",
520+ Short: "Show blocked tasks",
521+ Long: "Display tasks that are blocked by dependencies on other tasks.",
522+ RunE: func(c *cobra.Command, args []string) error {
523+ defer h.Close()
524+ return h.ReportBlocked(c.Context())
525+ },
526+ }
527+ return cmd
528+}
529+530+func calendarCmd(h *handlers.TaskHandler) *cobra.Command {
531+ cmd := &cobra.Command{
532+ Use: "calendar",
533+ Short: "Show tasks in calendar view",
534+ Aliases: []string{"cal"},
535+ Long: `Display tasks with due dates in a calendar format.
536+537+Shows tasks organized by week and day, making it easy to see upcoming deadlines
538+and plan your work schedule.`,
539+ RunE: func(c *cobra.Command, args []string) error {
540+ weeks, _ := c.Flags().GetInt("weeks")
541+ defer h.Close()
542+ return h.Calendar(c.Context(), weeks)
543+ },
544+ }
545+ cmd.Flags().IntP("weeks", "w", 4, "Number of weeks to show")
546+ return cmd
547}
548549func taskDependCmd(h *handlers.TaskHandler) *cobra.Command {
+5
cmd/task_flags.go
···31func addDueDateFlag(cmd *cobra.Command) {
32 cmd.Flags().StringP("due", "d", "", "Set due date (YYYY-MM-DD)")
33}
00000
···31func addDueDateFlag(cmd *cobra.Command) {
32 cmd.Flags().StringP("due", "d", "", "Set due date (YYYY-MM-DD)")
33}
34+35+func addWaitScheduledFlags(cmd *cobra.Command) {
36+ cmd.Flags().StringP("wait", "w", "", "Task not actionable until date (YYYY-MM-DD)")
37+ cmd.Flags().StringP("scheduled", "s", "", "Task scheduled to start on date (YYYY-MM-DD)")
38+}