From ff197a4fa79c94e54f6beb4be2c67105d78e5475 Mon Sep 17 00:00:00 2001 From: Simon Duncan Date: Fri, 11 Apr 2025 10:35:19 -0500 Subject: [PATCH] feat: Update CLI message and style (#7588) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update CLI message and style * [autofix.ci] apply automated fixes * 📝 (langflow/__main__.py): update access link to include protocol dynamically based on input --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: cristhianzl --- .devcontainer/README.md | 8 ++++---- DEVELOPMENT.md | 10 +++++----- src/backend/base/langflow/__main__.py | 20 ++++++++++---------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.devcontainer/README.md b/.devcontainer/README.md index 1ec113bc3..7566787b4 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -45,15 +45,15 @@ The service will start, and you will may notice a dialog in the lower right indi ``` ╭───────────────────────────────────────────────────────────────────╮ -│ Welcome to ⛓ Langflow │ +│ Welcome to Langflow │ │ │ │ │ -│ Collaborate, and contribute at our GitHub Repo 🌟 │ +│ Collaborate and contribute: 🌟 GitHub Repo • 💬 Join Discord │ │ │ │ We collect anonymous usage data to improve Langflow. │ -│ You can opt-out by setting DO_NOT_TRACK=true in your environment. │ +│ To opt out, set: DO_NOT_TRACK=true in your environment. │ │ │ -│ Access http://127.0.0.1:7860 │ +│ 🟢 Open Langflow → http://127.0.0.1:7860 │ ╰───────────────────────────────────────────────────────────────────╯ ``` diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 4cf392482..61682ad5d 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -69,15 +69,15 @@ Once the application is running, the command output should look similar to: ``` ╭───────────────────────────────────────────────────────────────────╮ -│ Welcome to ⛓ Langflow │ +│ Welcome to Langflow │ │ │ │ │ -│ Collaborate, and contribute at our GitHub Repo 🌟 │ +│ Collaborate and contribute: 🌟 GitHub Repo • 💬 Join Discord │ │ │ │ We collect anonymous usage data to improve Langflow. │ -│ You can opt-out by setting DO_NOT_TRACK=true in your environment. │ +│ To opt out, set: DO_NOT_TRACK=true in your environment. │ │ │ -│ Access http://127.0.0.1:7860 │ +│ 🟢 Open Langflow → http://127.0.0.1:7860 │ ╰───────────────────────────────────────────────────────────────────╯ ``` @@ -236,4 +236,4 @@ There are some files that change without you having made changes: * Files in `src/backend/base/langflow/initial_setup/starter_projects` modify after `langflow run`; these are formatting changes. Feel free to commit (or ignore) them. * `uv.lock` and `src/frontend/package-lock.json` files can be modified by `make` targets; changes should not be committed by individual contributors. * You can exclude these from consideration in git: `git update-index --assume-unchanged uv.lock src/frontend/package-lock.json` - * You can re-include these from consideration in git: `git update-index --no-assume-unchanged uv.lock src/frontend/package-lock.json` + * You can re-include these from consideration in git: `git update-index --no-assume-unchanged uv.lock src/frontend/package-lock.json` \ No newline at end of file diff --git a/src/backend/base/langflow/__main__.py b/src/backend/base/langflow/__main__.py index aec731fa7..9b78982d6 100644 --- a/src/backend/base/langflow/__main__.py +++ b/src/backend/base/langflow/__main__.py @@ -19,7 +19,6 @@ from multiprocess import cpu_count from multiprocess.context import Process from packaging import version as pkg_version from rich import box -from rich import print as rprint from rich.console import Console from rich.panel import Panel from rich.table import Table @@ -395,25 +394,26 @@ def print_banner(host: str, port: int, protocol: str) -> None: if notices: notices.append(f"Run '{pip_command}' to update.") - styled_notices = [f"[bold]{notice}[/bold]" for notice in notices if notice] + [f"[bold]{notice}[/bold]" for notice in notices if notice] styled_package_name = stylize_text( package_name, package_name, is_prerelease=any("pre-release" in notice for notice in notices) ) - title = f"[bold]Welcome to :chains: {styled_package_name}[/bold]\n" + title = f"[bold]Welcome to {styled_package_name}[/bold]\n" info_text = ( - "Collaborate, and contribute at our " - "[bold][link=https://github.com/langflow-ai/langflow]GitHub Repo[/link][/bold] :star2:" + "Collaborate and contribute: " + ":star2:[bold][link=https://github.com/langflow-ai/langflow]GitHub Repo[/link][/bold] • " + ":speech_balloon:[bold][link=https://discord.com/invite/EqksyE2EX9]Join Discord[/link][/bold]" ) telemetry_text = ( "We collect anonymous usage data to improve Langflow.\n" - "You can opt-out by setting [bold]DO_NOT_TRACK=true[/bold] in your environment." + "To opt out, set: [bold]DO_NOT_TRACK=true[/bold] in your environment." ) - access_link = f"Access [link={protocol}://{host}:{port}]{protocol}://{host}:{port}[/link]" + access_link = f"[bold]🟢 Open Langflow →[/bold] [link={protocol}://{host}:{port}]{protocol}://{host}:{port}[/link]" - panel_content = "\n\n".join([title, *styled_notices, info_text, telemetry_text, access_link]) - panel = Panel(panel_content, box=box.ROUNDED, border_style="blue", expand=False) - rprint(panel) + message = f"{title}\n{info_text}\n\n{telemetry_text}\n\n{access_link}" + + console.print(Panel.fit(message, border_style="#7528FC", padding=(1, 2))) def run_langflow(host, port, log_level, options, app) -> None: