feat(cli): add -f/--format to webcmd validate - #322
Open
rohan911438 wants to merge 1 commit into
Open
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 (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>
Contributor
🟠 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.