From 21c3e9973ac7084e2bc591486e0dabbc8f940bc2 Mon Sep 17 00:00:00 2001 From: teknium1 Date: Thu, 19 Feb 2026 01:39:01 -0800 Subject: [PATCH] feat: enhance CLI output formatting with dynamic borders - Added dynamic top and bottom borders to the response output in the HermesCLI, improving visual structure and readability. - Implemented width adjustments for the borders based on console size, ensuring consistent appearance across different terminal environments. - This change enhances the overall user experience by providing a clearer separation of messages in the CLI. --- cli.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cli.py b/cli.py index 28012e2d9..634900e17 100755 --- a/cli.py +++ b/cli.py @@ -1465,6 +1465,8 @@ class HermesCLI: # Add user message to history self.conversation_history.append({"role": "user", "content": message}) + w = min(self.console.width, 80) + _cprint(f"{_GOLD}{'─' * w}{_RST}") print(flush=True) try: @@ -1522,11 +1524,18 @@ class HermesCLI: response = response + "\n\n---\n_[Interrupted - processing new message]_" if response: + w = min(self.console.width, 80) + label = " ⚕ Hermes " + fill = w - 2 - len(label) # 2 for ╭ and ╮ + top = f"╭─{label}{'─' * max(fill - 1, 0)}╮" + bot = f"╰{'─' * (w - 2)}╯" + print() - _cprint(f"{_GOLD}⚕ Hermes{_RST}") + _cprint(f"{_GOLD}{top}{_RST}") print() print(response) print() + _cprint(f"{_GOLD}{bot}{_RST}") # If we have a pending message from interrupt, re-queue it for process_loop # instead of recursing (avoids unbounded recursion from rapid interrupts)