···3333 &cobra.Group{ID: "task-ops", Title: "Basic Operations"},
3434 &cobra.Group{ID: "task-meta", Title: "Metadata"},
3535 &cobra.Group{ID: "task-tracking", Title: "Tracking"},
3636+ &cobra.Group{ID: "task-reports", Title: "Reports & Views"},
3637 )
37383839 for _, init := range []func(*handlers.TaskHandler) *cobra.Command{
···5960 root.AddCommand(cmd)
6061 }
61626363+ for _, init := range []func(*handlers.TaskHandler) *cobra.Command{
6464+ nextActionsCmd, reportCompletedCmd, reportWaitingCmd, reportBlockedCmd, calendarCmd,
6565+ } {
6666+ cmd := init(c.handler)
6767+ cmd.GroupID = "task-reports"
6868+ root.AddCommand(cmd)
6969+ }
7070+6271 return root
6372}
6473···8493 project, _ := c.Flags().GetString("project")
8594 context, _ := c.Flags().GetString("context")
8695 due, _ := c.Flags().GetString("due")
9696+ wait, _ := c.Flags().GetString("wait")
9797+ scheduled, _ := c.Flags().GetString("scheduled")
8798 recur, _ := c.Flags().GetString("recur")
8899 until, _ := c.Flags().GetString("until")
89100 parent, _ := c.Flags().GetString("parent")
···91102 tags, _ := c.Flags().GetStringSlice("tags")
9210393104 defer h.Close()
9494- return h.Create(c.Context(), description, priority, project, context, due, recur, until, parent, dependsOn, tags)
105105+ // TODO: Make a CreateTask struct
106106+ return h.Create(c.Context(), description, priority, project, context, due, wait, scheduled, recur, until, parent, dependsOn, tags)
95107 },
96108 }
97109 addCommonTaskFlags(cmd)
98110 addDueDateFlag(cmd)
111111+ addWaitScheduledFlags(cmd)
99112 addRecurrenceFlags(cmd)
100113 addParentFlag(cmd)
101114 addDependencyFlags(cmd)
···120133 priority, _ := c.Flags().GetString("priority")
121134 project, _ := c.Flags().GetString("project")
122135 context, _ := c.Flags().GetString("context")
136136+ sortBy, _ := c.Flags().GetString("sort")
123137124138 defer h.Close()
125125- return h.List(c.Context(), static, showAll, status, priority, project, context)
139139+ // TODO: TaskFilter struct
140140+ return h.List(c.Context(), static, showAll, status, priority, project, context, sortBy)
126141 },
127142 }
128143 cmd.Flags().BoolP("interactive", "i", false, "Force interactive mode (default)")
···132147 cmd.Flags().String("priority", "", "Filter by priority")
133148 cmd.Flags().String("project", "", "Filter by project")
134149 cmd.Flags().String("context", "", "Filter by context")
150150+ cmd.Flags().String("sort", "", "Sort by (urgency)")
135151136152 return cmd
137153}
···449465450466 root.AddCommand(setCmd, clearCmd, showCmd)
451467 return root
468468+}
469469+470470+func nextActionsCmd(h *handlers.TaskHandler) *cobra.Command {
471471+ cmd := &cobra.Command{
472472+ Use: "next",
473473+ Short: "Show next actions (actionable tasks sorted by urgency)",
474474+ Aliases: []string{"na"},
475475+ Long: `Display actionable tasks sorted by urgency score.
476476+477477+Shows tasks that can be worked on now (not waiting, not blocked, not completed),
478478+ordered by their computed urgency based on priority, due date, age, and other factors.`,
479479+ RunE: func(c *cobra.Command, args []string) error {
480480+ limit, _ := c.Flags().GetInt("limit")
481481+ defer h.Close()
482482+ return h.NextActions(c.Context(), limit)
483483+ },
484484+ }
485485+ cmd.Flags().IntP("limit", "n", 10, "Limit number of tasks shown")
486486+ return cmd
487487+}
488488+489489+func reportCompletedCmd(h *handlers.TaskHandler) *cobra.Command {
490490+ cmd := &cobra.Command{
491491+ Use: "completed",
492492+ Short: "Show completed tasks",
493493+ Long: "Display tasks that have been completed, sorted by completion date.",
494494+ RunE: func(c *cobra.Command, args []string) error {
495495+ limit, _ := c.Flags().GetInt("limit")
496496+ defer h.Close()
497497+ return h.ReportCompleted(c.Context(), limit)
498498+ },
499499+ }
500500+ cmd.Flags().IntP("limit", "n", 20, "Limit number of tasks shown")
501501+ return cmd
502502+}
503503+504504+func reportWaitingCmd(h *handlers.TaskHandler) *cobra.Command {
505505+ cmd := &cobra.Command{
506506+ Use: "waiting",
507507+ Short: "Show waiting tasks",
508508+ Long: "Display tasks that are waiting for a specific date before becoming actionable.",
509509+ RunE: func(c *cobra.Command, args []string) error {
510510+ defer h.Close()
511511+ return h.ReportWaiting(c.Context())
512512+ },
513513+ }
514514+ return cmd
515515+}
516516+517517+func reportBlockedCmd(h *handlers.TaskHandler) *cobra.Command {
518518+ cmd := &cobra.Command{
519519+ Use: "blocked",
520520+ Short: "Show blocked tasks",
521521+ Long: "Display tasks that are blocked by dependencies on other tasks.",
522522+ RunE: func(c *cobra.Command, args []string) error {
523523+ defer h.Close()
524524+ return h.ReportBlocked(c.Context())
525525+ },
526526+ }
527527+ return cmd
528528+}
529529+530530+func calendarCmd(h *handlers.TaskHandler) *cobra.Command {
531531+ cmd := &cobra.Command{
532532+ Use: "calendar",
533533+ Short: "Show tasks in calendar view",
534534+ Aliases: []string{"cal"},
535535+ Long: `Display tasks with due dates in a calendar format.
536536+537537+Shows tasks organized by week and day, making it easy to see upcoming deadlines
538538+and plan your work schedule.`,
539539+ RunE: func(c *cobra.Command, args []string) error {
540540+ weeks, _ := c.Flags().GetInt("weeks")
541541+ defer h.Close()
542542+ return h.Calendar(c.Context(), weeks)
543543+ },
544544+ }
545545+ cmd.Flags().IntP("weeks", "w", 4, "Number of weeks to show")
546546+ return cmd
452547}
453548454549func taskDependCmd(h *handlers.TaskHandler) *cobra.Command {
+5
cmd/task_flags.go
···3131func addDueDateFlag(cmd *cobra.Command) {
3232 cmd.Flags().StringP("due", "d", "", "Set due date (YYYY-MM-DD)")
3333}
3434+3535+func addWaitScheduledFlags(cmd *cobra.Command) {
3636+ cmd.Flags().StringP("wait", "w", "", "Task not actionable until date (YYYY-MM-DD)")
3737+ cmd.Flags().StringP("scheduled", "s", "", "Task scheduled to start on date (YYYY-MM-DD)")
3838+}