| name | gemini-cli |
| description | Run Gemini CLI for AI queries. Use when user asks to "run/ask/use gemini", compare Claude vs Gemini, or delegate tasks to Gemini. |
Gemini CLI
Interact w/ Google's Gemini CLI locally. Run queries, get responses, compare outputs.
Prerequisites
Gemini CLI must be installed & configured:
- Install: https://github.com/google-gemini/gemini-cli
- Auth: Run
gemini & sign in w/ Google account
- 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.
gemini -p "Your prompt"
gemini -p "prompt" -m gemini-3-pro
gemini -p "prompt" -o json
gemini --approval-mode=yolo -p "prompt"
cat file.txt | gemini -p "Analyze this"
Models
| Alias | Use case |
|---|
auto | DEFAULT — routes per prompt (simple → Flash, complex → 3 Pro) |
pro | Force Gemini 3 Pro (best all-round) |
flash / flash-lite | Fast, lightweight tasks (3.5 Flash GA rolling out as auto default) |
Omit -m to use auto routing. Aliases beat pinned model ids — they track
upstream model swaps. Pin a full id (e.g. gemini-3-pro) only when the user
names one.
CLI Options
| Flag | Desc |
|---|
-p | Required for headless. Non-interactive prompt |
-m | Model selection |
-o | Output: text/json/stream-json |
--approval-mode=yolo | Auto-approve all actions (-y is deprecated) |
-d | Debug mode |
-s | Sandbox mode |
-r | Resume session |
-i | Execute prompt then continue interactive |
Comparison Workflow
- Provide Claude's response first
- Run same query via
gemini -p "prompt"
- 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