Add JSON output, client overrides, and README#110
Closed
natefikru wants to merge 5 commits intonate/tvc-non-interactivefrom
Closed
Add JSON output, client overrides, and README#110natefikru wants to merge 5 commits intonate/tvc-non-interactivefrom
natefikru wants to merge 5 commits intonate/tvc-non-interactivefrom
Conversation
JSON output + stderr/stdout separation: - All commands define serializable output structs for --json mode - Status/progress messages routed to stderr via Output helper - Data/results to stdout as structured JSON or human-readable text - Fix double JSON output in deploy approve when posting to API Client override flags: - Add --api-key-file, --operator-key-file, --api-url, --org-id globals - build_client_with_overrides() bypasses login config when all overrides set - Partial overrides supported (override individual values from config) - Remove unused build_client() function README overhaul: - Complete command reference with flag tables - Environment variables table - Config file format documentation - Automation/CI usage examples with full pipeline script - Troubleshooting section Tests (16 -> 23): - JSON output validation for app init, deploy init, deploy approve - Valid JSON parsing test - Quiet mode suppression test - Client override flags in help output test
a5555c7 to
9b0b890
Compare
When --api-key-file is provided to tvc login, the CLI now reads the file and saves it to the org's api_key.json path instead of generating a new key. Supports both the dashboard export format (JSON array with camelCase fields like apiKeyName, curveType) and the CLI internal format (single JSON object with snake_case fields).
When a new keypair is generated during login, the key has not yet been registered in the dashboard, so credential verification will fail. Instead of exiting with a 401 error, save the config and key normally and print instructions to verify later with tvc login --org <alias>.
Author
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
Builds on #109 by adding machine-readable output and explicit client overrides to the TVC CLI, while preserving the simplified non-interactive behavior from the base branch.
Current behavior:
--jsonproduces structured stdout for commands that now have machine-readable result shapesstderr, while command results stay onstdout--api-key-file--api-url--org-idtvc loginstill treats first-time API key approval as a manual step, and the public key/setup instructions are always shown even under--quiettvc deploy approvekeeps the stricter base-branch behavior:--no-inputdoes not imply approval, and explicit--yesis still requiredThis branch intentionally does not include extra surface area that is not implemented or required:
--operator-key-fileTest Plan
cargo fmt -p tvccargo test -p tvc --test login --test deploy_approve --test global_flags --test json_outputDepends on: #109