================================================================================
  SindByte MCP Server -- Gemini CLI Setup Guide
  Connecting Google Gemini CLI to Your Local Endpoint
================================================================================
Date: 2026-04-17
For: SindByte Server v1.9.09

--------------------------------------------------------------------------------
 1. WHAT IS GEMINI CLI?
--------------------------------------------------------------------------------
Gemini CLI is Google's official terminal-based AI coding assistant.
It is NOT the same as Gemini in the browser or any other tool.

  Official source:   https://gemini.google.com
  Install command:   npm install -g @google/gemini-cli
  Config:            Environment variables or ~/.gemini/config

--------------------------------------------------------------------------------
 2. REQUIRED INFORMATION
--------------------------------------------------------------------------------
  SindByte Base URL:   http://127.0.0.1:8091/v1
  API Key:             sk-sindbyte-local   (or any text -- not checked)

  IMPORTANT: SindByte must be running before you start Gemini CLI.

--------------------------------------------------------------------------------
 3. INSTALL GEMINI CLI
--------------------------------------------------------------------------------
  STEP 1 -- Open PowerShell and install:

    npm install -g @google/gemini-cli

    Or use Homebrew on macOS:
    brew install --cask gemini-cli

  STEP 2 -- Verify installation:

    gemini --version

--------------------------------------------------------------------------------
 4. CONFIGURE GEMINI CLI FOR SINDBYTE
--------------------------------------------------------------------------------
Gemini CLI supports custom base URLs via environment variables.

  STEP 1 -- Set these environment variables in your terminal:

    set GEMINI_API_KEY=sk-sindbyte-local
    set GOOGLE_GEMINI_BASE_URL=http://127.0.0.1:8091/v1

  STEP 2 -- Make permanent (Windows):
    Win+R -> sysdm.cpl -> Advanced -> Environment Variables
    Add:
      GEMINI_API_KEY        = sk-sindbyte-local
      GOOGLE_GEMINI_BASE_URL = http://127.0.0.1:8091/v1

  STEP 3 -- Start Gemini CLI in your project folder:

    cd "[your-project-path]"
    gemini

--------------------------------------------------------------------------------
 5. IMPORTANT NOTE ABOUT GEMINI CLI
--------------------------------------------------------------------------------
Gemini CLI is designed primarily for Google's Gemini models.
When routing through SindByte (which is OpenAI-compatible), some
Gemini-specific features may not work. However, basic chat and
code generation work perfectly.

  If Gemini CLI refuses to connect to a non-Google endpoint:

    1. Make sure you are using the latest version:
       npm update -g @google/gemini-cli

    2. Some older versions ignore GOOGLE_GEMINI_BASE_URL.
       Try using an OpenAI-compatible wrapper like OpenClaw
       or switch to another CLI tool (OpenCode, Codex, etc.)

--------------------------------------------------------------------------------
 6. USING IQ TOOLS WITH GEMINI CLI
--------------------------------------------------------------------------------
Gemini CLI does not have built-in IQ profile selection.
To use IQ Tools, set the default profile in SindByte:

  1. Open SindByte tray icon -> Config
  2. Find API Provider -> Default IQ Profile
  3. Set to "default", "research", or "trading"
  4. Save and restart SindByte

  All Gemini CLI requests will now use that IQ pipeline.

--------------------------------------------------------------------------------
 7. TROUBLESHOOTING
--------------------------------------------------------------------------------

  PROBLEM: "gemini command not found"
  FIX:     Make sure npm global bin is in your PATH.

  PROBLEM: "Cannot connect" or "Connection refused"
  FIX:     Verify SindByte is running on port 8091.

  PROBLEM: Gemini says "only Gemini models are supported"
  FIX:     This is a known limitation of older Gemini CLI versions.
           Update to the latest version or use a different CLI tool.

  PROBLEM: "Invalid API key format"
  FIX:     Use sk-sindbyte-local (starts with "sk-").

--------------------------------------------------------------------------------
 8. QUICK REFERENCE
--------------------------------------------------------------------------------
  | Setting          | Value                                  |
  |------------------|----------------------------------------|
  | Tool             | Gemini CLI (npm: @google/gemini-cli)   |
  | Base URL         | http://127.0.0.1:8091/v1               |
  | API Key          | sk-sindbyte-local                      |
  | Env var (URL)    | GOOGLE_GEMINI_BASE_URL                 |
  | Env var (Key)    | GEMINI_API_KEY                         |
  | IQ Timeout       | 3600 sec (1 hour)                      |

================================================================================
  END OF GUIDE
================================================================================
