How to Install Gemini CLI on Windows
Follow this updated guide (June 26 2025) to install and configure Google's Gemini CLI on Windows 10/11. We cover three installation methods, first-time authentication, and common fixes.
1. Prerequisites
- Windows 10 (21H2+) or Windows 11
- PowerShell 5.1+ or Windows Terminal
- Node.js 18 LTS or later (
node -v
) - npm 9+ (
npm -v
) or compatible package manager - Administrator rights for global installs
2. Installation Methods
Method A — Run Once with npx
npx https://github.com/google-gemini/gemini-cli
Ideal for a quick trial—no files remain after the session ends.
Method B — Global Install via npm (Recommended)
# PowerShell / Command Prompt (Admin) npm install -g @google/gemini-cli # Verify installation gemini --version where gemini
Method C — Using winget
# Install Node.js first (if missing) winget install OpenJS.NodeJS.LTS --silent # Then install Gemini CLI globally via npm npm install -g @google/gemini-cli
Method D — Using Chocolatey
# Install Node.js LTS choco install nodejs-lts -y # Install Gemini CLI elevate npm install -g @google/gemini-cli
3. First-Time Setup
- Open
Windows Terminal
or PowerShell and rungemini
. - Select a theme when prompted.
- Choose Login with Google for the free tier (60 req/min & 1 000 req/day).
- Complete browser sign-in. If the callback fails, disable VPN split-tunneling or use global mode.
4. Using an API Key
Need more throughput? Get an API key from Google AI Studio and set it:
setx GEMINI_API_KEY "YOUR_API_KEY_HERE" /m # Restart the terminal, then: gemini "Hello, Gemini!"
5. Quick Start Commands
# Start interactive mode gemini # Single prompt mode gemini --prompt "Translate 'hello' to Spanish" # Attach local files (PowerShell) gemini "Summarise the code" @srcmain.ts
6. Troubleshooting
'gemini' is not recognized
# Ensure npm global folder is in PATH setx PATH "%PATH%;%AppData% pm"
Permission Denied (EPERM)
Run PowerShell or Command Prompt as Administrator, or use elevate
with Chocolatey.
Proxy / Firewall Blocks
npm config set proxy http://your-proxy:port npm config set https-proxy http://your-proxy:port
7. Next Steps
Head over to the Getting Started guide or dive into Command reference for advanced usage.