From 12540ba8cba90f98cca9cc254fba031be40b2534 Mon Sep 17 00:00:00 2001 From: Re-bin Date: Sat, 14 Feb 2026 00:58:43 +0000 Subject: [PATCH] feat: improve onboard with merge-or-overwrite prompt --- README.md | 2 +- nanobot/cli/commands.py | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 207df82..b5fdffa 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ ⚡️ Delivers core agent functionality in just **~4,000** lines of code — **99% smaller** than Clawdbot's 430k+ lines. -📏 Real-time line count: **3,582 lines** (run `bash core_agent_lines.sh` to verify anytime) +📏 Real-time line count: **3,583 lines** (run `bash core_agent_lines.sh` to verify anytime) ## 📢 News diff --git a/nanobot/cli/commands.py b/nanobot/cli/commands.py index 18c23b1..b8d58df 100644 --- a/nanobot/cli/commands.py +++ b/nanobot/cli/commands.py @@ -162,13 +162,19 @@ def onboard(): config_path = get_config_path() if config_path.exists(): - # Load existing config — Pydantic fills in defaults for any new fields - config = load_config() - save_config(config) - console.print(f"[green]✓[/green] Config refreshed at {config_path} (existing values preserved)") + console.print(f"[yellow]Config already exists at {config_path}[/yellow]") + console.print(" [bold]y[/bold] = overwrite with defaults (existing values will be lost)") + console.print(" [bold]N[/bold] = refresh config, keeping existing values and adding new fields") + if typer.confirm("Overwrite?"): + config = Config() + save_config(config) + console.print(f"[green]✓[/green] Config reset to defaults at {config_path}") + else: + config = load_config() + save_config(config) + console.print(f"[green]✓[/green] Config refreshed at {config_path} (existing values preserved)") else: - config = Config() - save_config(config) + save_config(Config()) console.print(f"[green]✓[/green] Created config at {config_path}") # Create workspace