You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds JSON output support to the find and resolve CLI commands via a new --json / -j flag, enabling simple one-shot usage without requiring the JSONRPC server. The implementation reuses existing infrastructure (the collect reporter for gathering results) and maintains consistency with the JSONRPC API's camelCase field naming.
Changes:
Added --json flag to both find and resolve CLI commands for structured JSON output
Implemented find_envs_json function that collects environments/managers and outputs them as JSON
Modified resolve_report_stdio to output JSON when the flag is set, including null for missing environments
Suppressed timing/summary output in JSON mode to keep stdout clean (logs still go to stderr)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File
Description
crates/pet/src/main.rs
Added json: bool field to Find and Resolve command structs and passed it to the handler functions
crates/pet/src/lib.rs
Implemented JSON output logic: added find_envs_json function, modified resolve_report_stdio to support JSON, and imported necessary modules
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
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.
Adds a
--json/-jflag to thefindandresolveCLI commands for simple one-shot JSON output without needing the JSONRPC server.pet find --jsonoutputs{ "managers": [...], "environments": [...] }pet resolve --json <exe>outputs the resolvedPythonEnvironmentobject (ornull)--list,--verbose,--report-missing, etc.) continue to work as beforecamelCasefield naming consistent with the JSONRPC APIFixes #87