feat: auto install tui deps

This commit is contained in:
Brooklyn Nicholson 2026-04-08 09:46:40 -05:00
parent af077b2c0d
commit a3cfb1de86
3 changed files with 36 additions and 3 deletions

View file

@ -559,9 +559,18 @@ def _launch_tui():
tui_dir = PROJECT_ROOT / "ui-tui"
if not (tui_dir / "node_modules").exists():
print("TUI dependencies not installed.")
print(f" cd {tui_dir} && npm install")
sys.exit(1)
npm = shutil.which("npm")
if not npm:
print("npm not found — install Node.js to use the TUI.")
sys.exit(1)
print("Installing TUI dependencies…")
result = subprocess.run(
[npm, "install", "--silent"],
cwd=str(tui_dir), capture_output=True, text=True,
)
if result.returncode != 0:
print(f"npm install failed:\n{result.stderr}")
sys.exit(1)
tsx = tui_dir / "node_modules" / ".bin" / "tsx"
if tsx.exists():

View file

@ -721,6 +721,20 @@ function Install-NodeDeps {
}
}
# Install TUI dependencies
$tuiDir = "$InstallDir\ui-tui"
if (Test-Path "$tuiDir\package.json") {
Write-Info "Installing TUI dependencies..."
Push-Location $tuiDir
try {
npm install --silent 2>&1 | Out-Null
Write-Success "TUI dependencies installed"
} catch {
Write-Warn "TUI npm install failed (hermes --tui may not work)"
}
Pop-Location
}
# Install WhatsApp bridge dependencies
$bridgeDir = "$InstallDir\scripts\whatsapp-bridge"
if (Test-Path "$bridgeDir\package.json") {

View file

@ -916,6 +916,16 @@ install_node_deps() {
log_success "Browser engine installed"
fi
# Install TUI dependencies
if [ -f "$INSTALL_DIR/ui-tui/package.json" ]; then
log_info "Installing TUI dependencies..."
cd "$INSTALL_DIR/ui-tui"
npm install --silent 2>/dev/null || {
log_warn "TUI npm install failed (hermes --tui may not work)"
}
log_success "TUI dependencies installed"
fi
# Install WhatsApp bridge dependencies
if [ -f "$INSTALL_DIR/scripts/whatsapp-bridge/package.json" ]; then
log_info "Installing WhatsApp bridge dependencies..."