Skip to content

Feature: Add structured JSON output mode for all tools #2

@hoangsonww

Description

@hoangsonww

Problem

All tools currently return human-formatted tables/text only. That works for interactive assistants but blocks downstream automation (dashboards, CI gates, historical trend storage) because consumers have to parse display text.

Proposal

Add an optional output_format argument to every tool ("text" | "json", default "text").

When output_format="json", each tool should return a stable typed payload with:

  • metadata (tool name, repo root, time window, generated_at)
  • summary (top-level metrics)
  • items (tool-specific rows/records)
  • warnings (partial data, truncation, validation hints)

Keep current text rendering unchanged for default mode.

Scope

  • Extend all 8 tool schemas with output_format.
  • Introduce shared JSON response contracts in a central module.
  • Keep formatter layer for text mode and add JSON serializer helpers.
  • Update smoke test and integration tests to validate both modes.
  • Add docs/examples showing how to consume JSON mode in scripts.

Acceptance Criteria

  • Every tool supports output_format="json" without breaking existing text behavior.
  • JSON payloads are deterministic and schema-consistent across tools.
  • npm run smoke exercises both text and json modes.
  • README/docs include examples and migration notes.
  • New tests validate JSON shape and key metric correctness for each tool.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdocumentationImprovements or additions to documentationenhancementNew feature or requestgood first issueGood for newcomershelp wantedExtra attention is neededquestionFurther information is requested

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions