Skip to content

Commit 8f97c9e

Browse files
authored
feat: redesign CLI welcome banner with ASP logo (#860)
* feat: redesign CLI welcome banner with ASP logo and random mottos - Replace plain text banner with colored ASP ASCII art in a Rich Panel - Add random fun mottos displayed on each run - Show compact one-liner in auto-approve/programmatic mode - Add banner to setup-cicd and register-gemini-enterprise commands * add locks * add locks
1 parent 6eafeea commit 8f97c9e

File tree

7 files changed

+112
-37
lines changed

7 files changed

+112
-37
lines changed

agent_starter_pack/cli/commands/create.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def create(
335335

336336
# Display welcome banner (unless skipped)
337337
if not skip_welcome:
338-
display_welcome_banner(agent, agent_garden=agent_garden)
338+
display_welcome_banner(agent, agent_garden=agent_garden, quiet=auto_approve)
339339

340340
# Handle missing project name
341341
if not project_name:

agent_starter_pack/cli/commands/enhance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ def enhance(
10301030

10311031
# Display welcome banner for enhance command (unless skipped by nested command)
10321032
if not skip_welcome:
1033-
display_welcome_banner(enhance_mode=True)
1033+
display_welcome_banner(enhance_mode=True, quiet=auto_approve)
10341034

10351035
# Check for saved config and offer to reuse it
10361036
# This handles both version locking AND reusing previous settings

agent_starter_pack/cli/commands/register_gemini_enterprise.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
get_user_agent,
3535
get_x_goog_api_client_header,
3636
)
37+
from agent_starter_pack.cli.utils.logging import display_welcome_banner
3738

3839
# TOML parser - use standard library for Python 3.11+, fallback to tomli
3940
if sys.version_info >= (3, 11):
@@ -1354,7 +1355,7 @@ def register_gemini_enterprise(
13541355
This command can run interactively or accept all parameters via command-line options.
13551356
If key parameters are missing, it will prompt the user for input.
13561357
"""
1357-
console.print("\n🤖 Agent → Gemini Enterprise Registration\n")
1358+
display_welcome_banner(register_mode=True, quiet=yes)
13581359

13591360
# Read metadata file once to determine agent type and deployment target
13601361
metadata = None

agent_starter_pack/cli/commands/setup_cicd.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
is_github_authenticated,
3333
run_command,
3434
)
35+
from agent_starter_pack.cli.utils.logging import display_welcome_banner
3536

3637
console = Console()
3738

@@ -596,6 +597,7 @@ def setup_cicd(
596597
cicd_runner: str | None = None,
597598
) -> None:
598599
"""Set up CI/CD infrastructure using Terraform."""
600+
display_welcome_banner(setup_cicd_mode=True, quiet=auto_approve)
599601

600602
# Validate mutually exclusive flags
601603
if create_repository and use_existing_repository:

agent_starter_pack/cli/utils/logging.py

Lines changed: 104 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,69 +12,141 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import importlib.metadata
16+
import random
1517
import sys
1618
from collections.abc import Callable
1719
from functools import wraps
1820
from typing import Any, TypeVar, cast
1921

2022
from rich.console import Console
23+
from rich.panel import Panel
24+
from rich.table import Table
2125

2226
console = Console()
2327

28+
MOTTOS = [
29+
"Your agents are cleared for takeoff.",
30+
"Launching agents into production, one deploy at a time.",
31+
"Houston, we have an agent.",
32+
"To production... and beyond!",
33+
"One small step for code, one giant leap for agents.",
34+
"Fueling your AI agents with Google Cloud.",
35+
"3... 2... 1... Agent deployed!",
36+
"The sky is not the limit when you have agents.",
37+
]
38+
2439
F = TypeVar("F", bound=Callable[..., Any])
2540

2641

42+
def _get_version() -> str:
43+
"""Get the package version, with fallback to 'dev'."""
44+
try:
45+
return importlib.metadata.version("agent-starter-pack")
46+
except Exception:
47+
return "dev"
48+
49+
50+
def _build_banner(line1: str, version: str, motto: str) -> Panel:
51+
"""Build a compact banner panel with ASP ASCII art logo."""
52+
a = "bold blue"
53+
s = "bold cyan"
54+
p = "bold magenta"
55+
logo = (
56+
f"[{a}]▄▀▄[/] [{s}]█▀▀[/] [{p}]█▀▄[/]\n"
57+
f"[{a}]█▀█[/] [{s}]▀▀█[/] [{p}]█▀▀[/]\n"
58+
f"[{a}]▀ ▀[/] [{s}]▀▀▀[/] [{p}]▀[/] "
59+
)
60+
right_text = f' [italic dim]"{motto}"[/]\n\n {line1}'
61+
table = Table(
62+
show_header=False,
63+
show_edge=False,
64+
show_lines=False,
65+
padding=0,
66+
pad_edge=False,
67+
)
68+
table.add_column(width=12)
69+
table.add_column()
70+
table.add_row(logo, right_text)
71+
return Panel(
72+
table,
73+
title=f"Agent Starter Pack v{version}",
74+
border_style="blue",
75+
padding=(1, 2),
76+
)
77+
78+
2779
def display_welcome_banner(
28-
agent: str | None = None, enhance_mode: bool = False, agent_garden: bool = False
80+
agent: str | None = None,
81+
enhance_mode: bool = False,
82+
agent_garden: bool = False,
83+
setup_cicd_mode: bool = False,
84+
register_mode: bool = False,
85+
quiet: bool = False,
2986
) -> None:
3087
"""Display the Agent Starter Pack welcome banner.
3188
3289
Args:
3390
agent: Optional agent specification to customize the welcome message
3491
enhance_mode: Whether this is for enhancement mode
3592
agent_garden: Whether this deployment is from Agent Garden
93+
setup_cicd_mode: Whether this is for CI/CD setup
94+
register_mode: Whether this is for Gemini Enterprise registration
95+
quiet: If True, skip the banner (e.g. in auto-approve/programmatic mode)
3696
"""
97+
version = _get_version()
98+
if quiet:
99+
console.print(f"[bold blue]Agent Starter Pack[/] [dim]v{version}[/]")
100+
return
101+
102+
motto = random.choice(MOTTOS)
103+
37104
if enhance_mode:
38-
console.print(
39-
"\n=== Google Cloud Agent Starter Pack 🚀===",
40-
style="bold blue",
105+
panel = _build_banner(
106+
line1="Enhancing your project with production-ready capabilities!",
107+
version=version,
108+
motto=motto,
41109
)
42-
console.print(
43-
"Enhancing your existing project with production-ready agent capabilities!\n",
44-
style="green",
110+
elif setup_cicd_mode:
111+
panel = _build_banner(
112+
line1="Setting up CI/CD infrastructure for your agent!",
113+
version=version,
114+
motto=motto,
45115
)
46-
elif agent_garden:
47-
console.print(
48-
"\n=== Welcome to Agent Garden! 🌱 ===",
49-
style="bold blue",
50-
)
51-
console.print(
52-
"Powered by [link=https://goo.gle/agent-starter-pack]Google Cloud - Agent Starter Pack [/link]\n",
116+
elif register_mode:
117+
panel = _build_banner(
118+
line1="Registering your agent to Gemini Enterprise!",
119+
version=version,
120+
motto=motto,
53121
)
54-
console.print(
55-
"This tool will help you deploy production-ready AI agents from Agent Garden to Google Cloud!\n"
122+
elif agent_garden:
123+
panel = _build_banner(
124+
line1=(
125+
"Powered by [link=https://goo.gle/agent-starter-pack]"
126+
"Google Cloud - Agent Starter Pack[/link]"
127+
),
128+
version=version,
129+
motto=motto,
56130
)
57131
elif agent and agent.startswith("adk@"):
58-
console.print(
59-
"\n=== Welcome to [link=https://github.com/google/adk-samples]google/adk-samples[/link]! ✨ ===",
60-
style="bold blue",
61-
)
62-
console.print(
63-
"Powered by [link=https://goo.gle/agent-starter-pack]Google Cloud - Agent Starter Pack [/link]\n",
64-
)
65-
console.print(
66-
"This tool will help you create an end-to-end production-ready AI agent in Google Cloud!\n"
132+
panel = _build_banner(
133+
line1=(
134+
"Powered by [link=https://goo.gle/agent-starter-pack]"
135+
"Google Cloud - Agent Starter Pack[/link]"
136+
),
137+
version=version,
138+
motto=motto,
67139
)
68140
else:
69-
console.print(
70-
"\n=== Google Cloud Agent Starter Pack 🚀===",
71-
style="bold blue",
72-
)
73-
console.print("Welcome to the Agent Starter Pack!")
74-
console.print(
75-
"This tool will help you create an end-to-end production-ready AI agent in Google Cloud!\n"
141+
panel = _build_banner(
142+
line1="Create production-ready AI agents on Google Cloud!",
143+
version=version,
144+
motto=motto,
76145
)
77146

147+
console.print()
148+
console.print(panel)
149+
78150

79151
def handle_cli_error(f: F) -> F:
80152
"""Decorator to handle CLI errors gracefully.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "agent-starter-pack"
3-
version = "0.39.0"
3+
version = "0.38.0"
44
description = "CLI to bootstrap production-ready Google Cloud GenAI agent projects from templates."
55
authors = [
66
{ name = "Google LLC", email = "agent-starter-pack@google.com" },

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)