Skip to content

--compact should output JSON everywhere, not just on discover commands #4

@VidGuiCode

Description

@VidGuiCode

Problem

--compact is described as "Output compact JSON without indentation (for AI/agents)" but it only affects printJson indentation. On list commands (project list, tag list, task list, te list) it still outputs human-readable tables that agents can't parse.

An agent using --compact expects JSON output everywhere. Currently it has to guess whether to use --json or --compact per command.

Solution

Add a wantsJson(opts) helper in src/core/runtime.ts that returns true when either --json or --compact is present. Replace all 49 if (opts.json) checks across 14 command files with wantsJson(opts).

This makes --compact consistently mean "give me compact JSON" everywhere, which is what the flag description promises.

Scope: 49 occurrences across 14 files — mechanical replacement, no logic changes.

Source

Agent feedback session 2 (2026-04-02) — Claude Opus 4.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestv0.1.2v0.1.2 patch release

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions