Repository navigation
feat: add --json flag to proofline status - #70
Open
mnaveedkhtri-ui wants to merge 1 commit into
Open
mnaveedkhtri-ui wants to merge 1 commit into
mnaveedkhtri-ui wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Why
In automation scripts, CI/CD jobs, pre-commit/pre-push hooks, and developer environments (e.g. IDE extensions or local tooling), scripts need to verify if the Proofline CLI is authenticated and connected, check the active organization ID, and inspect token scopes or expiration time without fragile regex parsing of human-readable terminal output.
Currently, commands like
proofline review,proofline ci review,proofline stop, andproofline reviewssupport structured JSON output, whileproofline statusonly emitted plain text.What changed
Added
proofline status --json:StatusArgswith a--jsonflag toCommand::Status.--jsonis specified, outputs a structured JSON object containing:console: origin URLorganization_id: UUIDtoken: token source name (PROOFLINE_TOKENorOS keychain)scopes: token scopes (or null)expires_at: expiration timestamp (or null)expires_in_hours: remaining hours (or null)expired: boolean indicating expiration (or null)server: object withaccepted: booland human-readable server verdict/message--jsonis omitted.tests/http.rs(status_json_reports_structured_metadata_and_respects_server_outcome).--jsonflag onproofline statusinREADME.md.Example:
Output:
{ "console": "https://app.proofline.sh", "organization_id": "00000000-0000-0000-0000-000000000000", "token": "PROOFLINE_TOKEN", "scopes": "review:read review:write", "expires_at": null, "expires_in_hours": null, "expired": null, "server": { "accepted": true, "message": "accepted the token" } }Verification
tests/http.rs: Addedstatus_json_reports_structured_metadata_and_respects_server_outcomecovering both 200 OK acceptance and 401 Unauthorized refusal scenarios.--jsonis not provided.