feat(onboard): pass CLI args as initial config to interactive wizard
--workspace and --config now work as initial defaults in interactive mode: - The wizard starts with these values pre-filled - Users can view and modify them in the wizard - Final saved config reflects user's choices This makes the CLI args more useful for interactive sessions while still allowing full customization through the wizard.
This commit is contained in:
@@ -308,9 +308,8 @@ def onboard(
|
|||||||
from nanobot.cli.onboard_wizard import run_onboard
|
from nanobot.cli.onboard_wizard import run_onboard
|
||||||
|
|
||||||
try:
|
try:
|
||||||
config = run_onboard()
|
# Pass the config with workspace override applied as initial config
|
||||||
# Re-apply workspace override after wizard
|
config = run_onboard(initial_config=config)
|
||||||
config = _apply_workspace_override(config)
|
|
||||||
save_config(config, config_path)
|
save_config(config, config_path)
|
||||||
console.print(f"[green]✓[/green] Config saved at {config_path}")
|
console.print(f"[green]✓[/green] Config saved at {config_path}")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
@@ -938,14 +938,21 @@ def _show_summary(config: Config) -> None:
|
|||||||
# --- Main Entry Point ---
|
# --- Main Entry Point ---
|
||||||
|
|
||||||
|
|
||||||
def run_onboard() -> Config:
|
def run_onboard(initial_config: Config | None = None) -> Config:
|
||||||
"""Run the interactive onboarding questionnaire."""
|
"""Run the interactive onboarding questionnaire.
|
||||||
config_path = get_config_path()
|
|
||||||
|
|
||||||
if config_path.exists():
|
Args:
|
||||||
config = load_config()
|
initial_config: Optional pre-loaded config to use as starting point.
|
||||||
|
If None, loads from config file or creates new default.
|
||||||
|
"""
|
||||||
|
if initial_config is not None:
|
||||||
|
config = initial_config
|
||||||
else:
|
else:
|
||||||
config = Config()
|
config_path = get_config_path()
|
||||||
|
if config_path.exists():
|
||||||
|
config = load_config()
|
||||||
|
else:
|
||||||
|
config = Config()
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user