Gemini CLI
Generate Google Gemini CLI configurations from AgenTopology definitions
Gemini CLI Binding
The Gemini CLI binding generates configuration files for Google's Gemini CLI from your .at topology.
Scaffolding
agentopology scaffold my-topology.at --target gemini-cliGenerated File Structure
.gemini/
agents/
researcher.md # Agent instruction file
writer.md
reviewer.md
config.json # Gemini CLI configuration
workflows/
code-review.json # Multi-agent workflow definitionAgent Instruction Files
Each agent generates a markdown instruction file with its role and tool access:
# Researcher
## Model
gemini-2.0-flash
## Role
Research specialist in the code-review pipeline.
## Tools
- Read
- Grep
- WebSearch
## Instructions
Analyze the codebase using available tools. Gather all relevant context
and produce a structured research summary for the writer agent.Model Mapping
AgenTopology model names map to Gemini model identifiers:
| AgenTopology | Gemini CLI |
|---|---|
opus | gemini-2.0-pro |
sonnet | gemini-2.0-flash |
haiku | gemini-2.0-flash-lite |
Configuration File
The config.json contains the full CLI setup:
{
"version": "1.0",
"topology": "code-review",
"agents": {
"researcher": {
"model": "gemini-2.0-flash",
"instructions": "agents/researcher.md",
"tools": ["Read", "Grep", "WebSearch"]
},
"writer": {
"model": "gemini-2.0-flash",
"instructions": "agents/writer.md",
"tools": ["Read", "Write"]
},
"reviewer": {
"model": "gemini-2.0-pro",
"instructions": "agents/reviewer.md",
"tools": ["Read", "Grep"]
}
}
}Workflow Files
Multi-agent topologies generate workflow definitions:
{
"name": "code-review",
"pattern": "pipeline",
"steps": [
{ "agent": "researcher", "next": "writer" },
{ "agent": "writer", "next": "reviewer" },
{
"agent": "reviewer",
"next": "writer",
"condition": "verdict == 'revise'",
"maxRetries": 2
}
]
}Limitations
- Gemini CLI does not natively support multi-agent orchestration. Workflow files require a wrapper to execute the pipeline.
- MCP server configurations are translated to Gemini CLI's extension format where supported.
- Hook support is limited. The binding generates hook stubs as shell scripts.
- The
scaleblock is not supported since Gemini CLI runs locally. - Permission mappings are embedded in agent instructions as behavioral guidelines.