Skip to main content

Overview

Google Gemini CLI is a command-line tool for interacting with Gemini models. LemonData provides a compatible endpoint that allows you to use Gemini CLI with access to 300+ models.

System Requirements

  • Node.js: Version 20.0+
  • OS: Windows 10/11, macOS 10.15+, Ubuntu 20.04+, or Debian 10+

Installation

npm install -g @google/gemini-cli
Verify installation:
gemini --version

Configuration

Step 1: Get Your API Key

  1. Log into LemonData Dashboard
  2. Navigate to API Keys
  3. Create and copy your API key (format: sk-...)

Step 2: Set Environment Variables

Temporary (current session):
export GEMINI_API_KEY="sk-your-lemondata-key"
export GOOGLE_GEMINI_BASE_URL="https://api.lemondata.cc"
Permanent configuration: Add to your shell configuration file:
echo 'export GEMINI_API_KEY="sk-your-lemondata-key"' >> ~/.bashrc
echo 'export GOOGLE_GEMINI_BASE_URL="https://api.lemondata.cc"' >> ~/.bashrc
source ~/.bashrc
Restart your terminal after configuration for changes to take effect.
Known limitation: In some cases, the Gemini CLI may not respect GOOGLE_GEMINI_BASE_URL if there’s a cached Google session. If you experience connection issues, try clearing the CLI cache or starting a fresh terminal session.

Basic Usage

Start Gemini CLI from your project directory:
cd your-project
gemini
On first run, you’ll:
  1. Choose a theme
  2. Confirm safety notice
  3. Trust the working directory

Available Models

ModelDescription
gemini-2.5-proMost capable Gemini model
gemini-2.5-flashFast, efficient for most tasks
gemini-2.0-flashPrevious generation, stable

Common Commands

Ask a question:
> What is the best way to structure a React app?
Analyze code:
> Explain the code in src/main.ts
Generate code:
> Create a Python function to parse JSON files
Review changes:
> Review the recent git changes and suggest improvements

Verify Configuration

# Check environment variables
echo $GEMINI_API_KEY
echo $GOOGLE_GEMINI_BASE_URL

# Test connection
gemini

Troubleshooting

  • Verify GOOGLE_GEMINI_BASE_URL is set to https://api.lemondata.cc
  • Note: No /v1 suffix for Gemini endpoint
  • Check network connectivity
  • Verify GEMINI_API_KEY environment variable is set
  • Check that the key starts with sk-
  • Ensure the key is active in LemonData dashboard

Best Practices

Always run Gemini CLI from your project root for better context understanding.
Only trust directories you own. Gemini CLI can read and modify files.
Always review AI-generated code before committing to your project.