feat(cli): structured JSON output for read-only commands#40489
feat(cli): structured JSON output for read-only commands#40489yury-s wants to merge 1 commit intomicrosoft:mainfrom
Conversation
In --json mode, the read-only commands now emit structured payloads
instead of the formatted text:
- cookie-list, cookie-get: cookie object(s) or null
- localstorage-list/get, sessionstorage-list/get: items or value
- route-list: array of route entries
- request-headers, response-headers: HeadersArray ({name, value}[])
preserving original case and duplicate header names
- request-body, response-body: body string (or null)
- request: structured RequestDetails (method, url, status, headers, ...)
When --filename is set, the JSON result is { file: relativePath },
mirroring the snapshot pattern. The text rendering for non-JSON modes
is preserved.
Test results for "MCP"36 failed 6863 passed, 927 skipped Merge workflow run. |
Summary
--jsonmode, read-only CLI commands now emit structured payloads instead of formatted text:cookie-list,cookie-get: cookie objects (ornull)localstorage-*,sessionstorage-*: items / valueroute-list: array of route entriesrequest-headers,response-headers:HeadersArray(preserves original case, duplicate header names)request-body,response-body: body string (ornull)request: structuredRequestDetails--filename, JSON result is{ file: relativePath }(mirrors the snapshot pattern).