Api.Airforce
GEMINI CLI

Gemini CLI Integration

Point Google's official Gemini CLI at Airforce and use any Airforce-hosted model through Google's native Gemini API surface.

Gemini CLI speaks Google's native generateContent REST. Airforce exposes a Gemini-compatible endpoint at https://api.airforce/v1beta/ that translates to OpenAI internally — the CLI needs no patches, just two environment variables.

Install

npm (global)

npm install -g @google/gemini-cli

Homebrew (macOS / Linux)

brew install gemini-cli

Configure

Set two environment variables — the Gemini API key slot takes your Airforce key, and the base URL points the bundled @google/genai SDK at Airforce instead of Google.

macOS / Linux

export GEMINI_API_KEY="YOUR_AIRFORCE_API_KEY"
export GOOGLE_GEMINI_BASE_URL="https://api.airforce"

gemini

Windows (PowerShell)

$env:GEMINI_API_KEY = "YOUR_AIRFORCE_API_KEY"
$env:GOOGLE_GEMINI_BASE_URL = "https://api.airforce"

gemini

Persistent — settings.json

Gemini CLI stores its configuration in ~/.gemini/settings.json. Environment variables still win, so the config below is only needed when you want the settings to travel with your shell profile.

{
  "env": {
    "GEMINI_API_KEY": "YOUR_AIRFORCE_API_KEY",
    "GOOGLE_GEMINI_BASE_URL": "https://api.airforce"
  }
}

モデルを選択

Use any id from Airforce's catalog — not just Gemini. Pass it with -m or via the /model slash command in the TUI:

# Agent-capable models (Tools ✓ on the models page)
gemini -m claude-sonnet-4.5 --prompt "Refactor src/parser.ts"
gemini -m gpt-5 --prompt "Explain this stack trace"
gemini -m gemini-3.1-flash-lite --prompt "Summarise CHANGELOG.md"

ツール呼び出し。 Gemini CLI relies on function-calling for every file edit and shell run. Pick a model marked Tools ✓ on the models page — otherwise the CLI will reply with plain text and never touch your repo.

Troubleshooting

テキストでは返信するがファイルは編集しない

The model you picked doesn't support tool calls through its upstream. Switch to a model marked Tools ✓ on the models page.

401 / "Invalid API key"

Make sure GEMINI_API_KEY is your Airforce key (starts with sk-air-) and GOOGLE_GEMINI_BASE_URL is exactly https://api.airforce (no trailing slash, no /v1).

Gemini CLIはOAuthプロンプトにフォールバックします

Both env vars must be set in the same shell that launches gemini. Without GEMINI_API_KEY the CLI assumes Google OAuth. Export before running, or put them in ~/.gemini/settings.json.