Gemini CLI is Google's open-source agentic terminal for reading, editing, and running code with Gemini models. Beyond natural-language prompts, it exposes 50+ built-in slash commands, custom .toml commands, @ file injection, and ! shell passthrough—giving you meta-level control over sessions, tools, memory, and workflows without leaving the terminal.
Custom slash commands shipped in July 2025—a highly requested feature that lets teams define reusable prompts in .toml files or expose MCP prompts as slash commands. This article is a complete reference from the official Commands documentation, plus custom-command authoring from the Google Cloud blog.
It is not a replacement for upstream docs. Note: Google announced migration from Gemini CLI to Antigravity CLI for some tiers in 2026—verify your install path and changelog before documenting team runbooks. See our Google Antigravity analysis for context.
Exit; --delete removes session history and temp files
Setup, memory, and project context
Command
Purpose
/init
Analyze directory and generate tailored GEMINI.md
/memory show
Display concatenated hierarchical memory from all GEMINI.md files
/memory refresh
Reload memory from global, project, and subdirectory files
/memory list
List paths of active GEMINI.md files
/permissions trust [path]
Manage folder trust settings
/policies list
List active policies grouped by mode
/privacy
Privacy notice and data collection consent
/directory add|show
Multi-directory workspace (alias: /dir)
/auth
Change authentication method
Memory hierarchy: Gemini CLI loads GEMINI.md from global, project/ancestor, and subdirectory locations—similar to CLAUDE.md and MEMORY.md patterns. Codex uses AGENTS.md; Gemini uses GEMINI.md.
Multi-directory:/directory add supports absolute paths, relative paths, and ~ home references. Disabled in restrictive sandbox profiles—use --include-directories at launch instead.
Model, plan, and session control
Command
Purpose
/model manage
Open model configuration dialog
/model set [--persist]
Set active model
/plan
Enter Plan Mode (read-only); disable via general.plan.enabled
/plan copy
Copy approved plan to clipboard
/compress
Summarize entire chat context to save tokens
/copy
Copy last Gemini output to clipboard
/stats [session|model|tools]
Detailed usage statistics
/upgrade
Open Gemini Code Assist upgrade page (Google login only)
Plan mode is enabled by default. Use it the same way you'd use /plan in Codex or Claude Code—propose execution before implementation.
Session, resume, and checkpointing
Command
Purpose
/resume
Interactive session browser for auto-saved conversations
/chat
Alias for /resume with same subcommands
/chat save <tag>
Save manual checkpoint with tag
/chat resume <tag>
Resume tagged checkpoint (project-scoped)
/chat list
List manual checkpoint tags
/chat delete <tag>
Delete saved checkpoint
/chat share [file]
Export conversation to Markdown or JSON
/chat debug
Export most recent API request as JSON
/restore [tool_call_id]
Revert files to pre-tool state
/rewind
Review past interactions; revert chat and/or code (Esc Esc)
/clear
Clear terminal screen and visible history
/quit, /exit
Exit CLI
/quit --delete
Exit and permanently delete session history
Auto-save vs manual checkpoints: Conversations are automatically saved as you chat—run /resume to browse them. Manual /chat save <tag> checkpoints are project-scoped and stored under ~/.gemini/tmp/<project>/.
/restore vs /rewind:/restore reverts file changes from a specific tool call. /rewind navigates conversation history and can revert chat state, code changes, or both.
File GitHub issue; customizable via advanced.bugCommand
Custom slash commands (.toml)
Custom commands are Gemini CLI's distinguishing feature—reusable prompts defined in TOML files, announced July 31, 2025 by Google Developer Advocates Jack Wotherspoon and Abhi Patel.
Install latest Gemini CLI
bash
# npx (no global install)
npx @google/gemini-cli
# global npm
npm install -g @google/gemini-cli@latest
Scopes
Scope
Directory
Availability
User
~/.gemini/commands/
All projects for this user
Project
.gemini/commands/
Current project only (check into Git)
Minimal .toml structure
Only two keys are required: description and prompt.
toml
# ~/.gemini/commands/plan.tomldescription = "Investigates and creates a strategic plan to accomplish a task."prompt = """
Your primary role is that of a strategist, not an implementer.
Your task is to devise a comprehensive strategic plan for: {{args}}
You MUST NOT write, modify, or execute any code.
Present your plan with: Understanding the Goal, Investigation & Analysis,
Proposed Strategic Approach, Verification Strategy, and Anticipated Challenges.
"""
Usage:
bash
/plan How can I make the project more performant?
Template variables
Syntax
Purpose
Example
{{args}}
User arguments after command name
/review 42 → args = 42
!{shell}
Inline shell command output in prompt
!{git log --pretty=format:"%s" -n 5}
PR review example (from Google Cloud blog)
toml
# .gemini/commands/review.tomldescription = "Reviews a pull request based on issue number."prompt = """
Please provide a detailed pull request review on GitHub issue: {{args}}.
Follow these steps:
1. Use `gh pr view {{args}}` to pull PR information.
2. Use `gh pr diff {{args}}` to view the diff.
3. Understand intent from the PR description.
4. Verify title follows Conventional Commits. Recent commits:
!{git log --pretty=format:"%s" -n 5}
5. Search the codebase if required.
6. Write a concise review encouraging strong code quality.
7. Use `gh pr comment {{args}} --body {{review}}` to post the review.
"""
Invoke with /review 123.
Namespacing
File path relative to commands/ determines the command name. Path separators become colons:
File path
Command
.gemini/commands/test.toml
/test
.gemini/commands/git/commit.toml
/git:commit
Command names are case-sensitive.
After creating commands:
bash
/commands list
/commands reload
MCP prompts as slash commands
Gemini CLI exposes MCP server prompts as slash commands automatically. The MCP prompt name and description become the command name and help text.
MCP prompt arguments support named and positional forms:
Gemini CLI slash commands span built-in session control (/model, /plan, /compress), custom .toml workflows (/review, /git:commit), MCP prompt integration, and @ / ! input patterns for file injection and shell passthrough. The .toml system—with {{args}} templating and !{shell} injection—is the most extensible custom-command model among the three major agentic CLIs.
Command names, custom command syntax, and Antigravity migration status reflect Google documentation and the July 2025 Cloud blog as of June 11, 2026. Re-check the Gemini CLI changelog before documenting internal runbooks.