Power your Gemini CLI with Aihubmix for stable and efficient Gemini model services.

Quick Setup Guide:

1️⃣ Global npm Package Installation

Run in terminal

npm install -g @google/gemini-cli

Ensure your Node.js version >= 18

For more detailed information, refer to:

  1. Official Repository
  2. Detailed Configuration

2️⃣ Environment Variable Configuration

Add your Aihubmix API key and forwarding address to your system environment variables. You can generate the API key from the Aihubmix 「Keys」page.

For example, add to ~/.zshrc:

export GOOGLE_GEMINI_BASE_URL="https://aihubmix.com/gemini"
export GEMINI_API_KEY="sk-***"

For Mac users, you can show hidden .zshrc file in your username directory using shortcut ⌘ + ⇧ + ., then open it with the system “TextEdit” app to add the above content.

3️⃣ Apply Configuration

After adding the configuration, execute source ~/.zshrc in terminal and press Enter.

4️⃣ Terminal Launch

Enter in terminal:

gemini

Initialization Setup

Choose Connection Method

After launch, type /auth and press Enter, then select Gemini API Key (AI Studio)

 Login with Google
 Gemini API Key (AI Studio)
 vertex AI

You can use the /auth command anytime to switch authorization methods.

Launch Success

After completing the above initialization, you can use it normally.

Enjoy using it!