Complete Setup Guide
Follow this comprehensive guide to set up Gemini CLI from start to finish.
Setup Checklist
Step 1: Installation
Step 2: Get Your API Key
You'll need a Google AI API key to use Gemini CLI:
- 1.Visit Google AI Studio
- 2.Sign in with your Google account
- 3.Click "Get API key" and create a new key
- 4.Copy and save your API key securely
Step 3: Configure Your API Key
Choose one of these methods to configure your API key:
Quick Setup (Recommended)
gemini config set api-key YOUR_API_KEY
Environment Variable
export GEMINI_API_KEY="your-api-key-here"
Step 4: Test Your Setup
Verify that everything is working correctly:
Check version:
gemini --version
Test API connection:
gemini "Hello, Gemini! Please respond if you can hear me."
View configuration:
gemini config show
Optional: Advanced Configuration
Customize Gemini CLI behavior with these optional settings:
Set default model:
gemini config set model gemini-pro
Adjust temperature (creativity):
gemini config set temperature 0.8
Range: 0.0 (focused) to 1.0 (creative)
Set max tokens:
gemini config set max-tokens 2000
Common Setup Issues
API key not working
Solution: Verify key is correct and has proper permissions
Fix authentication errors →🎉 Setup Complete!
Congratulations! You've successfully set up Gemini CLI. Here's what you can do next: