From 9adbd03ff1e9aa28ce22795441cf3553950a436b Mon Sep 17 00:00:00 2001 From: Ahmed Allam Date: Mon, 8 Sep 2025 23:56:03 -0700 Subject: [PATCH] Improving CLI tool components --- strix/cli/app.py | 4 +++- strix/cli/main.py | 6 ++---- strix/cli/tool_components/python_renderer.py | 2 +- strix/cli/tool_components/scan_info_renderer.py | 8 ++++---- strix/cli/tool_components/terminal_renderer.py | 4 ++-- strix/cli/tool_components/thinking_renderer.py | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/strix/cli/app.py b/strix/cli/app.py index 286c9ed..b1c2d8b 100644 --- a/strix/cli/app.py +++ b/strix/cli/app.py @@ -556,7 +556,9 @@ class StrixCLIApp(App): # type: ignore[misc] current_verb = self._get_agent_verb(self.selected_agent_id) animated_text = self._get_animated_verb_text(self.selected_agent_id, current_verb) self._safe_widget_operation(status_text.update, animated_text) - self._safe_widget_operation(keymap_indicator.update, "[dim]ESC to stop agent[/dim]") + self._safe_widget_operation( + keymap_indicator.update, "[dim]ESC to stop | CTRL-C to quit and save[/dim]" + ) self._safe_widget_operation(status_display.remove_class, "hidden") self._start_dot_animation() else: diff --git a/strix/cli/main.py b/strix/cli/main.py index 60f7f25..7a10821 100644 --- a/strix/cli/main.py +++ b/strix/cli/main.py @@ -577,10 +577,8 @@ def pull_docker_image() -> None: return console.print() - console.print(f"[bold cyan]🐳 Pulling Docker image:[/bold cyan] {STRIX_IMAGE}") - console.print( - "[dim yellow]This only happens on first run and may take a few minutes...[/dim yellow]" - ) + console.print(f"[bold cyan]🐳 Pulling Docker image:[/] {STRIX_IMAGE}") + console.print("[dim yellow]This only happens on first run and may take a few minutes...[/]") console.print() with console.status("[bold cyan]Downloading image layers...", spinner="dots") as status: diff --git a/strix/cli/tool_components/python_renderer.py b/strix/cli/tool_components/python_renderer.py index 5ec6a6c..9cb8cc0 100644 --- a/strix/cli/tool_components/python_renderer.py +++ b/strix/cli/tool_components/python_renderer.py @@ -21,7 +21,7 @@ class PythonRenderer(BaseToolRenderer): header = " [bold #3b82f6]Python[/]" if code and action in ["new_session", "execute"]: - code_display = code[:250] + "..." if len(code) > 250 else code + code_display = code[:600] + "..." if len(code) > 600 else code content_text = f"{header}\n [italic white]{cls.escape_markup(code_display)}[/]" elif action == "close": content_text = f"{header}\n [dim]Closing session...[/]" diff --git a/strix/cli/tool_components/scan_info_renderer.py b/strix/cli/tool_components/scan_info_renderer.py index 161145e..8bd168c 100644 --- a/strix/cli/tool_components/scan_info_renderer.py +++ b/strix/cli/tool_components/scan_info_renderer.py @@ -28,11 +28,11 @@ class ScanStartInfoRenderer(BaseToolRenderer): @classmethod def _build_target_display(cls, target: dict[str, Any]) -> str: if target_url := target.get("target_url"): - return f"[bold #22c55e]{target_url}[/bold #22c55e]" + return f"[bold #22c55e]{target_url}[/]" if target_repo := target.get("target_repo"): - return f"[bold #22c55e]{target_repo}[/bold #22c55e]" + return f"[bold #22c55e]{target_repo}[/]" if target_path := target.get("target_path"): - return f"[bold #22c55e]{target_path}[/bold #22c55e]" + return f"[bold #22c55e]{target_path}[/]" return "[dim]unknown target[/dim]" @@ -49,7 +49,7 @@ class SubagentStartInfoRenderer(BaseToolRenderer): name = args.get("name", "Unknown Agent") task = args.get("task", "") - content = f"🤖 Spawned subagent [bold #22c55e]{name}[/bold #22c55e]" + content = f"🤖 Spawned subagent [bold #22c55e]{name}[/]" if task: content += f"\n Task: [dim]{task}[/dim]" diff --git a/strix/cli/tool_components/terminal_renderer.py b/strix/cli/tool_components/terminal_renderer.py index 2902376..8114f16 100644 --- a/strix/cli/tool_components/terminal_renderer.py +++ b/strix/cli/tool_components/terminal_renderer.py @@ -125,7 +125,7 @@ class TerminalRenderer(BaseToolRenderer): if not command: return "" - if len(command) > 200: - command = command[:197] + "..." + if len(command) > 400: + command = command[:397] + "..." return cls.escape_markup(command) diff --git a/strix/cli/tool_components/thinking_renderer.py b/strix/cli/tool_components/thinking_renderer.py index 04a5f84..74e1595 100644 --- a/strix/cli/tool_components/thinking_renderer.py +++ b/strix/cli/tool_components/thinking_renderer.py @@ -20,7 +20,7 @@ class ThinkRenderer(BaseToolRenderer): header = "🧠 [bold #a855f7]Thinking[/]" if thought: - thought_display = thought[:200] + "..." if len(thought) > 200 else thought + thought_display = thought[:600] + "..." if len(thought) > 600 else thought content = f"{header}\n [italic dim]{cls.escape_markup(thought_display)}[/]" else: content = f"{header}\n [italic dim]Thinking...[/]"