fix(cli): route /yolo toggle through TUI-safe renderer

This commit is contained in:
helix4u 2026-04-12 11:33:15 -06:00 committed by kshitij
parent a99516afcf
commit 1ccd063786

12
cli.py
View file

@ -6220,13 +6220,21 @@ class HermesCLI:
def _toggle_yolo(self): def _toggle_yolo(self):
"""Toggle YOLO mode — skip all dangerous command approval prompts.""" """Toggle YOLO mode — skip all dangerous command approval prompts."""
import os import os
from hermes_cli.colors import Colors as _Colors
current = bool(os.environ.get("HERMES_YOLO_MODE")) current = bool(os.environ.get("HERMES_YOLO_MODE"))
if current: if current:
os.environ.pop("HERMES_YOLO_MODE", None) os.environ.pop("HERMES_YOLO_MODE", None)
self.console.print(" ⚠ YOLO mode [bold red]OFF[/] — dangerous commands will require approval.") _cprint(
f" ⚠ YOLO mode {_Colors.BOLD}{_Colors.RED}OFF{_Colors.RESET}"
" — dangerous commands will require approval."
)
else: else:
os.environ["HERMES_YOLO_MODE"] = "1" os.environ["HERMES_YOLO_MODE"] = "1"
self.console.print(" ⚡ YOLO mode [bold green]ON[/] — all commands auto-approved. Use with caution.") _cprint(
f" ⚡ YOLO mode {_Colors.BOLD}{_Colors.GREEN}ON{_Colors.RESET}"
" — all commands auto-approved. Use with caution."
)
def _handle_reasoning_command(self, cmd: str): def _handle_reasoning_command(self, cmd: str):
"""Handle /reasoning — manage effort level and display toggle. """Handle /reasoning — manage effort level and display toggle.