Tools & IDE

Gemini CLI Configuration

Endpoint: https://api.shopaikey.com

Gemini CLI is Google's open-source command-line tool (CLI) for pair programming, code refactoring, and debugging right in your terminal with the power of Gemini models.

macOS / Linux

code
curl -fsSL https://cdn.shopaikey.com/gemini-cli/setup.sh | bash

Windows (PowerShell)

code
irm https://cdn.shopaikey.com/gemini-cli/setup.ps1 | iex

The script automatically installs Gemini CLI (if not already installed), backs up old settings, and configures your API key.


1. Requirements & Installation

System Requirements

  • Node.js: Version 18 or higher.
  • OS: macOS, Linux, or Windows (WSL/PowerShell).

Quick install with npx (no installation required)

code
npx @google/gemini-cli

Global install with npm

code
npm install -g @google/gemini-cli

Install with Homebrew (macOS/Linux)

code
brew install gemini-cli

Install with MacPorts (macOS)

code
sudo port install gemini-cli

Install with Anaconda (for restricted environments)

code
# Create and activate a new environment
conda create -y -n gemini_env -c conda-forge nodejs
conda activate gemini_env

# Install Gemini CLI globally via npm (inside the environment)
npm install -g @google/gemini-cli

2. Configuration (Important)

To point Gemini CLI to https://api.shopaikey.com instead of Google's default server, you need to configure the Base URL and API Key. There are 2 ways to do this.

This method saves the configuration permanently and is easy to manage.

Step 1: Create a .env file in the home directory

  • macOS / Linux: ~/.gemini/.env
  • Windows: %USERPROFILE%\.gemini\.env

Step 2: Enter configuration content

code
GEMINI_API_KEY=sk-your-token-here
GOOGLE_GEMINI_BASE_URL=https://api.shopaikey.com

Method 2: Using Environment Variables

Use this method if you don't want to edit config files or want to test quickly.

Linux / macOS

code
export GEMINI_API_KEY="sk-your-token-here"
export GOOGLE_GEMINI_BASE_URL="https://api.shopaikey.com"

Windows (PowerShell)

code
$env:GEMINI_API_KEY = "sk-your-token-here"
$env:GOOGLE_GEMINI_BASE_URL = "https://api.shopaikey.com"

Windows (CMD)

code
set GEMINI_API_KEY=sk-your-token-here
set GOOGLE_GEMINI_BASE_URL=https://api.shopaikey.com

3. Usage Guide

After configuration, you can start using Gemini CLI.

Launch Interactive Mode

In your project directory, type:

code
gemini

You'll enter the chat interface. You can ask:

"Explain this project's structure to me" "Create a test file for the login function in src/auth.js"

Run Commands Directly (Single Shot)

Send a quick request without entering chat mode:

code
gemini "Refactor utils.js to make the code cleaner"

Choose a Model

Gemini CLI supports various models. Specify a model when launching:

code
gemini --model gemini-3-pro "Explain the calculateTotal function"

View the full model list at Model Pricing.