Install Gemini CLI on Windows

Complete guide for installing Gemini CLI on Windows 10 and Windows 11.

Step 1: Install Node.js

Gemini CLI requires Node.js 16.0 or higher. Follow these steps:

  1. 1. Download Node.js:

    Visit nodejs.org and download the LTS version for Windows.

  2. 2. Run the installer:

    Double-click the downloaded .msi file and follow the installation wizard.

  3. 3. Verify installation:

    Open Command Prompt or PowerShell and run:

    node --version

    npm --version

Step 2: Install Gemini CLI

Open Command Prompt or PowerShell as Administrator:

# Install Gemini CLI globally

npm install -g @google/gemini-cli

Note: If you encounter permission errors, try running the command prompt as Administrator (right-click → Run as Administrator).

Step 3: Configure PATH (if needed)

If the gemini command is not recognized, you may need to add npm's global directory to your PATH:

  1. 1. Find npm global directory:

    npm config get prefix

  2. 2. Add to PATH:
    • Open System Properties → Advanced → Environment Variables
    • Under "User variables", select "Path" and click "Edit"
    • Add the npm global directory path (usually C:\Users\[username]\AppData\Roaming\npm)
    • Click OK and restart your terminal

Step 4: Verify Installation

Test that Gemini CLI is installed correctly:

# Check version

gemini --version

# View help

gemini --help

Alternative: Install via WSL (Recommended for Developers)

Windows Subsystem for Linux (WSL) provides a native Linux environment on Windows, offering better compatibility and performance for CLI tools like Gemini CLI.

1. Enable WSL:

# Run in PowerShell as Administrator

wsl --install

# Restart your computer when prompted

2. Set up Ubuntu (default WSL distro):

# After restart, Ubuntu will configure itself

# Create a username and password when prompted

3. Install Node.js in WSL:

curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -

sudo apt install nodejs

4. Install Gemini CLI:

npm install -g @google/gemini-cli

gemini --version

Why WSL? Many developer tools are built for Linux/macOS first. WSL gives you access to the full Linux ecosystem while keeping your Windows desktop. Gemini CLI runs natively in WSL without PATH or permission workarounds.

Enterprise Environment Setup

If you're behind a corporate firewall or need to configure Gemini CLI for your organization:

Configure Corporate Proxy:

# Set npm proxy

npm config set proxy http://proxy.company.com:8080

npm config set https-proxy http://proxy.company.com:8080

# Set environment variable for Gemini CLI

set HTTPS_PROXY=http://proxy.company.com:8080

Use a Private npm Registry:

# Point npm to your organization's registry

npm config set registry https://registry.your-company.com/

# Install from private registry

npm install -g @google/gemini-cli

SSL Certificate Issues:

# If your company uses custom SSL certificates

npm config set cafile /path/to/company-ca-cert.pem

# Or temporarily disable strict SSL (not recommended for production)

npm config set strict-ssl false

Installation Verification Checklist

Run these commands to confirm everything is set up correctly:

# 1. Check Node.js version (should be 16+)

node --version

# 2. Check npm version

npm --version

# 3. Check Gemini CLI version

gemini --version

# 4. Check Gemini CLI location

where gemini

# 5. Run a test command

gemini "Say hello"

If all commands return expected output, your installation is complete. If any command fails, check the troubleshooting section below.

Common Issues and Solutions

Error: EACCES permission denied

Solution: Run Command Prompt as Administrator

# Or configure npm to use a different directory

npm config set prefix "%USERPROFILE%\npm-global"

'gemini' is not recognized as a command

Solution: Add npm global directory to PATH (see Step 3)

Network or proxy issues

Solution: Configure npm proxy settings:

npm config set proxy http://proxy.company.com:8080

npm config set https-proxy http://proxy.company.com:8080

Related Questions

Next Steps

Now that Gemini CLI is installed, configure your API key to start using it: