Skip to content

Normalize output-format parsing and rendering #172

Closed

Description

@rishabhraj36

Parent: #171

Problem

Commands that already expose -f/--format do not consistently honor the requested format or distinguish explicit values from defaults.

Verified cases:

  • plugin list -f yaml prints the human table because only json is handled specially (src/cli.ts:3169-3226).
  • Empty plugin list -f json prints human guidance instead of valid JSON (src/cli.ts:3169-3189).
  • convention-audit accepts arbitrary values but only JSON/YAML use the shared renderer (src/cli.ts:918-938).
  • Unknown formats silently fall through to table output (src/command-surface.ts:249-252, src/output.ts:43-57).
  • list, plugin catalog/search commands, and external list omit fmtExplicit, so explicit -f table can become YAML on non-TTY stdout.
  • skills list has the opposite bug: its default table is always treated as explicit (src/cli.ts:857-869).
  • Plugin catalog/search help advertises fewer formats than the renderer accepts.

Scope

  • Validate format names and return a usage error for unsupported values.
  • Use one shared supported-format definition and help description.
  • Derive fmtExplicit from Commander’s option-value source everywhere.
  • Ensure explicit -f table remains table and implicit non-TTY output follows the documented default.
  • Make empty and non-empty results obey the same format contract.
  • Either implement every advertised format or reject it explicitly.

Acceptance criteria

  • plugin list -f yaml emits YAML or a clear unsupported-format error, never a table.
  • Empty plugin list -f json emits valid JSON.
  • Unknown formats fail with a usage error.
  • Explicit and implicit table behavior is correct on non-TTY stdout.
  • Format help and parsing use the same source of truth.
  • Tests cover JSON, YAML, explicit table, implicit non-TTY output, empty results, and invalid formats.

Activity

  1. added a commit that references this issue on Aug 13, 2026
    63cc20a
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions