mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-05-10 19:56:00 +00:00
refactor(cli): remove --no-interactive option from onboard command
This commit is contained in:
parent
35ee814139
commit
0c3d53e9f8
@ -215,35 +215,21 @@ def main(
|
|||||||
|
|
||||||
|
|
||||||
@app.command()
|
@app.command()
|
||||||
def onboard(interactive: bool = typer.Option(True, "--interactive/--no-interactive", help="Use interactive wizard")):
|
def onboard():
|
||||||
"""Initialize nanobot configuration and workspace."""
|
"""Initialize nanobot configuration and workspace with interactive wizard."""
|
||||||
from nanobot.config.loader import get_config_path, load_config, save_config
|
from nanobot.config.loader import get_config_path, load_config, save_config
|
||||||
from nanobot.config.schema import Config
|
from nanobot.config.schema import Config
|
||||||
|
|
||||||
config_path = get_config_path()
|
config_path = get_config_path()
|
||||||
|
|
||||||
if config_path.exists():
|
if config_path.exists():
|
||||||
if interactive:
|
|
||||||
config = load_config()
|
config = load_config()
|
||||||
else:
|
|
||||||
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:
|
else:
|
||||||
config = Config()
|
config = Config()
|
||||||
save_config(config)
|
save_config(config)
|
||||||
console.print(f"[green]✓[/green] Created config at {config_path}")
|
console.print(f"[green]✓[/green] Created config at {config_path}")
|
||||||
|
|
||||||
# Run interactive wizard if enabled
|
# Run interactive wizard
|
||||||
if interactive:
|
|
||||||
from nanobot.cli.onboard_wizard import run_onboard
|
from nanobot.cli.onboard_wizard import run_onboard
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -254,8 +240,6 @@ def onboard(interactive: bool = typer.Option(True, "--interactive/--no-interacti
|
|||||||
console.print(f"[red]✗[/red] Error during configuration: {e}")
|
console.print(f"[red]✗[/red] Error during configuration: {e}")
|
||||||
console.print("[yellow]Please run 'nanobot onboard' again to complete setup.[/yellow]")
|
console.print("[yellow]Please run 'nanobot onboard' again to complete setup.[/yellow]")
|
||||||
raise typer.Exit(1)
|
raise typer.Exit(1)
|
||||||
else:
|
|
||||||
console.print("[dim]Config template now uses `maxTokens` + `contextWindowTokens`; `memoryWindow` is no longer a runtime setting.[/dim]")
|
|
||||||
|
|
||||||
_onboard_plugins(config_path)
|
_onboard_plugins(config_path)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user