Search docs...

Start typing to search documentation

GeminiGemini CLI

Gemini CLI Integration

Use UnoRouter with the Gemini CLI and any Google GenAI-compatible client. Access Gemini models alongside Claude and GPT.

What is Gemini CLI?

Gemini CLI is an open-source AI coding agent from Google that runs directly in your terminal, bringing the power of Gemini models to your development workflow.

Quick Start

Set these environment variables to use UnoRouter with the Gemini CLI:

powershell
$env:GEMINI_API_KEY="YOUR_API_KEY"
$env:GOOGLE_GEMINI_BASE_URL="https://api.unorouter.ai"

# Then run Gemini CLI
gemini

Sign in to auto-fill your API key

Key Features

  • Agentic CapabilitiesEdit files, run shell commands, and manage your codebase autonomously with natural language instructions.
  • Multimodal InputProcess text, images, and code together for richer context and more accurate results.
  • MCP IntegrationConnect to external tools and services through the Model Context Protocol for extended functionality.
  • Fully CustomizableTailor system prompts, tool permissions, and model settings to match your workflow.

Quick Setup with CC Switch

Use CC Switch to configure your provider with one click. It automatically sets the API endpoint and provider name for you.

Sign in to auto-fill your API key

Or use the CC Switch CLI:

bash
cc-switch provider add

Installation

Windows support requires WSL (Windows Subsystem for Linux). Install WSL first, then run the installation command inside WSL.

powershell
npm install -g @google/gemini-cli

Configuration

Configure Gemini CLI to use UnoRouter as your API provider by setting environment variables:

Permanent Config File (Recommended)

Persists across sessions and terminal restarts.

~/.gemini/.env

bash
GEMINI_API_KEY=YOUR_API_KEY
GOOGLE_GEMINI_BASE_URL=https://api.unorouter.ai

Sign in to auto-fill your API key

Environment Variables

Add to your shell profile. Resets when the terminal closes unless sourced from a profile file.

powershell
$env:GEMINI_API_KEY="YOUR_API_KEY"
$env:GOOGLE_GEMINI_BASE_URL="https://api.unorouter.ai"

Sign in to auto-fill your API key

Usage

Launch Gemini CLI in your project directory and start interacting with your codebase:

bash
# Start Gemini CLI
gemini

# Switch models within the session
/model gemini-3-flash-preview

Ready to get started?

Get your API key and start using UnoRouter with Gemini CLI.