feat(cli): add -f/--format to webcmd validate - #322
Conversation
`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 (#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: #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>
🟠 Maintainer review suggested — low confidenceThe automated review could not reach a fully supported conclusion. This review is advisory and does not block merging. |
There was a problem hiding this comment.
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>towebcmd validate(default:table) and route non-tableformats 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.
|
Subset of #365 ( |
|
Thank you @rohan911438 — this already landed on Closing this slice as superseded so the work stays credited on the merged PR rather than a follow-up rewrite. |
|
Superseded by #306. |
Description:
Summary
Partial slice of #175.
webcmd validatehad a stable, already-typedValidationReportresult but only ever printed it as hand-written text, unlike
listand
convention-auditwhich support-f json|yaml|csv|md|table.Agents scripting around validation output had no structured path.
Changes
-f, --formattovalidate, mirroring the existingconvention-auditpattern:tableformat keeps the currenthuman-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
validateas one complete, tested slice rather than a partial passacross all of them — see the companion PRs for
daemon statusandprofile list. The rest are left for follow-up.Test plan
tests/e2e/management.test.ts:-f json,-f yaml, and default (unchanged prose) output.npx tsc --noEmitclean.npx vitest run --project e2e tests/e2e/management.test.ts— 15/15 pass.