Gemini CLI Adapter
The gemini_local adapter runs Google Gemini CLI on the host machine as a SLAW agent, resuming sessions across Heartbeats with --resume.
Type key: gemini_local
Experimental
The gemini_local adapter is experimental. Its config schema and behaviour may change between SLAW releases.
Prerequisites
- Gemini CLI installed:
npm install -g @google/gemini-cli - Gemini CLI authenticated (
gemini login, orGEMINI_API_KEY/GOOGLE_API_KEYset)
Configuration
Set adapterType: gemini_local on the agent and provide the config below.
Config fields
| Field | Type | Default | Description |
|---|---|---|---|
cwd | string | — | Absolute working directory; created if missing |
instructionsFilePath | string | — | Absolute path to a markdown file prepended to the run prompt |
promptTemplate | string | — | Template for the run prompt |
model | string | auto | Gemini model ID (see Models) |
sandbox | boolean | false | Run in sandbox mode; passes --sandbox=none when false |
command | string | gemini | Override the Gemini CLI binary path |
extraArgs | string[] | — | Additional CLI arguments |
env | object | — | Environment variables injected into the agent process |
timeoutSec | number | 0 | Run timeout in seconds |
graceSec | number | 15 | SIGTERM grace period |
Models
| Model ID | Label |
|---|---|
auto | Auto (default) |
gemini-2.5-pro | Gemini 2.5 Pro |
gemini-2.5-flash | Gemini 2.5 Flash |
gemini-2.5-flash-lite | Gemini 2.5 Flash Lite |
gemini-2.0-flash | Gemini 2.0 Flash |
gemini-2.0-flash-lite | Gemini 2.0 Flash Lite |
Minimal example
{
"adapterType": "gemini_local",
"adapterConfig": {
"cwd": "/home/agent/workspace",
"model": "gemini-2.5-flash",
"timeoutSec": 0,
"graceSec": 15
}
}
Session behaviour
SLAW stores the session ID and cwd after each run. On the next Heartbeat, Gemini CLI resumes the prior session with --resume when the stored cwd matches the current working directory. If the cwd changes, a new session starts.
Notes
- Runs use positional prompt arguments, not stdin.
- SLAW auto-injects local skills into
~/.gemini/skills/via symlinks so the CLI can discover$slawand related skills in their natural location. - Authentication can use
GEMINI_API_KEY,GOOGLE_API_KEY, or local Gemini CLI credentials. - The
cheapmodel profile usesgemini-2.5-flash-liteas a budget lane while preserving the primary model.