gemini-cli-guide
Query Google Gemini CLI configuration, features, and documentation. Use this skill proactively when the conversation involves: - Gemini CLI installation, setup, or authentication - Gemini CLI configuration (GEMINI.md, settings, themes) - Gemini CLI commands, flags, slash commands - Gemini CLI features (sandbox, plan mode, yolo, skills, hooks) - Gemini CLI model routing, model steering - Gemini CLI extensions, MCP, ACP mode - Gemini CLI headless/non-interactive mode - Gemini CLI policy engine, trusted folders - Gemini CLI session management, checkpointing, rewind
What this skill does
# Gemini CLI Docs Guide
Query Gemini CLI source code and official documentation for accurate, up-to-date information.
## When to Use
When the user asks about or the conversation involves:
- Gemini CLI setup, configuration, or commands
- Gemini CLI model selection, routing, or steering
- Gemini CLI sandbox, approval modes, policy engine
- GEMINI.md, skills, hooks, extensions
- Gemini CLI headless mode, ACP, automation
- Any Google Gemini CLI product or feature
## Strategy: Source Code First, Docs Second
**Primary source**: [`google-gemini/gemini-cli`](https://github.com/google-gemini/gemini-cli) GitHub repo.
**Secondary source**: WebFetch from `https://geminicli.com/docs/` — for conceptual guides and tutorials.
## Execution Steps (IMPORTANT!)
**You MUST query the source — never answer from memory!**
### Step 1: Determine query type and choose method
| Query Type | Method | Example |
|-----------|--------|---------|
| Config options, settings | Repo: docs/reference/configuration.md | "What settings can I configure?" |
| CLI flags, options | Repo: docs/cli/cli-reference.md | "What flags does `gemini` accept?" |
| Model routing, steering | Repo: docs/cli/model-routing.md | "How to route models?" |
| Policy engine | Repo: docs/reference/policy-engine.md | "How does policy engine work?" |
| Skills, hooks | Repo: docs/cli/skills.md, hooks/ | "How to create skills?" |
| Extensions, MCP | Repo: docs/extensions/ | "How to add MCP servers?" |
| Conceptual guides | WebFetch docs site | "How does sandboxing work?" |
### Step 2a: Query GitHub Repo (primary)
**Search for keywords across the repo:**
```bash
gh search code "keyword" --repo google-gemini/gemini-cli --limit 20
```
**Read specific key files via raw URL:**
```bash
# CLI reference (flags, arguments)
curl -sL https://raw.githubusercontent.com/google-gemini/gemini-cli/main/docs/cli/cli-reference.md
# Configuration reference
curl -sL https://raw.githubusercontent.com/google-gemini/gemini-cli/main/docs/reference/configuration.md
# Model routing
curl -sL https://raw.githubusercontent.com/google-gemini/gemini-cli/main/docs/cli/model-routing.md
# Skills
curl -sL https://raw.githubusercontent.com/google-gemini/gemini-cli/main/docs/cli/skills.md
# Policy engine
curl -sL https://raw.githubusercontent.com/google-gemini/gemini-cli/main/docs/reference/policy-engine.md
# List all docs
gh api repos/google-gemini/gemini-cli/contents/docs/cli -q '.[].name'
gh api repos/google-gemini/gemini-cli/contents/docs/reference -q '.[].name'
```
> **IMPORTANT**: Always use `curl -sL` with raw.githubusercontent.com for reading files.
> Do NOT use `gh api contents -q '.content' | base64 -d` — it fails for files > 100KB.
**Key docs in `google-gemini/gemini-cli` repo:**
| File | Contains |
|------|----------|
| `docs/cli/cli-reference.md` | CLI flags, arguments |
| `docs/reference/configuration.md` | All config options |
| `docs/reference/commands.md` | Slash commands reference |
| `docs/reference/keyboard-shortcuts.md` | Keyboard shortcuts |
| `docs/reference/tools.md` | Available tools |
| `docs/reference/policy-engine.md` | Policy engine rules |
| `docs/cli/model.md` | Model selection |
| `docs/cli/model-routing.md` | Model routing |
| `docs/cli/model-steering.md` | Model steering |
| `docs/cli/sandbox.md` | Sandbox modes |
| `docs/cli/skills.md` | Skills system |
| `docs/cli/creating-skills.md` | How to create skills |
| `docs/cli/custom-commands.md` | Custom slash commands |
| `docs/cli/gemini-md.md` | GEMINI.md instructions file |
| `docs/cli/headless.md` | Non-interactive mode |
| `docs/cli/plan-mode.md` | Plan mode |
| `docs/cli/settings.md` | Settings UI |
| `docs/cli/session-management.md` | Session management |
| `docs/cli/checkpointing.md` | Checkpointing |
| `docs/cli/rewind.md` | Rewind feature |
| `docs/cli/acp-mode.md` | Agent Communication Protocol |
| `docs/cli/gemini-ignore.md` | .geminiignore file |
| `docs/cli/trusted-folders.md` | Trusted folders |
| `docs/extensions/` | Extension system |
| `docs/hooks/` | Hooks system |
### Step 2b: Query Docs Site (secondary)
Prepend `https://geminicli.com` to paths:
| Topic | URL Path |
|-------|----------|
| Overview | /docs/ |
| Get started | /docs/get-started/ |
| CLI reference | /docs/cli/cli-reference |
| Configuration | /docs/reference/configuration |
| Commands | /docs/reference/commands |
| Model routing | /docs/cli/model-routing |
| Skills | /docs/cli/skills |
| Hooks | /docs/hooks/ |
| Extensions | /docs/extensions/ |
| Sandbox | /docs/cli/sandbox |
| Policy engine | /docs/reference/policy-engine |
| Headless mode | /docs/cli/headless |
```
WebFetch("https://geminicli.com/docs/cli/cli-reference", "Extract documentation about...")
```
### Step 3: Parse and respond
Extract relevant information and answer the user directly.
## Quick Reference
### Installation
```bash
npm install -g @google/gemini-cli # npm
```
### Package
`@google/gemini-cli` — GitHub: `google-gemini/gemini-cli`
### Config file
`GEMINI.md` — project-level instructions (like Claude's CLAUDE.md)
### Key CLI flags
| Flag | Purpose |
|------|---------|
| `-m, --model` | Override model |
| `-p, --prompt` | Non-interactive (headless) mode |
| `-i, --prompt-interactive` | Execute prompt then continue interactive |
| `-s, --sandbox` | Enable sandbox |
| `-y, --yolo` | Auto-approve all actions |
| `--approval-mode` | `default` / `auto_edit` / `yolo` / `plan` |
| `--policy` | Additional policy files |
| `-e, --extensions` | Specify extensions |
| `--acp` | Agent Communication Protocol mode |
### Key paths
| Path | Purpose |
|------|---------|
| `GEMINI.md` | Project instructions |
| `.gemini/settings.json` | Project settings |
| `~/.gemini/settings.json` | Global settings |
| `.gemini/skills/` | Project skills |
| `.geminiignore` | Ignore file |
## Fallback
If topic is not covered above:
1. `gh search code "topic" --repo google-gemini/gemini-cli`
2. WebSearch for `site:geminicli.com <topic>`
3. WebFetch `https://geminicli.com/docs/` for the main index
## Important Reminders
- **Source code is authoritative** for valid values, schemas, and types
- **Docs site is authoritative** for guides, tutorials, and conceptual explanations
- Config uses `GEMINI.md` (Markdown) and `settings.json` — different from Claude Code
- Gemini CLI uses extensions (not plugins) and has a policy engine (not hooks for permissions)
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.