feat: add due date filters for list command

- --due: show only nodes with a due date set
- --due-within N: show only nodes due within N days (includes overdue)

Implemented in service layer with post-fetch filtering, threaded through
API client and server, and exposed via CLI flags.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-04-02 05:06:35 +02:00
parent 8357c80e75
commit f2521be158
5 changed files with 48 additions and 1 deletions
+7
View File
@@ -8,6 +8,7 @@ import (
"fmt"
"net/http"
"net/url"
"strconv"
)
type apiClient struct {
@@ -78,6 +79,12 @@ func (c *apiClient) List(filter ListFilter) ([]*models.Node, error) {
q.Add("rel", string(r.Type)+":"+r.Target)
}
}
if filter.HasDueDate {
q.Set("has_due_date", "true")
}
if filter.DueWithin != nil {
q.Set("due_within", strconv.Itoa(*filter.DueWithin))
}
path := "/nodes"
if len(q) > 0 {
path += "?" + q.Encode()