OpenClaw provider plugin that routes Gemini LLM calls through the locally installed Gemini CLI (gemini binary) instead of calling the Google Generative AI API directly.
No API key needed in OpenClaw. Authentication is handled entirely by the Gemini CLI, which uses your existing Google account login.
- OpenClaw >= 2026.3.24
- Gemini CLI installed and authenticated
# Install Gemini CLI
npm install -g @google/gemini-cli
# Authenticate (opens browser)
geminiopenclaw plugins install @richizo/openclaw-gemini-cliEnable the plugin in your ~/.openclaw/openclaw.json:
{
"agents": {
"defaults": {
"model": {
"primary": "gemini-cli/gemini-2.5-flash"
},
"models": {
"gemini-cli/gemini-2.5-flash": {},
"gemini-cli/gemini-2.5-pro": {}
}
}
},
"plugins": {
"entries": {
"gemini-cli": { "enabled": true }
}
}
}"gemini-cli": {
"enabled": true,
"config": {
"command": "/path/to/gemini", // default: "gemini" (resolved from PATH)
"timeoutMs": 120000 // default: 120000 (2 min)
}
}| Model ID | Description |
|---|---|
gemini-cli/gemini-2.5-flash |
Gemini 2.5 Flash via CLI |
gemini-cli/gemini-2.5-pro |
Gemini 2.5 Pro via CLI (reasoning) |
Unlike a naive subprocess wrapper, this plugin streams stdout chunks as text_delta events in real time. This keeps the OpenClaw runner stream alive and surfaces partial output as it arrives — preventing the hard request timeout that would occur if the entire response were buffered until process exit.
The plugin always passes -m <modelId> to the CLI, ensuring the requested model (flash vs. pro) is used instead of whatever the CLI's own default is configured as. This prevents silent fallbacks to unavailable models.
The gemini binary blocks on stdin when no TTY is attached (the default for subprocess spawning). The plugin uses stdio: ["ignore", "pipe", "pipe"] to prevent this hang.
The plugin spawns gemini -m <model> -p "<prompt>" as a subprocess, streams stdout chunks as text_delta events, and emits done when the process exits.
OpenClaw agent → gemini-cli plugin → gemini subprocess → Google (via CLI auth)
MIT — see LICENSE