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

@ -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
╰───────────────────────────────────────────────────────────────────╯
```

View file

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

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: