docs/reference/commands.md
Gemini CLI supports several built-in commands to help you manage your session,
customize the interface, and control its behavior. These commands are prefixed
with a forward slash (/), an at symbol (@), or an exclamation mark (!).
/)Slash commands provide meta-level control over the CLI itself.
/about/agentslist:
/agents listreload (alias: refresh):
~/.gemini/agents and
.gemini/agents) and reloads the registry./agents reloadenable:
/agents enable <agent-name>disable:
/agents disable <agent-name>config:
/agents config <agent-name>/auth/bug/bug will become the headline for the bug being filed. The default /bug
behavior can be modified using the advanced.bugCommand setting in your
.gemini/settings.json files./chat/resume. Both commands now expose the same
session browser action and checkpoint subcommands./chat (or /resume):
-- auto --
list (selecting this opens the auto-saved session browser)-- checkpoints --
list, save, resume, delete, share (manual tagged checkpoints)/cha or /resu) resolve to the same grouped
menu.debug
delete <tag>
/resume delete <tag>list
/resume listresume <tag>
/resume resume <tag>save <tag>
<tag> for identifying the conversation state.~/.gemini/tmp/<project_hash>/C:\Users\<YourUsername>\.gemini\tmp\<project_hash>\/resume save <tag>share [filename]
/chat share file.md or /chat share file.json./resume share [filename]/clear/commands.toml files.reload:
~/.gemini/commands/, project-level
<project>/.gemini/commands/, MCP prompts, and extensions). Use this to
pick up new or modified .toml files without restarting the CLI./commands reload/compress/copyxclip or xsel. You can typically install them
using your system's package manager.pbcopy, and on Windows, it requires clip. These
tools are typically pre-installed on their respective systems./directory (or /dir)add:
/directory add <path1>,<path2>--include-directories when starting the session instead.show:
/directory add and
--include-directories./directory show/docs/editor/extensionsconfig:
disable:
enable:
explore:
install:
link:
list:
restart:
uninstall:
update:
/help (or /?)/hooksdisable-all:
disable <hook-name>:
enable-all:
enable <hook-name>:
list (or show, panel):
/idedisable:
enable:
install:
status:
/initGEMINI.md file, this command
analyzes the current directory and generates a tailored context file, making
it simpler for them to provide project-specific instructions to the Gemini
agent./mcpauth:
/mcp auth <server-name><server-name> is provided, it initiates the OAuth flow
for that server. If no server name is provided, it lists all configured
servers that support OAuth authentication.desc
disable
enable
list or ls:
reload:
schema:
/memoryGEMINI.md files).add:
/memory add <text to remember>list:
refresh:
GEMINI.md files found in the configured locations (global,
project/ancestors, and sub-directories). This command updates the model
with the latest GEMINI.md content.show:
GEMINI.md files. This
lets you inspect the instructional context being provided to the Gemini
model.GEMINI.md files contribute to
hierarchical memory, see the
CLI Configuration documentation./modelmanage:
set:
/model set <model-name> [--persist]/permissionstrust:
/permissions trust [<directory-path>]/plangeneral.plan.enabled setting in your configuration.copy:
/policieslist:
/privacy/quit (or /exit)/restore/restore [tool_call_id]/rewind/resume/resume to open the interactive session browser for
automatically saved conversations./resume save,
/resume resume, etc.)./ to search through conversation content across all
sessions/chat provides the same behavior and subcommands.list
save <tag>
resume <tag> (alias: load)
delete <tag>
share [filename]
debug
/resume checkpoints ... is still accepted for the
same checkpoint commands./settings.gemini/settings.json file, but with
validation and guidance to prevent errors. See the
settings documentation for a full list of available
settings./settings and the editor will open. You can then
browse or search for specific settings, view their current values, and modify
them as desired. Changes to some settings are applied immediately, while
others require a restart./shells (or /bashes)/setup-github/skillsdisable <name>:
/skills disable <name>enable <name>:
/skills enable <name>list:
reload:
/statssession:
model:
tools:
/terminal-setup/theme/tools/tools [desc]desc or descriptions:
nodesc or nodescriptions:
/upgrade/vim3h, 5w,
10G)x, change with c, insert with i,
a, o, O; complex operations like dd, cc, dw, cwh, j, k, l; jump by words with w,
b, e; go to line start/end with 0, $, ^; go to specific lines with
G (or gg for first line)~/.gemini/settings.json and restored between sessions. to repeat the last editing operation[NORMAL] or [INSERT] in the
footerCustom commands allow you to create personalized shortcuts for your most-used prompts. For detailed instructions on how to create, manage, and use them, see the dedicated Custom Commands documentation.
These shortcuts apply directly to the input prompt for text manipulation.
Undo:
Redo:
@)At commands are used to include the content of files or directories as part of your prompt to Gemini. These commands include git-aware filtering.
@<path_to_file_or_directory>
@path/to/your/file.txt Explain this text.@src/my_project/ Summarize the code in this directory.What is this file about? @README.md@My\ Documents/file.txt).read_many_files tool internally. The content is
fetched and then inserted into your query before being sent to the Gemini
model.node_modules/, dist/, .env, .git/) are excluded. This behavior can
be changed via the context.fileFiltering settings.read_many_files tool to ensure
performance and relevance. The tool indicates if files were skipped.read_many_files was used, along with a message detailing the status and
the path(s) that were processed.@ (Lone at symbol)
@ symbol without a path, the query is
passed as-is to the Gemini model. This might be useful if you are
specifically talking about the @ symbol in your prompt.@ commands@ is not found or is invalid, an error message
will be displayed, and the query might not be sent to the Gemini model, or it
will be sent without the file content.read_many_files tool encounters an error (for example, permission
issues), this will also be reported.!)The ! prefix lets you interact with your system's shell directly from within
Gemini CLI.
!<shell_command>
<shell_command> using bash on
Linux/macOS or powershell.exe -NoProfile -Command on Windows (unless you
override ComSpec). Any output or errors from the command are displayed in
the terminal.!ls -la (executes ls -la and returns to Gemini CLI)!git status (executes git status and returns to Gemini CLI)! (Toggle shell mode)
! on its own toggles shell mode.
Caution for all ! usage: Commands you execute in shell mode have the
same permissions and impact as if you ran them directly in your terminal.
Environment variable: When a command is executed via ! or in shell mode,
the GEMINI_CLI=1 environment variable is set in the subprocess's
environment. This allows scripts or tools to detect if they are being run from
within Gemini CLI.