Skip to content

Mastering Gemini CLI Slash (/), At (@), & Shell (!) Commands

CoreConceptAugust 1, 20263 min read

Gemini CLI features an intuitive command syntax designed to streamline interactive terminal workflows. By mastering Slash (/) commands, At (@) path annotations, and Exclamation (!) shell execution, developers can rapidly control tool behavior, ingest project files, manage session history, and run terminal commands directly within the agent prompt.

This guide serves as an authoritative cheatsheet and practical reference for all interactive commands available in Gemini CLI.

Claude Code rise = widening execution surface, not five gold dates
Claude Code rise = widening execution surface, not five gold dates

Slash (/) Commands: Session & Tool Controls

Slash commands begin with / and allow developers to configure agent behavior, manage active tools, toggle UI modes, and handle conversation history.

Using slash commands overrides normal prompt evaluation, executing system-level actions instantly without consuming model token generation time.

Quick reference

  • Use /tools to inspect connected Model Context Protocol (MCP) servers and toggled system utilities.
  • Use /chat save <name> to preserve intermediate investigation state before attempting risky code changes.
  • Toggle /vim mode for modal keybindings if you prefer keyboard-centric terminal navigation.
Essential Gemini CLI Slash Commands
1/tools      - List, enable, or disable active tools and MCP servers2/chat       - Save, list, resume, or export conversation checkpoints3/vim        - Toggle Vim-style modal keybindings in the interactive prompt4/bug        - Report an issue or bug directly to the Gemini CLI repository5/help       - Display available slash commands and usage shortcuts
Managing Conversation Checkpoints
1# Save current conversation checkpoint2/chat save feature-auth-debug3 4# List all saved conversation sessions5/chat list6 7# Resume a previous conversation checkpoint8/chat load feature-auth-debug

Remember this

Slash commands provide instant system control over tool states, UI modes, and saved session checkpoints.

At (@) Path Annotations: Context Ingestion

The At (@) annotation allows you to dynamically inject specific files, entire directories, or external MCP tools directly into your prompt context.

When you type @src/services/auth.ts, Gemini CLI reads the file contents and prepends it to the prompt payload, ensuring the model has exact source code context.

Quick reference

  • Inject single files: @src/index.ts Explain the entry point logic.
  • Inject directories: @src/components/ Summarize our UI component structure.
  • Inject MCP tools: @postgres-mcp Execute a SELECT query on active subscriptions.

Remember this

Using @path annotations guarantees that the model inspects exact, up-to-date repository code without manual copy-pasting.

Exclamation (!) Commands: Direct Shell Execution

Prefixing a prompt line with an exclamation mark (!) executes the command directly in your local terminal shell without passing it through model processing.

This provides a seamless bridge between natural language AI prompts and direct bash/zsh execution within the same interactive session. For related workflows, see our Gemini CLI Getting Started Guide and Context Window Management.

Quick reference

  • Run direct shell commands: !git status or !npm test.
  • Inspect system processes: !ps aux | grep node.
  • Combine shell commands with AI analysis: !git diff | gemini Explain these changes.

Remember this

Exclamation mark commands let you execute raw bash operations instantly alongside conversational AI prompts.

Key takeaway

Mastering /, @, and ! syntax turns Gemini CLI into a fluid extension of your command-line workflow, allowing you to control tools, inject files, and execute shell commands at full speed.

Share:

Related Articles

Gemini CLI (@google/gemini-cli) is an open-source terminal AI agent that brings Google's Gemini models directly into you

Read

Terminal AI agents are replacing simple code completion extensions, providing developers with autonomous command-line as

Read

Unlike basic command-line wrappers that simply send prompts to an API and print text back, Gemini CLI operates as a full

Read

Keep learning

Follow a structured path or browse all courses to go deeper.