Skip to content

Gemini CLI

The gemini-cli template ships Google's Gemini CLI preinstalled.

Setup

bash
pip install ovrin
export OVRIN_API_KEY="ovrin_..."

Run the agent

python
import ovrin

client = ovrin.Client()  # reads OVRIN_API_KEY

sandbox = client.sandboxes.create(
    template="gemini-cli",
    env={"GEMINI_API_KEY": "..."},
    timeout=1800,
)

result = sandbox.run('gemini -p "Compute 1+1 and explain it"')
print(result.stdout)

sandbox.kill()

Work on a repository

python
sandbox.files.write("/workspace/app.py", open("app.py").read())

result = sandbox.run(
    'cd /workspace && gemini -p "document every function in app.py"',
    timeout=600,
)
print(sandbox.files.read("/workspace/app.py"))

Auth

VariablePurpose
GEMINI_API_KEYGoogle AI Studio API key
GEMINI_BASE_URLPoint at a proxy or gateway
GEMINI_MODELOverride the default model