Skip to content

list: 'cu list list' table output renders zero rows (type switch misses clickup.List) #24

Description

@timimsms

Context

cu list list renders an empty table in the default output mode, while -o json shows the expected lists. The table branch silently drops every row.

Evidence

  • internal/cmd/list.go:57 — listListCmd accumulates results into var allLists []interface{}, appending typed clickup.List structs returned by client.GetLists(...).
  • internal/cmd/list.go:121-141 — the table branch type-switches only on map[string]interface{}:
for _, item := range allLists {
	// Type assertion based on the actual type
	switch v := item.(type) {
	case map[string]interface{}:
		...
	}
}

Since every element is a clickup.List struct (not a map), no case matches, rows stays empty, and the table prints zero rows. JSON output works because it marshals the structs directly.

Suggested fix

Type-switch on clickup.List (or drop the []interface{} indirection entirely and use []clickup.List), and add a regression test that asserts cu list list table output contains the list rows.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions