Windows + Gemini CLI Setup Guide
Learn how to utilize the powerful analysis capabilities of Google Gemini directly in your Windows terminal and integrate it with the GIIP platform.
📋 Overview
Gemini CLI is a terminal-based AI conversational tool, useful for querying GIIP platform data or creating and executing local scripts. It is specifically optimized for analyzing complex system logs through Large Language Models (LLM).
🛠️ Installation & Setup Steps
1. Prerequisites
- Node.js: The latest LTS version must be installed.
- Google Cloud Account: Project ID and API access permissions are required.
2. Install CLI
Run the following command in Windows Command Prompt (CMD) or PowerShell:
npm install -g @google/generative-ai-cli
3. Auth & API Key Setup
- Issue an API key from Google AI Studio.
- Add
GOOGLE_API_KEYto your system environment variables or pass it as a parameter during execution.$env:GOOGLE_API_KEY="your-api-key"
4. GIIP Integration Setup
Modify cli-config.json in the GIIP agent folder so that Gemini CLI can reference the infrastructure metadata from GIIP.
🚀 Usage Examples
- Log Analysis:
gemini-cli "Analyze fatal errors in error.log file" - Script Generation:
gemini-cli "Write a PowerShell script to check server status" - Infra Query: Instantly check server specs in the terminal by integrating with GIIP APIs.
💡 Tips
- Check more options via
gemini-cli --help. - Use it alongside GIIP's
Antigravityto build a collaborative model where Gemini handles analysis and Antigravity handles execution.
Troubleshooting
| Symptom | Cause | Solution |
|---|---|---|
npm install -g @google/generative-ai-cli reports "command not found" | Node.js is not installed or not registered in PATH | Install the latest Node.js LTS and reopen the terminal |
gemini-cli fails with an authentication (401) error | GOOGLE_API_KEY is not set or is invalid | Set $env:GOOGLE_API_KEY and reissue the key from Google AI Studio |
GOOGLE_API_KEY disappears after a reboot | The environment variable was set for the current session only | Register GOOGLE_API_KEY permanently in the system environment variables |
| Gemini CLI cannot reference GIIP infrastructure metadata | cli-config.json is missing or misconfigured | Check and fix the cli-config.json values in the agent folder |
Version: 1.0
Last Updated: 2026-03-19
Source: giipv3/public/help/agent-setup-win-gemini.en.md