feat: Update CLI message and style (#7588)

* 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 <cristhian.lousa@gmail.com>
This commit is contained in:
Simon Duncan 2025-04-11 10:35:19 -05:00 committed by GitHub
commit ff197a4fa7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 19 additions and 19 deletions

View file

@ -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: