feat(cli): add non-interactive config commands#2426
Merged
Conversation
PR Reviewer Guide 🔍(Review updated until commit dab13ee)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
|
Persistent review updated to latest commit dab13ee |
PR Code Suggestions ✨No code suggestions found for the PR. |
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
Adds non-interactive
ov configcommands for agent-driven provisioning while preserving the existing interactiveov configwizard for humans.This introduces prompt-free config management for saved CLI configs:
ov config add cloud ...ov config add self-managed ...ov config edit <name> ...ov config delete <name> [--force]ov config listov config switch <name>Motivation
Agents need a deterministic setup path that does not depend on keyboard navigation, terminal prompts, or first-run language selection. The interactive wizard remains the polished human path, while these subcommands provide explicit flags, stable JSON output, and clear failure modes for automation.
Behavior
ov configas the interactive wizard.ov config switchas the interactive selector.ov config switch <name>as an offline non-interactive activation command.addandeditbefore writing config files.list,delete, andswitch <name>as offline file operations.--api-key <value>flag is added.build_configfallback semantics for non-interactive writes soapi_keyandroot_api_keyare controlled explicitly.-o json.Config Rules
--accountand--userare optional; omitted identity is derived from the key/server behavior.http://127.0.0.1:1933.default/default.--forcerequires--activateso the saved and active config do not silently diverge.Notes
Saved and active config files remain separate writes: validate first, write the saved config, then write active
ovcli.confwhen activation is requested. This matches the current file model and avoids changing the config format in this PR.Test Plan
cargo test -p ov_clicargo build -p ov_cligit diff --checkAdditional smoke checks were run with a temporary HOME:
ov config list -o jsonov config delete missing -o jsonov config switch missing -o jsonov config add cloud --helpov config add self-managed --helpov config add cloud --name serverless --api-key-env OV_KEY --activate -o jsonov config edit serverless --api-key-env OV_KEY --activate -o json