fix(cli): let gateway use config port by default

Respect config.gateway.port when --port is omitted, while keeping CLI flags as the highest-precedence override.
This commit is contained in:
Protocol Zero
2026-03-09 20:12:11 +00:00
parent 99b896f5d4
commit 1284c7217e
2 changed files with 46 additions and 1 deletions
+2 -1
View File
@@ -290,7 +290,7 @@ def _load_runtime_config(config: str | None = None, workspace: str | None = None
@app.command()
def gateway(
port: int = typer.Option(18790, "--port", "-p", help="Gateway port"),
port: int | None = typer.Option(None, "--port", "-p", help="Gateway port"),
workspace: str | None = typer.Option(None, "--workspace", "-w", help="Workspace directory"),
verbose: bool = typer.Option(False, "--verbose", "-v", help="Verbose output"),
config: str | None = typer.Option(None, "--config", "-c", help="Path to config file"),
@@ -310,6 +310,7 @@ def gateway(
logging.basicConfig(level=logging.DEBUG)
config = _load_runtime_config(config, workspace)
port = port if port is not None else config.gateway.port
console.print(f"{__logo__} Starting nanobot gateway on port {port}...")
sync_workspace_templates(config.workspace_path)