Skip to content

Commit 3b811eb

Browse files
committed
feat: add --reinstall-tui flag to force reinstall rogue-tui
This flag allows the user to force the reinstallation of the rogue-tui binary, even if it already exists. This is useful for development and testing purposes. Fixes #74
1 parent cfa4d44 commit 3b811eb

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

rogue/__main__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ def common_parser() -> ArgumentParser:
5353
default="localhost",
5454
help="Host for the example agent (default: localhost)",
5555
)
56+
parent_parser.add_argument(
57+
"--reinstall-tui",
58+
action="store_true",
59+
default=False,
60+
help="Force reinstallation of the TUI.",
61+
)
5662
parent_parser.add_argument(
5763
"--example-port",
5864
type=int,
@@ -199,7 +205,9 @@ def main() -> None:
199205
logger.info("Starting rogue-ai...")
200206

201207
# Step 1: Install rogue-tui if needed
202-
if not RogueTuiInstaller().install_rogue_tui():
208+
if not RogueTuiInstaller().install_rogue_tui(
209+
reinstall=args.reinstall_tui
210+
):
203211
logger.error("Failed to install rogue-tui. Exiting.")
204212
if example_process:
205213
example_process.terminate()

rogue/common/tui_installer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,12 @@ def _is_rogue_tui_installed(self) -> bool:
168168
def install_rogue_tui(
169169
self,
170170
upgrade: bool = False,
171+
reinstall: bool = False,
171172
) -> bool:
172173
"""Install rogue-tui from GitHub releases if not already installed."""
173174
console = Console()
174175
# Check if rogue-tui is already available
175-
if self._is_rogue_tui_installed() and not upgrade:
176+
if self._is_rogue_tui_installed() and not upgrade and not reinstall:
176177
console.print("[green]✅ rogue-tui is already installed.[/green]")
177178
return True
178179

0 commit comments

Comments
 (0)