mirror of
https://github.com/MLSysBook/TinyTorch.git
synced 2026-03-11 21:03:34 -05:00
Apply consistent Rich formatting across all CLI commands
Standardize color usage to match TinyTorch CLI style guide: - Replace [blue] with [cyan] for all action/info messages (10 instances) - Replace [bold blue] with [bold cyan] for headers (1 instance) - Replace "bold blue" with "bold cyan" for table headers (3 instances) - Replace "bright_blue" with "bright_cyan" for panel borders (1 instance) Files updated: - tito/main.py: Welcome screen community commands now use [cyan] - tito/commands/login.py: URL display now uses [cyan] - tito/commands/protect.py: All 7 blue instances → cyan - tito/commands/milestone.py: Table headers → bold cyan - tito/commands/test.py: Table headers → bold cyan - tito/commands/grade.py: Border style → bright_cyan Result: Holistic CLI consistency with [cyan] for actions, [green] for success, [yellow] for warnings, [red] for errors across all 15+ commands.
This commit is contained in:
@@ -182,7 +182,7 @@ class GradeCommand(BaseCommand):
|
||||
" 9. tito grade export # Export grades\n\n"
|
||||
"[dim]Note: NBGrader must be installed and configured[/dim]",
|
||||
title="Grade Help",
|
||||
border_style="bright_blue"
|
||||
border_style="bright_cyan"
|
||||
)
|
||||
self.console.print(help_panel)
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ class LoginCommand(BaseCommand):
|
||||
try:
|
||||
port = receiver.start()
|
||||
target_url = f"{ENDPOINTS['cli_login']}?redirect_port={port}"
|
||||
self.console.print(f"Opening browser to: [blue]{target_url}[/blue]")
|
||||
self.console.print(f"Opening browser to: [cyan]{target_url}[/cyan]")
|
||||
self.console.print("Waiting for authentication...")
|
||||
webbrowser.open(target_url)
|
||||
tokens = receiver.wait_for_tokens()
|
||||
|
||||
@@ -89,7 +89,7 @@ class ProtectCommand(BaseCommand):
|
||||
|
||||
# Show header
|
||||
console.print(Panel.fit(
|
||||
"🛡️ [bold blue]TinyTorch Student Protection System[/bold blue]\n"
|
||||
"🛡️ [bold cyan]TinyTorch Student Protection System[/bold cyan]\n"
|
||||
"Prevents accidental edits to critical core functionality",
|
||||
border_style="blue"
|
||||
))
|
||||
@@ -112,7 +112,7 @@ class ProtectCommand(BaseCommand):
|
||||
|
||||
def _enable_protection(self, console: Console, args: Namespace) -> int:
|
||||
"""🔒 Enable comprehensive protection system."""
|
||||
console.print("[blue]🔒 Enabling TinyTorch Student Protection System...[/blue]")
|
||||
console.print("[cyan]🔒 Enabling TinyTorch Student Protection System...[/blue]")
|
||||
console.print()
|
||||
|
||||
protection_count = 0
|
||||
@@ -221,7 +221,7 @@ echo "✅ No auto-generated files being committed"
|
||||
"📝 GitHub will label files as 'Generated'\n"
|
||||
"🚫 Git prevents committing generated files\n"
|
||||
"⚙️ VSCode shows protection warnings\n\n"
|
||||
"[blue]Students are now protected from breaking CIFAR-10 training![/blue]",
|
||||
"[cyan]Students are now protected from breaking CIFAR-10 training![/blue]",
|
||||
border_style="green"
|
||||
))
|
||||
|
||||
@@ -262,10 +262,10 @@ echo "✅ No auto-generated files being committed"
|
||||
|
||||
def _show_protection_status(self, console: Console) -> int:
|
||||
"""🔍 Show current protection status."""
|
||||
console.print("[blue]🔍 TinyTorch Protection Status[/blue]")
|
||||
console.print("[cyan]🔍 TinyTorch Protection Status[/blue]")
|
||||
console.print()
|
||||
|
||||
table = Table(show_header=True, header_style="bold blue")
|
||||
table = Table(show_header=True, header_style="bold cyan")
|
||||
table.add_column("Protection Feature", style="cyan")
|
||||
table.add_column("Status", justify="center")
|
||||
table.add_column("Details", style="dim")
|
||||
@@ -335,7 +335,7 @@ echo "✅ No auto-generated files being committed"
|
||||
"""✅ Validate core functionality works correctly."""
|
||||
try:
|
||||
from tinytorch.core._validation import run_student_protection_checks
|
||||
console.print("[blue]🔍 Running comprehensive validation...[/blue]")
|
||||
console.print("[cyan]🔍 Running comprehensive validation...[/blue]")
|
||||
console.print()
|
||||
|
||||
try:
|
||||
@@ -358,7 +358,7 @@ echo "✅ No auto-generated files being committed"
|
||||
|
||||
def _quick_health_check(self, console: Console) -> int:
|
||||
"""⚡ Quick health check of critical functionality."""
|
||||
console.print("[blue]⚡ Quick Health Check[/blue]")
|
||||
console.print("[cyan]⚡ Quick Health Check[/blue]")
|
||||
console.print()
|
||||
|
||||
checks = []
|
||||
|
||||
@@ -560,7 +560,7 @@ class TestCommand(BaseCommand):
|
||||
console = self.console
|
||||
|
||||
# Summary table
|
||||
table = Table(title="Test Summary Report", show_header=True, header_style="bold blue")
|
||||
table = Table(title="Test Summary Report", show_header=True, header_style="bold cyan")
|
||||
table.add_column("Module", style="bold cyan", width=15)
|
||||
table.add_column("Status", width=10, justify="center")
|
||||
table.add_column("Inline Tests", width=12, justify="center")
|
||||
|
||||
@@ -202,8 +202,8 @@ Quick Start:
|
||||
help_text += " [yellow]tito module status[/yellow] View module progress\n"
|
||||
help_text += " [yellow]tito milestones status[/yellow] View unlocked capabilities\n"
|
||||
help_text += "\n[bold cyan]Community:[/bold cyan]\n"
|
||||
help_text += " [blue]tito community login[/blue] Log in to TinyTorch\n"
|
||||
help_text += " [blue]tito community leaderboard[/blue] View global leaderboard\n"
|
||||
help_text += " [cyan]tito community login[/cyan] Log in to TinyTorch\n"
|
||||
help_text += " [cyan]tito community leaderboard[/cyan] View global leaderboard\n"
|
||||
help_text += "\n[bold cyan]Help & Docs:[/bold cyan]\n"
|
||||
help_text += " [magenta]tito system doctor[/magenta] Check environment health\n"
|
||||
help_text += " [magenta]tito --help[/magenta] See all commands"
|
||||
|
||||
Reference in New Issue
Block a user