Skip to content

CLI: make empty list output format-aware (--format json/toon) #27

Description

@amondnet

Background

Surfaced during review of #26 (PR #26, cubic-dev-ai).

All list commands print a plain-text No ... found message (via chalk.yellow) when the result set is empty, ignoring the global --format option. For machine consumers using --format json or --format toon, an empty result should emit a valid empty payload (e.g. { "dependencies": [] }) rather than human-readable text.

Scope (cross-cutting)

Affects every list command consistently:

  • task list
  • project list
  • section list
  • task subtask list
  • task dependency list
  • task dependent list

Proposal

When the result is empty:

  • plain format → keep the current No ... found message
  • json / toon → emit the empty collection through formatOutput

This was intentionally deferred from #26 to avoid changing only the new commands and creating inconsistency with the existing CLI convention.

Acceptance

  • Empty results respect --format across all list commands
  • Tests cover empty + json/toon for at least one command

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions