Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lumen/command/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from ..ai import agents as lumen_agents, llm as lumen_llms # Aliased here
from ..ai.llm import LLM_PROVIDERS, get_available_llm
from ..ai.utils import parse_huggingface_url, render_template
from ..command.ascii_logo import lumen_ascii_logo

CMD_DIR = THIS_DIR / ".." / "command"

Expand Down Expand Up @@ -344,6 +345,8 @@ def main(args=None):
if len(sys.argv) == 1:
sys.argv.extend(["serve", "no_data"])

print("\n" + lumen_ascii_logo(use_color=sys.stderr.isatty()) + "\n", file=sys.stderr) # noqa: T201

sys.argv = transform_cmds(sys.argv)
args = parser.parse_args(sys.argv[1:])

Expand Down
54 changes: 54 additions & 0 deletions lumen/command/ascii_logo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
"""ASCII art banner for the Lumen CLI (auto-generated by scripts/generate_ascii_logo.py)."""
from __future__ import annotations

_ESC = "\033"


def _build_color_logo() -> str:
E = _ESC
G = f"{E}[38;2;245;185;35m"
R = f"{E}[0m"
lines = [
f" {E}[38;2;40;170;230m█{E}[0m{E}[38;2;40;170;230m█{E}[0m{E}[38;2;40;170;230m▄{E}[0m{E}[38;2;40;170;230m▄{E}[0m {E}[38;2;220;65;65m▄{E}[0m{E}[38;2;220;65;65m▄{E}[0m{E}[38;2;220;65;65m▄{E}[0m{E}[38;2;220;65;65m█{E}[0m",
f" {E}[38;2;40;170;230m█{E}[0m{E}[38;2;40;170;230m█{E}[0m{E}[38;2;40;170;230m█{E}[0m{E}[38;2;40;170;230m█{E}[0m{E}[38;2;40;170;230m█{E}[0m {E}[38;2;220;65;65m▄{E}[0m{E}[38;2;220;65;65m█{E}[0m{E}[38;2;220;65;65m█{E}[0m{E}[38;2;220;65;65m█{E}[0m{E}[38;2;220;65;65m█{E}[0m{E}[38;2;220;65;65m▀{E}[0m {G}██{R}",
f" {E}[38;2;40;170;230m█{E}[0m{E}[38;2;40;170;230m█{E}[0m{E}[38;2;40;170;230m█{E}[0m{E}[38;2;40;170;230m█{E}[0m{E}[38;2;40;170;230m█{E}[0m {E}[38;2;220;65;65m▄{E}[0m{E}[38;2;220;65;65m█{E}[0m{E}[38;2;220;65;65m█{E}[0m{E}[38;2;220;65;65m█{E}[0m{E}[38;2;220;65;65m█{E}[0m{E}[38;2;220;65;65m▀{E}[0m {G}██{R}",
f" {E}[38;2;40;170;230m▀{E}[0m{E}[38;2;40;170;230m▀{E}[0m{E}[38;2;40;170;230m█{E}[0m{E}[38;2;40;170;230m█{E}[0m {E}[38;2;220;65;65m█{E}[0m{E}[38;2;220;65;65m█{E}[0m{E}[38;2;220;65;65m▀{E}[0m{E}[38;2;220;65;65m▀{E}[0m {G}██{R}",
f" {G}██ ██ ██ ████████ ▄█▀▀▄ ██▄▄▄▄▄{R}",
f" {E}[38;2;145;55;175m▄{E}[0m{E}[38;2;145;55;175m▄{E}[0m{E}[38;2;145;55;175m█{E}[0m{E}[38;2;145;55;175m█{E}[0m{E}[38;2;145;55;175m█{E}[0m {E}[38;2;245;185;35m█{E}[0m{E}[38;2;245;185;35m█{E}[0m{E}[38;2;245;185;35m█{E}[0m{E}[38;2;245;185;35m▄{E}[0m{E}[38;2;245;185;35m▄{E}[0m {G}██ ██ ██ ██ ██ ██ ██▀▀▀ ██ ██{R}",
f" {E}[38;2;145;55;175m█{E}[0m{E}[38;2;145;55;175m█{E}[0m{E}[38;2;145;55;175m█{E}[0m{E}[38;2;145;55;175m█{E}[0m{E}[38;2;145;55;175m█{E}[0m {E}[38;2;245;185;35m█{E}[0m{E}[38;2;245;185;35m█{E}[0m{E}[38;2;245;185;35m█{E}[0m{E}[38;2;245;185;35m█{E}[0m{E}[38;2;245;185;35m█{E}[0m{E}[38;2;245;185;35m▄{E}[0m {G}██ ██ ██ ██ ██ ██ ██ ██ ██{R}",
f" {E}[38;2;145;55;175m█{E}[0m{E}[38;2;145;55;175m█{E}[0m{E}[38;2;145;55;175m█{E}[0m{E}[38;2;145;55;175m█{E}[0m{E}[38;2;145;55;175m█{E}[0m {E}[38;2;245;185;35m▀{E}[0m{E}[38;2;245;185;35m█{E}[0m{E}[38;2;245;185;35m█{E}[0m{E}[38;2;245;185;35m█{E}[0m{E}[38;2;245;185;35m█{E}[0m{E}[38;2;245;185;35m█{E}[0m {G}█████ ████ ██ ██ ██ ▀███▀ ██ ██{R}",
f" {E}[38;2;145;55;175m▀{E}[0m{E}[38;2;145;55;175m▀{E}[0m {E}[38;2;245;185;35m▀{E}[0m{E}[38;2;245;185;35m▀{E}[0m{E}[38;2;245;185;35m▀{E}[0m{E}[38;2;245;185;35m█{E}[0m",
]
return "\n".join(lines)


_PLAIN_LOGO = (
" ██▄▄ ▄▄▄█\n"
" █████ ▄████▀ ██\n"
" █████ ▄████▀ ██\n"
" ▀▀██ ██▀▀ ██\n"
" ██ ██ ██ ████████ ▄█▀▀▄ ██▄▄▄▄▄\n"
" ▄▄███ ███▄▄ ██ ██ ██ ██ ██ ██ ██▀▀▀ ██ ██\n"
" █████ █████▄ ██ ██ ██ ██ ██ ██ ██ ██ ██\n"
" █████ ▀█████ █████ ████ ██ ██ ██ ▀███▀ ██ ██\n"
" ▀▀ ▀▀▀█\n"
)


_color_cache: str | None = None


def lumen_ascii_logo(use_color: bool = True) -> str:
"""Return the Lumen ASCII logo as a multi-line string.

Parameters
----------
use_color : bool
Embed ANSI 24-bit color codes for blue, red, purple, and gold.
"""
if not use_color:
return _PLAIN_LOGO
global _color_cache # noqa: PLW0603
if _color_cache is None:
_color_cache = _build_color_logo()
return _color_cache
Loading