Skip to content

fix(cli): Improve OV CLI UX#2198

Draft
ehz0ah wants to merge 3 commits into
volcengine:mainfrom
ehz0ah:feat/ov-config-setup-shortcut
Draft

fix(cli): Improve OV CLI UX#2198
ehz0ah wants to merge 3 commits into
volcengine:mainfrom
ehz0ah:feat/ov-config-setup-shortcut

Conversation

@ehz0ah
Copy link
Copy Markdown
Contributor

@ehz0ah ehz0ah commented May 22, 2026

Description

This PR revamps the user-facing ov CLI setup and diagnostic experience. The main change is replacing the old ov config setup-cli flow with a guided ov config config manager that supports adding, editing, and deleting saved configs while preserving the existing ov config show, ov config validate, and ov config switch command semantics.

The PR also improves adjacent CLI surfaces so users have a consistent path from setup to validation and day-to-day operation: curated help output, cleaner error reporting, styled health/status views, and updated CLI setup documentation in English and Chinese.

Related Issue

N/A

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Test update

Changes Made

  • Replaced ov config setup-cli with an interactive ov config flow for add/edit/delete config management.
  • Added a backward-compatible config store layer for saved ovcli.conf.<name> configs, active config detection, safe deletion rules, and redacted config display.
  • Added validation-aware setup behavior for Volcengine Cloud and Self-Managed configs, including API-key validation and local no-key identity prompts.
  • Improved ov config validate and ov config switch with clearer terminal UI, validation before activation, and safer cancellation/back behavior.
  • Added styled output for ov health, default ov status, CLI error messages, top-level ov --help, and selected command/group help screens.
  • Added English and Chinese CLI setup docs and updated existing docs/README references from ov config setup-cli to ov config.

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

Commands run locally:

cargo test -p ov_cli
cargo build -p ov_cli
npm --prefix docs run docs:build
git diff --check
git diff --cached --check

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

@github-actions
Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🏅 Score: 85
🧪 PR contains tests
🔒 No security concerns identified
✅ No TODO sections
🔀 Multiple PR themes

Sub-PR theme: Add curated help UI for all CLI commands

Relevant files:

  • crates/ov_cli/src/help_ui.rs

Sub-PR theme: Add interactive config wizard and config management UI

Relevant files:

  • crates/ov_cli/src/config_wizard/mod.rs
  • crates/ov_cli/src/config_command_ui.rs
  • crates/ov_cli/src/config_wizard/wizard.rs
  • crates/ov_cli/src/config_wizard/store.rs

Sub-PR theme: Add polished error, health, and status UI components

Relevant files:

  • crates/ov_cli/src/error_ui.rs
  • crates/ov_cli/src/health_ui.rs
  • crates/ov_cli/src/status_ui.rs

⚡ Recommended focus areas for review

Possible Missing Parameter Passing

The health function in commands/system.rs now takes an Option<&Config> parameter. Ensure the call to commands::system::health in handlers::handle_health passes the config from the context.

@github-actions
Copy link
Copy Markdown

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Reduce redundant active config file reads when listing configs

Load the active config once before the loop instead of once per config entry. This
reduces redundant file reads from O(N) to O(1) when listing configs.

crates/ov_cli/src/config_wizard/store.rs [114-153]

 pub fn list_configs(&self) -> Result<Vec<ConfigEntry>> {
     let mut configs = Vec::new();
 
     if !self.config_dir.exists() {
         return Ok(configs);
     }
+
+    let active_config = self.load_active()?;
 
     for entry in fs::read_dir(&self.config_dir)? {
         let entry = entry?;
         let path = entry.path();
         if !path.is_file() {
             continue;
         }
 
         let Some(filename) = path.file_name().and_then(|value| value.to_str()) else {
             continue;
         };
         let Some(name) = filename.strip_prefix("ovcli.conf.") else {
             continue;
         };
         if name == "bak" || validate_config_name(name).is_err() {
             continue;
         }
 
         let Ok(config) = Config::from_file(&path.to_string_lossy()) else {
             continue;
         };
 
+        let is_active = if let Some(active) = &active_config {
+            configs_equivalent(active, &config)?
+        } else {
+            false
+        };
+
         configs.push(ConfigEntry {
             name: name.to_string(),
-            is_active: self.is_config_active(&config)?,
+            is_active,
             kind: ConfigKind::from_config(&config),
             config,
         });
     }
 
     configs.sort_by(|left, right| left.name.cmp(&right.name));
     normalize_active_config(&mut configs);
     Ok(configs)
 }
Suggestion importance[1-10]: 6

__

Why: The suggestion correctly identifies a redundant file I/O pattern where the active config is loaded once per config entry. Pre-loading the active config once reduces this to a single read, improving performance without changing functionality. The implementation is accurate and maintains the same logic.

Low

@ehz0ah ehz0ah changed the title Improve ov CLI configuration UX Revamp ov CLI configuration, help, and diagnostics UX May 22, 2026
@ehz0ah ehz0ah changed the title Revamp ov CLI configuration, help, and diagnostics UX fix(cli): Improve OV CLI UX May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant