Complete Setup Guide

Follow this comprehensive guide to set up Gemini CLI from start to finish.

Setup Checklist

Step 1: Installation

First, install Gemini CLI on your system:

Step 2: Get Your API Key

You'll need a Google AI API key to use Gemini CLI:

  1. 1.Visit Google AI Studio
  2. 2.Sign in with your Google account
  3. 3.Click "Get API key" and create a new key
  4. 4.Copy and save your API key securely
Detailed API key guide →

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"

See all configuration methods →

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

Command not found

Solution: Add npm global directory to PATH

See troubleshooting guide →

API key not working

Solution: Verify key is correct and has proper permissions

Fix authentication errors →

Rate limit exceeded

Solution: Wait or upgrade your API plan

Learn about rate limits →