Gemini CLI
Gemini CLI is Google’s open-source terminal coding agent (github.com/google-gemini/gemini-cli). It ships a first-class OpenTelemetry exporter and reads an MDM-deployable system-settings file, plus a cloud-hosted Management Console whose settings override the local file. Arrakis recommends MDM-managed settings so policy is fail-closed and survives shell-level tampering — although note Google’s docs explicitly warn the file path is not a hard security boundary (a local-admin user can redirect GEMINI_CLI_SYSTEM_SETTINGS_PATH; mitigation is a gemini PATH-shim wrapper earlier on PATH).
When to use this
Use this page if your fleet uses Gemini CLI on developer endpoints. Covers the paid business SKUs; Google unified the individual and Google AI Pro/Ultra tiers under Antigravity on 2026-06-18 — that is out of scope here.
3-step Quickstart
- In the Arrakis platform, paste your Google Cloud service-account credentials (or ADC config) under Settings → Integrations → Google.
- Download the tenant-specific Gemini CLI system-settings payload from Settings → Integrations → Deployment → Gemini CLI.
- Import the payload into your MDM (Jamf, Intune, Iru, or other), scope to your developer fleet, and confirm
gemini --versionruns and telemetry attributes reach the Arrakis ingest.
Where tenant-specific values come from
Sign in to the Arrakis platform → Settings → Integrations → Deployment. The OTLP endpoint, header secret, vendor admin credentials, and per-tool MDM payload templates for your tenant live there.
Reference: full configuration walkthrough
System settings file
Gemini CLI reads a 4-layer settings stack, last wins on scalar keys. Arrays and objects are merged; for mcpServers conflicts the precedence order is System > Workspace > User.
| Layer | Path | Who writes |
|---|---|---|
| System defaults | system-defaults.json (packaged) | |
| User | ~/.gemini/settings.json | End user |
| Workspace | <project>/.gemini/settings.json | Project committer |
| System overrides | See per-OS path below | MDM (Arrakis) |
System-overrides per-OS path:
| Platform | Path |
|---|---|
| macOS | /Library/Application Support/GeminiCli/settings.json |
| Windows | C:\ProgramData\gemini-cli\settings.json |
| Linux | /etc/gemini-cli/settings.json |
The override path is controlled by GEMINI_CLI_SYSTEM_SETTINGS_PATH. User state root is GEMINI_CLI_HOME.
Caveat. Google’s docs flag the system-overrides file as not a hard security boundary — a local-admin user can redirect GEMINI_CLI_SYSTEM_SETTINGS_PATH and bypass MDM policy. Arrakis recommendation: ship a gemini PATH-shim wrapper earlier on PATH that hard-codes the corporate settings path and re-execs the real binary. This is the same pattern used for pre-v0.143.0 Codex.
Enforceable keys
| Key | Purpose |
|---|---|
security.auth.enforcedType | Pin auth to oauth-personal, gemini-api-key, or vertex-ai |
security.disableYoloMode | Disable auto-approve of tool calls |
tools.core | Allowlist of tools; supports ShellTool(<cmd>) per-command syntax |
tools.sandbox | Force sandboxed execution (docker) |
mcp.allowed + mcpServers (system) | Locked MCP catalog; system-level entries win over user/workspace |
privacy.usageStatisticsEnabled | Disable Google’s usage telemetry |
advanced.bugCommand.urlTemplate | Redirect /bug to an internal ticketing system |
Not currently documented on Gemini CLI: a minimumVersion pin and an MCP deny-list (allowlist only).
Native OpenTelemetry
Enable with telemetry.enabled=true (settings) or GEMINI_TELEMETRY_ENABLED=true (env). Protocol via telemetry.otlpProtocol / GEMINI_TELEMETRY_OTLP_PROTOCOL — either grpc (default) or http. Endpoint via telemetry.otlpEndpoint / GEMINI_TELEMETRY_OTLP_ENDPOINT (default http://localhost:4317). Target via GEMINI_TELEMETRY_TARGET — local for OTLP or gcp for Cloud Trace/Monitoring/Logging.
Signals emitted:
| Signal | Content |
|---|---|
| Logs | gemini_cli.user_prompt (with prompt), gemini_cli.tool_call (function name, args, decision, duration, MCP metadata), gemini_cli.api_request / .api_response (with optional request_text / response_text), gemini_cli.file_operation, gemini_cli.hook_call |
| Metrics | gemini_cli.token.usage split by input|output|thought|cache|tool, gen_ai.client.token.usage |
| Traces (off by default) | GenAI-semconv spans with gen_ai.operation.name = user_prompt, system_prompt, llm_call, tool_call, agent_call, schedule_tool_calls. Carries gen_ai.input.messages and gen_ai.output.messages when telemetry.traces=true. |
Common attributes: session.id, installation.id, active_approval_mode, user.email.
Content-control (privacy vs. fidelity)
Gemini CLI ships one content-control flag rather than the four exposed by Claude Code:
telemetry.logPrompts/GEMINI_TELEMETRY_LOG_PROMPTS— defaulttrue; Google’s enterprise docs advisefalse. Whenfalse, prompt bodies and API request/response texts are omitted from logs and trace attributes. Metrics and tool-call metadata still flow.
Arrakis-recommended default (matching Claude Code): logPrompts=true, with DLP scanning at the ingest. Override per-org as governance and DLP review allow.
Distributed tracing
telemetry.traces=true (or GEMINI_TELEMETRY_TRACES_ENABLED=true) emits GenAI-semconv spans in this hierarchy:
user_prompt
├── llm_call
├── schedule_tool_calls
│ └── tool_call
└── agent_callHook events surface as logs (gemini_cli.hook_call), not span kinds. Spans carry gen_ai.agent.name=gemini-cli, gen_ai.conversation.id, gen_ai.request.model, gen_ai.tool.name, gen_ai.tool.call_id, and gen_ai.usage.input_tokens/output_tokens.
Auth pinning
security.auth.enforcedType picks one auth method for the fleet (e.g. vertex-ai for a corporate Google Cloud project). There is no forceLoginOrgUUID-equivalent — pinning to a specific Google Workspace tenant is a network-layer control, achieved by proxying google.com and injecting X-GoogApps-Allowed-Domains: <domain> (Google Workspace admin guidance). Document this in the Arrakis IdP guide.
Management Console (preview)
Google ships a cloud-hosted management console (goo.gle/manage-gemini-cli) whose settings are immutable at the local level:
- Strict Mode — disallows overrides on managed keys.
- Extensions toggle — global on/off for extensions.
- MCP toggle, MCP Servers Allowlist (preview), Required MCP Servers (preview, remote-only, supports
google_credentials/service_account_impersonation). - Unmanaged Capabilities — allow-list of features that end users may still control.
Where available, prefer this console for policy the enterprise wants to be tamper-proof — the local file approach is the fallback for policy Google hasn’t yet exposed through the console.
MDM payloads
Three delivery channels are common:
| OS | Channel | Storage |
|---|---|---|
| macOS | Files & Processes deploy JSON to /Library/Application Support/GeminiCli/settings.json; Custom Configuration Profile sets GEMINI_TELEMETRY_* env at user-session start | Read on next gemini invocation |
| Windows | Win32 app (Files & Processes-equivalent) deploys JSON to C:\ProgramData\gemini-cli\settings.json; Settings catalog sets HKLM env under system Environment | Read on next gemini invocation |
| Linux / WSL | File deploy to /etc/gemini-cli/settings.json | Read on next gemini invocation |
Jamf Pro (macOS)
- Files & Processes payload: deliver
settings.jsonto/Library/Application Support/GeminiCli/(mode 0644, owner root:wheel). - Custom Configuration Profile: launchd plist setting
GEMINI_TELEMETRY_OTLP_ENDPOINT,GEMINI_TELEMETRY_LOG_PROMPTS, and any Arrakis-recommended env at user-session start. - Files & Processes payload: install the Arrakis
geminiPATH-shim wrapper (from the Arrakis platform) at/usr/local/bin/geminiwith mode 0755.
Microsoft Intune
- macOS: shell-script policy that installs
settings.jsonand writes a launchd plist for env vars. - Windows: Win32 app installs
settings.jsonunderC:\ProgramData\gemini-cli\. Settings catalog setsGEMINI_TELEMETRY_*env under HKLM. - Assignment: developer device or user group.
Iru (macOS)
- Custom Script library item (install, marked Continuously Enforced) that drops
settings.jsonand the PATH-shim wrapper. - Custom Profile library item — launchd plist setting
GEMINI_TELEMETRY_*env at user-session start.
Generic
- macOS launchd plist for env; file deploy for
settings.json. - Windows: scheduled task at user logon to set
HKCU\Environmentenv vars.
The exact
settings.jsonbody, the tenant OTLP endpoint hostname, the bearer token value, and the PATH-shim wrapper are provisioned per-tenant in the Arrakis platform under Settings → Integrations → Deployment, or available from Arrakis support.
Egress verification
Cross-link to OTel Collector & Arrakis Endpoint → Verifying connectivity for the TCP/TLS, synthetic OTLP, and failure-mode probes shared across tools.
Gemini-CLI-specific debug commands:
| Command | What it shows |
|---|---|
gemini --version | Confirms binary presence and version. |
GEMINI_TELEMETRY_TARGET=local gemini | Interactive session — check the local OTLP receiver for service.name=gemini-cli records. |