Skip to main content

Documentation Index

Fetch the complete documentation index at: https://arize-ax.mintlify.dev/docs/llms.txt

Use this file to discover all available pages before exploring further.

Trace Gemini CLI sessions, agent steps, model calls, and tool invocations in Arize AX for full observability.
Gemini CLI is Google’s open-source command-line agent for Gemini. The Arize Agent Kit instruments Gemini CLI sessions and exports OpenInference spans to Arize AX or Phoenix.

Launch Arize

To get started, sign up for a free Arize account and get your Space ID and API Key:
  1. Log in at app.arize.com
  2. Click Settings and copy the Space ID
  3. Open the API Keys tab and create or copy an API key

Install

Curl installer

macOS / Linux:
curl -sSL https://raw.githubusercontent.com/Arize-ai/arize-agent-kit/main/install.sh | bash -s -- gemini
Windows (PowerShell):
iwr -useb https://raw.githubusercontent.com/Arize-ai/arize-agent-kit/main/install.bat -OutFile $env:TEMP\install.bat
& $env:TEMP\install.bat gemini

Local clone

git clone https://github.com/Arize-ai/arize-agent-kit.git
cd arize-agent-kit
./install.sh gemini        # macOS / Linux
install.bat gemini         # Windows
The installer prompts for your backend (Phoenix or Arize AX) and project name, writes credentials to ~/.arize/harness/config.yaml, and registers the hooks in ~/.gemini/settings.json.

Configuration

Credentials live in ~/.arize/harness/config.yaml. Environment variables override values in config.yaml and can be set in your shell profile.

Phoenix (self-hosted)

export PHOENIX_ENDPOINT="http://localhost:6006"
export ARIZE_PROJECT_NAME="gemini"
export ARIZE_TRACE_ENABLED="true"

Arize AX (cloud)

export ARIZE_API_KEY="<your-api-key>"
export ARIZE_SPACE_ID="<your-space-id>"
export ARIZE_PROJECT_NAME="gemini"
export ARIZE_TRACE_ENABLED="true"

Redaction controls

Each ARIZE_LOG_* flag accepts "true" or "false" and defaults to "true". Set to "false" to opt out per category:
export ARIZE_LOG_PROMPTS="false"
export ARIZE_LOG_TOOL_DETAILS="false"
export ARIZE_LOG_TOOL_CONTENT="false"
FlagRedacts
ARIZE_LOG_PROMPTSUser prompt and assistant response text
ARIZE_LOG_TOOL_DETAILSTool names and arguments
ARIZE_LOG_TOOL_CONTENTTool call output content

Observe

Once tracing is enabled, Gemini CLI activity is streamed to Arize. You’ll see:
  • Session traces — each session bracketed by SessionStart and SessionEnd
  • Agent spans — paired BeforeAgent / AfterAgent events for each agent step
  • LLM spans — paired BeforeModel / AfterModel events with model info and tokens
  • Tool spans — paired BeforeTool / AfterTool events with input, output, and duration
  • Session grouping — all spans from the same session grouped by session_id

Hooks Captured

HookSpan KindDescription
SessionStartCHAINSession initialized
BeforeAgentCHAINAgent step started, records input
AfterAgentCHAINAgent step completed, records output
BeforeModelLLMModel call started, records prompt and model
AfterModelLLMModel call completed, records output and tokens
BeforeToolTOOLTool invocation started, records name and input
AfterToolTOOLTool invocation completed, records output and duration
SessionEndCHAINSession teardown, state file cleanup

Reference

For the full list of environment variables, default file paths, and troubleshooting steps, see the Gemini tracing README.

Uninstall

curl -sSL https://raw.githubusercontent.com/Arize-ai/arize-agent-kit/main/install.sh | bash -s -- uninstall gemini

Resources