Skip to main content

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, or GEMINI_API_KEY / GOOGLE_API_KEY set)

Configuration

Set adapterType: gemini_local on the agent and provide the config below.

Config fields

FieldTypeDefaultDescription
cwdstringAbsolute working directory; created if missing
instructionsFilePathstringAbsolute path to a markdown file prepended to the run prompt
promptTemplatestringTemplate for the run prompt
modelstringautoGemini model ID (see Models)
sandboxbooleanfalseRun in sandbox mode; passes --sandbox=none when false
commandstringgeminiOverride the Gemini CLI binary path
extraArgsstring[]Additional CLI arguments
envobjectEnvironment variables injected into the agent process
timeoutSecnumber0Run timeout in seconds
graceSecnumber15SIGTERM grace period

Models

Model IDLabel
autoAuto (default)
gemini-2.5-proGemini 2.5 Pro
gemini-2.5-flashGemini 2.5 Flash
gemini-2.5-flash-liteGemini 2.5 Flash Lite
gemini-2.0-flashGemini 2.0 Flash
gemini-2.0-flash-liteGemini 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 $slaw and related skills in their natural location.
  • Authentication can use GEMINI_API_KEY, GOOGLE_API_KEY, or local Gemini CLI credentials.
  • The cheap model profile uses gemini-2.5-flash-lite as a budget lane while preserving the primary model.

Next steps