Skip to content

feat(cli): add -f/--format to webcmd validate - #322

Open
rohan911438 wants to merge 1 commit into
agentrhq:mainfrom
rohan911438:feat/validate-structured-output-175
Open

feat(cli): add -f/--format to webcmd validate#322
rohan911438 wants to merge 1 commit into
agentrhq:mainfrom
rohan911438:feat/validate-structured-output-175

Conversation

@rohan911438

Copy link
Copy Markdown

Description:

Summary

Partial slice of #175.

webcmd validate had a stable, already-typed ValidationReport
result but only ever printed it as hand-written text, unlike list
and convention-audit which support -f json|yaml|csv|md|table.
Agents scripting around validation output had no structured path.

Changes

  • Add -f, --format to validate, mirroring the existing
    convention-audit pattern: table format keeps the current
    human-readable report text unchanged; other formats render the
    report object directly through the shared output path.

Scope note

#175 lists many built-in commands (verify, doctor, skills, profile
list, daemon status, and a dozen browser reads). This PR covers only
validate as one complete, tested slice rather than a partial pass
across all of them — see the companion PRs for daemon status and
profile list. The rest are left for follow-up.

Test plan

  • New e2e cases in tests/e2e/management.test.ts: -f json,
    -f yaml, and default (unchanged prose) output.
  • npx tsc --noEmit clean.
  • npx vitest run --project e2e tests/e2e/management.test.ts — 15/15 pass.

`webcmd validate` had a stable, already-typed `ValidationReport` result
but only ever printed it as hand-written text, unlike `list` and
`convention-audit` which support `-f json|yaml|csv|md|table`. Agents
scripting around validation output had no structured path (agentrhq#175).

Add `-f, --format` mirroring the existing `convention-audit` pattern:
table format keeps the current human-readable report text unchanged,
other formats render the report object directly through the shared
output path.

Scope note: agentrhq#175 lists many built-in commands (verify, doctor, skills,
profile list, daemon status, and a dozen browser reads); this PR only
covers `validate` as one complete, tested slice rather than a partial
pass across all of them. The rest are left for follow-up PRs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 16, 2026 16:09
@github-actions

Copy link
Copy Markdown
Contributor

🟠 Maintainer review suggested — low confidence

The automated review could not reach a fully supported conclusion.

This review is advisory and does not block merging.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds structured output support to the local built-in webcmd validate command so scripts can consume validation results in machine-readable formats while preserving the existing human-readable report by default.

Changes:

  • Add -f, --format <fmt> to webcmd validate (default: table) and route non-table formats through the shared output renderer.
  • Keep the existing prose validation report unchanged when fmt === 'table'.
  • Add E2E coverage for validate -f json, validate -f yaml, and the default output remaining prose.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/e2e/management.test.ts Adds E2E assertions for JSON/YAML structured validate output and unchanged default prose output.
src/cli.ts Adds -f/--format to validate and uses shared output rendering for non-table formats.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants