Skip to main content

Overview

Type: Coding ToolPrimary Path: Gemini-nativeSupport Confidence: Best-effort
Google Gemini CLI is a command-line tool for interacting with Gemini models. LemonData compatibility here is experimental: Gemini CLI officially documents Google-native authentication and settings, but does not currently document a stable custom LemonData-style base URL workflow.
Treat this integration as best-effort compatibility, not a guaranteed long-term setup. If you need a stable LemonData terminal coding workflow, prefer Codex CLI, Claude Code, or OpenCode.

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

The following setup is the current compatibility path people use with proxy or gateway endpoints, but it is not a stable upstream contract: 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: Gemini CLI may ignore GOOGLE_GEMINI_BASE_URL in some situations, especially when an existing Google login or cached auth flow takes precedence. If this happens, start a fresh terminal session, clear cached auth, or use another client.

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: Do not add /v1 for this compatibility path
  • 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
  • Gemini CLI’s custom gateway compatibility can regress between releases
  • Prefer Codex CLI, Claude Code, or OpenCode if you need a documented LemonData path

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.