chore: Improve --json support accross multiple commands#347
Open
blainekasten wants to merge 1 commit intonextfrom
Open
chore: Improve --json support accross multiple commands#347blainekasten wants to merge 1 commit intonextfrom
blainekasten wants to merge 1 commit intonextfrom
Conversation
5123ab7 to
5f5fcf3
Compare
5f5fcf3 to
45fcff4
Compare
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.
Summary
Standardizes CLI JSON output on
console.print_json(openapi_dumps(...).decode("utf-8"))so serialization matches the SDK (datetime, Pydantic, etc.) and stdout stays valid JSON for tooling likejq.Changes
json.dumps,rich.print_json, and raw JSON strings with the sharedopenapi_dumps+console.print_jsonpattern across touched commands (files upload/check paths, fine-tuning list/cancel, endpoints & storage retrieve, evals retrieve JSON path, jig helpers).telemetry status,enable, anddisableaccept the global--jsonflag and emit single JSON objects (telemetry statusincludes structured disabled/enabled +reasonwhere relevant).files retrieve-content:--jsonemits jq-friendly payloads: stdout-only (contentorcontent_base64), output-only (id+path), or combined{content|content_base64, path}when both--stdoutand--outputare set so we never print two unrelated JSON documents on one invocation._print_cli_resultand detach deploy summary useopenapi_dumps;beta jig volumes describeprints human-readable fields without--jsonand full JSON with--json(replacing always-JSON behavior for the default path).test_telemetry_json_mode_pipes_to_jq.Notes
openapi_dumpsin_utils/_json.pyremains the single JSON serializer for CLI output (no parallel “custom date” path).jqtests that hit a mock API base URL still require that environment in CI.Closes DX-368 (or link the Linear issue).