From 4e6e2739cefc5a4e2e018c156b1e98e53f774b16 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Fri, 13 Mar 2026 17:43:16 -0500 Subject: [PATCH] feat: redesign startup output with URLs, bind warning - Display Local and Network URLs at startup (Vite-style) - Auto-detect LAN IP when binding to 0.0.0.0 - Show generated API key inline with bold label - Print yellow warning when listening on all interfaces - Bump to 0.11.15 --- CHANGELOG.md | 7 +++++++ open_terminal/cli.py | 28 ++++++++++++++++++++++++---- pyproject.toml | 2 +- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91587af..461afba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). +## [0.11.15] - 2026-03-13 + +### Changed + +- 🖥️ **Redesigned startup output** — the CLI now displays Local and Network URLs, the generated API key, and a bind warning in a clean, modern key-value layout with color-coded labels. Network URL auto-detects your LAN IP when binding to `0.0.0.0`. +- 🔒 **Bind warning** — a yellow warning is printed at startup when binding to `0.0.0.0`, nudging bare-metal users to restrict access with `--host 127.0.0.1`. + ## [0.11.14] - 2026-03-13 ### Fixed diff --git a/open_terminal/cli.py b/open_terminal/cli.py index 0a916a2..7143698 100644 --- a/open_terminal/cli.py +++ b/open_terminal/cli.py @@ -92,12 +92,32 @@ def run( os.environ["OPEN_TERMINAL_CORS_ALLOWED_ORIGINS"] = cors_allowed_origins click.echo(BANNER) - if generated: - click.echo("=" * 60) - click.echo(f" API Key: {api_key}") - click.echo("=" * 60) + + # -- Startup info block -- + local_url = f"http://{'localhost' if host in ('0.0.0.0', '127.0.0.1') else host}:{port}" + + click.echo(f" {click.style('Local:', bold=True)} {click.style(local_url, fg='cyan')}") + if host == "0.0.0.0": + import socket + try: + s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + s.connect(("8.8.8.8", 80)) + network_ip = s.getsockname()[0] + s.close() + click.echo(f" {click.style('Network:', bold=True)} http://{network_ip}:{port}") + except Exception: + pass click.echo() + if generated: + click.echo(f" {click.style('API Key:', bold=True)} {api_key}") + click.echo() + + if host == "0.0.0.0": + click.echo(click.style(" Warning: Listening on all network interfaces.", fg="yellow")) + click.echo(click.style(" Use --host 127.0.0.1 to restrict to this machine.", dim=True)) + click.echo() + from open_terminal.env import UVICORN_LOOP uvicorn.run("open_terminal.main:app", host=host, port=port, loop=UVICORN_LOOP) diff --git a/pyproject.toml b/pyproject.toml index c57b43c..2f10b0b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "open-terminal" -version = "0.11.14" +version = "0.11.15" description = "A remote terminal API." readme = "README.md" authors = [