Gemini Agent
Python wrapper for Google's Gemini CLI agentic capabilities.
Installation
pip install gemini-agent # client only
pip install gemini-agent[core] # + direct CLI usage
pip install gemini-agent[server] # + REST API service
Requirements: Node.js 18+ and npm install -g @google/gemini-cli
Quick Start
export GEMINI_API_KEY=your_key
from gemini_agent.core import GeminiAgent
agent = GeminiAgent()
result = agent.run("Create a Python CLI that lists files")
print(result.response) # Gemini's response
print(result.modified_files) # {"cli.py": "import os..."}
Usage
Direct CLI Wrapper
from gemini_agent.core import GeminiAgent
agent = GeminiAgent(
model="gemini-2.5-flash", # optional
sandbox=True, # isolated execution
)
result = agent.run(
"Build a REST API with FastAPI",
mcp_servers=["filesystem"],
files={"spec.txt": "..."},
)
# result.success, result.response, result.modified_files
Python Client (Remote)
from gemini_agent.client import GeminiAgentClient
async with GeminiAgentClient("http://localhost:8000") as client:
result = await client.run("Create a hello world script")
print(result.modified_files)
REST API
podman-compose up -d --build
# Submit task
curl -X POST http://localhost:8000/tasks \
-H "Content-Type: application/json" \
-d '{"prompt": "Create a fibonacci function"}'
# Get result
curl http://localhost:8000/tasks/{task_id}
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
POST |
/tasks |
Submit task |
GET |
/tasks/{id} |
Get result |
DELETE |
/tasks/{id} |
Cancel task |
GET |
/health |
Health check |
GET |
/mcp/servers |
List MCP servers |
POST |
/mcp/servers |
Add MCP server |
Configuration
| Variable | Description |
|---|---|
GEMINI_API_KEY |
API key (required) |
GEMINI_MODEL |
Model override |
GEMINI_TIMEOUT |
Timeout in seconds (default: 300) |
REDIS_URL |
Redis URL for server mode |
License
MIT
Release files for gemini-cli-agent 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gemini_cli_agent-0.1.0.tar.gz | 17.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gemini_cli_agent-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 37.3 kB
Release files / gemini_cli_agent-0.1.0.tar.gz
| Download URL | gemini_cli_agent-0.1.0.tar.gz |
|---|---|
| Size | 17.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7412c1274cd8d3e328390f3ea64b8d3688faa000da82f2808e093fe5b2b011df
|
|
BLAKE2b-256 checksum How to use checksums |
2f50b3da2f444f7aef77b02e0510dc4e0ae04b414bbc9c40afd065ae1639f9d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.3
|
Release files / gemini_cli_agent-0.1.0-py3-none-any.whl
| Download URL | gemini_cli_agent-0.1.0-py3-none-any.whl |
|---|---|
| Size | 20.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c9b58ec5a20e897421db54fe4989edb756c5d9cbe3ab1ce7b0202ba28fd69dc7
|
|
BLAKE2b-256 checksum How to use checksums |
c7386879aba3c63ef9efd72277559c7bf186fd3bfc19e54782192fc025425657
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.3
|