Spaces:
Sleeping

neuronalis / cli.py
Nacho
HF deploy
5a6158c
Raw History Blame Contribute Delete
1.25 kB
from rich.console import Console
from rich.markdown import Markdown
from rich.panel import Panel
from rich.prompt import Prompt
from rich.syntax import Syntax
from rich.live import Live
console = Console()
class CLI:
def print_welcome(self):
console.print(Panel.fit(
"[bold blue]AI Coding Assistant[/bold blue]\n"
"[italic]Powered by Leaked System Prompts[/italic]",
border_style="blue"
))
def get_user_input(self):
return Prompt.ask("\n[bold green]You[/bold green]")
def print_assistant_response(self, text):
console.print("\n[bold purple]Assistant[/bold purple]")
console.print(Markdown(text))
def print_tool_execution(self, tool_name, args, result):
console.print(f"[dim]Executing {tool_name}...[/dim]")
if len(str(result)) > 500:
display_result = str(result)[:500] + "... (truncated)"
else:
display_result = str(result)
console.print(Panel(
display_result,
title=f"Tool: {tool_name}",
border_style="yellow",
expand=False
))
def print_error(self, message):
console.print(f"[bold red]Error:[/bold red] {message}")