@echo off setlocal ENABLEEXTENSIONS title JimuAI Gemini CLI Setup echo ========================================== echo JimuAI Gemini CLI Setup (Windows) echo ========================================== echo. echo This script will: echo 1. Check Node.js / npm echo 2. Install Gemini CLI echo 3. Write your JimuAI Gemini config echo. where powershell >nul 2>nul if errorlevel 1 ( echo [ERROR] PowerShell not found. pause exit /b 1 ) echo [0/3] Preparing PowerShell execution policy... powershell -NoProfile -ExecutionPolicy Bypass -Command "$cur = Get-ExecutionPolicy -Scope CurrentUser; if ($cur -eq 'Undefined' -or $cur -eq 'Restricted' -or $cur -eq 'AllSigned') { try { Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned -Force; Write-Host 'CurrentUser execution policy set to RemoteSigned.' -ForegroundColor Green } catch { Write-Host 'Could not change execution policy automatically. If gemini.ps1 is blocked later, run: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser' -ForegroundColor Yellow } } else { Write-Host ('CurrentUser execution policy: ' + $cur) -ForegroundColor DarkGray }" echo [1/3] Checking environment... powershell -NoProfile -ExecutionPolicy Bypass -Command "iwr -useb https://code.jimuxyz.com/env_deploy/gemini-install.ps1 | iex" if errorlevel 1 goto :fail echo. echo [2/3] Installing Gemini CLI... powershell -NoProfile -ExecutionPolicy Bypass -Command "npm install -g @google/gemini-cli" if errorlevel 1 goto :fail echo. set "JIMU_KEY=" set /p JIMU_KEY=Paste your Gemini API Key (sk-...) and press Enter: if "%JIMU_KEY%"=="" ( echo [ERROR] API Key is required. goto :fail ) echo. echo [3/3] Writing Gemini config... powershell -NoProfile -ExecutionPolicy Bypass -Command "$env:JIMUXYZ_GEMINI_KEY='%JIMU_KEY%'; iwr -useb https://code.jimuxyz.com/env_deploy/gemini-deploy.ps1 | iex" if errorlevel 1 goto :fail echo. echo Setup finished. Open a new terminal and run: echo gemini echo If PowerShell still blocks gemini.ps1, run: echo Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser echo. pause exit /b 0 :fail echo. echo [ERROR] Setup did not finish successfully. echo Manual guide: echo https://code.jimuxyz.com/dashboard/geminicli-installation/windows echo. pause exit /b 1