diff --git a/cli.py b/cli.py index 7cc2302fb16..e4e85720fb2 100644 --- a/cli.py +++ b/cli.py @@ -3738,8 +3738,9 @@ class HermesCLI(CLIAgentSetupMixin, CLICommandsMixin): # streaming: stream tokens to the terminal as they arrive (display.streaming in config.yaml) self.streaming_enabled = CLI_CONFIG["display"].get("streaming", False) - # show_timestamps: prefix user and assistant labels with [HH:MM] + # show_timestamps: prefix user and assistant labels with timestamps self.show_timestamps = CLI_CONFIG["display"].get("timestamps", False) + self.timestamp_format = CLI_CONFIG["display"].get("timestamp_format", "%H:%M") self.final_response_markdown = str( CLI_CONFIG["display"].get("final_response_markdown", "strip") ).strip().lower() or "strip" @@ -5482,7 +5483,7 @@ class HermesCLI(CLIAgentSetupMixin, CLICommandsMixin): def _format_submitted_user_message_preview(self, user_input: str) -> str: """Format the submitted user-message scrollback preview.""" ts_suffix = ( - f" [dim]{datetime.now().strftime('%H:%M')}[/]" + f" [dim]{datetime.now().strftime(getattr(self, 'timestamp_format', '%H:%M'))}[/]" if getattr(self, "show_timestamps", False) else "" ) lines = user_input.split("\n") @@ -5783,7 +5784,7 @@ class HermesCLI(CLIAgentSetupMixin, CLICommandsMixin): except (ValueError, IndexError): self._stream_text_ansi = "" if self.show_timestamps: - label = f"{label} {datetime.now().strftime('%H:%M')}" + label = f"{label} {datetime.now().strftime(getattr(self, 'timestamp_format', '%H:%M'))}" w = self._scrollback_box_width() fill = w - 2 - HermesCLI._status_bar_display_width(label) _cprint(f"\n{_ACCENT}╭─{label}{'─' * max(fill - 1, 0)}╮{_RST}") @@ -6849,7 +6850,7 @@ class HermesCLI(CLIAgentSetupMixin, CLICommandsMixin): return "" try: from datetime import datetime - return f" [{datetime.fromtimestamp(float(ts)).strftime('%H:%M')}]" + return f" [{datetime.fromtimestamp(float(ts)).strftime(getattr(self, 'timestamp_format', '%H:%M'))}]" except (ValueError, OSError, TypeError): return "" @@ -12180,7 +12181,7 @@ class HermesCLI(CLIAgentSetupMixin, CLICommandsMixin): w = self._scrollback_box_width(getattr(self.console, "width", 80)) label = " ⚕ Hermes " if self.show_timestamps: - label = f"{label}{datetime.now().strftime('%H:%M')} " + label = f"{label}{datetime.now().strftime(getattr(self, 'timestamp_format', '%H:%M'))} " fill = w - 2 - HermesCLI._status_bar_display_width(label) _cprint(f"\n{_ACCENT}╭─{label}{'─' * max(fill - 1, 0)}╮{_RST}") _cprint(f"{_STREAM_PAD}{sentence.rstrip()}") diff --git a/hermes_cli/config.py b/hermes_cli/config.py index 9c897887801..3801ebd4d94 100644 --- a/hermes_cli/config.py +++ b/hermes_cli/config.py @@ -1717,7 +1717,8 @@ DEFAULT_CONFIG = { # Per-platform overrides via display.platforms..memory_notifications. "memory_notifications": "on", "streaming": False, - "timestamps": False, # Show [HH:MM] on user and assistant labels + "timestamps": False, # Show timestamp on user and assistant labels + "timestamp_format": "%H:%M", # strftime format for timestamps (e.g. "%b-%d %H:%M") "final_response_markdown": "strip", # render | strip | raw # Preserve recent classic CLI output across Ctrl+L, /redraw, and # terminal resize full-screen clears. Disable if a terminal emulator