# Gemini

> Use when the user requests to run Gemini CLI for code analysis, refactoring, or automated editing

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

---


# Gemini CLI Skill Guide

## Running a Task
1. Ask the user (via `AskUserQuestion`) which model to use (see list below).
2. **ALWAYS use non-interactive mode** with `-p` and **ALWAYS YOLO mode** (`-y` or `--approval-mode yolo`).
3. Assemble the command with the appropriate options:
   - `-m, --model <MODEL>` (optional, uses the default model if not specified)
   - `-y, --yolo` **MANDATORY** (auto-approves all actions)
   - `-p, --prompt "<PROMPT>"` **MANDATORY** (non-interactive mode)
   - `--allowed-tools <TOOLS>` (optional, to specify allowed tools)
   - `-r, --resume <latest|INDEX>` to resume a session
4. To continue a previous session, use `gemini -r latest` or `gemini -r <INDEX>`.
5. Run the command, capture stdout/stderr, and summarize the result for the user.
6. **After running Gemini**, inform the user: "You can resume this Gemini session at any time by saying 'gemini resume' or using `gemini -r latest`."

### Available Gemini Models

- **`gemini-3-pro-preview`** - The world's best model for multimodal understanding, most powerful for coding and agents
- **`gemini-2.5-pro`** - Advanced reasoning model, excellent for complex problems in code, math, and science
- **`gemini-2.5-flash`** - Best performance-to-price ratio, versatile, ideal for large-scale processing
- **`gemini-2.5-flash-lite`** - Fastest Flash model, optimized for cost-effectiveness and high throughput

### Quick Reference
| Use Case | Mode | Key Flags |
| --- | --- | --- |
| Direct prompt (default) | Non-interactive YOLO | `gemini -y -p "your prompt"` |
| With specific model | Non-interactive YOLO | `gemini -m gemini-3-pro-preview -y -p "prompt"` |
| Resume recent session | Resume YOLO | `gemini -r latest -y -p "new prompt"` |
| Resume specific session | Resume YOLO | `gemini -r 5 -y -p "new prompt"` |
| List sessions | Utility | `gemini --list-sessions` |
| Use specific extensions | With extensions YOLO | `gemini -e ext1 ext2 -y -p "prompt"` |
| Screen reader mode | Accessibility YOLO | `gemini --screen-reader -y -p "prompt"` |

## Follow-up
- After each `gemini` command, immediately use `AskUserQuestion` to confirm next steps, gather details, or decide to resume with `gemini -r latest -y -p "new prompt"`.
- When resuming, the session automatically retains the context, model, and parameters of the original session.
- Restate the chosen model when proposing follow-up actions.
- **Always remind** that YOLO mode (`-y`) is mandatory for all commands.

## Error Handling
- Stop and report failures whenever `gemini --version` or a `gemini` command returns a non-zero exit code; ask for direction before retrying.
- YOLO mode (`-y`) is **always used** by default - no additional permission is needed.
- When output includes warnings or partial results, summarize them and ask how to adjust via `AskUserQuestion`.

## Output Formats
- **text** (default): Readable text output
- **json**: Structured JSON output
- **stream-json**: Streaming JSON output

Use `-o, --output-format <FORMAT>` to specify the output format.
