mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix(cli): route /yolo toggle through TUI-safe renderer
This commit is contained in:
parent
a99516afcf
commit
1ccd063786
1 changed files with 10 additions and 2 deletions
12
cli.py
12
cli.py
|
|
@ -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.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue