# Gemini CLI

> Run Gemini CLI for AI queries. Use when user asks to "run/ask/use gemini", compare Claude vs Gemini, or delegate tasks to Gemini. Use when this capability is needed.

- Skill: `tomevault-io/gemini-cli-11` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/gemini-cli-11`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/gemini-cli-11/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/gemini-cli-11

---


# Gemini CLI

Interact w/ Google's Gemini CLI locally. Run queries, get responses, compare outputs.

## Prerequisites

Gemini CLI must be installed & configured:

1. **Install:** https://github.com/google-gemini/gemini-cli
2. **Auth:** Run `gemini` & sign in w/ Google account
3. **Verify:** `gemini --version`

## When to Use

- User asks to "run/ask/use gemini"
- Compare Claude vs Gemini responses
- Get second AI opinion
- Delegate task to Gemini

## Usage

**IMPORTANT:** Use `-p` flag for non-interactive (headless) one-shot queries. Without `-p`, gemini opens interactive mode which hangs in automation.

```bash
# One-shot query (MUST use -p for non-interactive)
gemini -p "Your prompt"

# Specific model
gemini -p "prompt" -m gemini-3-pro

# JSON output
gemini -p "prompt" -o json

# YOLO mode (auto-approve tool use)
gemini -y -p "prompt"

# File analysis
cat file.txt | gemini -p "Analyze this"
```

## Models (Gemini 3+ only)

| Model | Use case |
|-------|----------|
| `gemini-3-pro` | Default, best all-round |
| `gemini-3-flash` | Fast, lightweight tasks |

Omit `-m` to use the CLI default (latest stable).

## CLI Options

| Flag | Desc |
|------|------|
| `-p` | **Required for headless.** Non-interactive prompt |
| `-m` | Model selection |
| `-o` | Output: text/json/stream-json |
| `-y` | Auto-approve all actions (YOLO) |
| `-d` | Debug mode |
| `-s` | Sandbox mode |
| `-r` | Resume session |
| `-i` | Execute prompt then continue interactive |

## Comparison Workflow

1. Provide Claude's response first
2. Run same query via `gemini -p "prompt"`
3. Present both for comparison

## Best Practices

- Always use `-p` for automation/one-shot queries
- Quote prompts w/ double quotes
- Use `-o json` for parsing
- Pipe files for context

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/georgekhananaev) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-12 -->

