Normalize output-format parsing and rendering across builtin commands - #190
Open
Sneh30 wants to merge 8 commits into
Open
Normalize output-format parsing and rendering across builtin commands#190Sneh30 wants to merge 8 commits into
Sneh30 wants to merge 8 commits into
Conversation
… webcmd-usage skill
Contributor
🟢 No documentation gap found — medium confidenceThe automated review found no documentation gap in the supplied changes. This review is advisory and does not block merging. |
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.
What
Fixes #172: unify
-f/--formatparsing and rendering so every builtin command accepts and honors the same set of output formats, rejects unsupported values, and emits consistent structured output.Single source of truth
src/command-surface.tsnow owns the canonical formats (table,plain,json,yaml,md,csv), the aliasesyml → yamlandmarkdown → md, the shared help text, and theparseOutputFormat/resolveOutputFormatvalidators (case-insensitive).-f/--formatflags (builtin commands,auth status/refresh, adapter/hosted surfaces) advertise the same format list.Behavior fixes
plugin list -f yamlnow emits real YAML (previously a table); emptyplugin list -f jsonemits[]instead of human guidance.skills list,external list,plugin catalog list/add,plugin search,convention-audit, andauth status/refreshnow honor all six formats with the correct explicit/implicit semantics (table in TTY, YAML outside TTY unless-fis given).webcmd list,skills list,convention-audit, plugin commands, andauthreject unsupported formats (e.g.-f xml) with a usage error (exit 2) instead of silently rendering a table.yml,markdown) and case (-f YAML) are accepted and normalized everywhere.Docs
docs/cli-reference.mdxandskills/webcmd-usage/SKILL.mdupdated to reflect the shared format behavior, rejection of unknown formats, aliases, andplugin list -f json→[].Testing
npm test: 5191 passed, 1 skipped (12 new tests).npm run buildOK;check:hosted-contractcontract bytes unchanged;check:typed-error-lint0 new.