Gemini CLI keyboard shortcuts, slash commands and flags

Keys, slash commands and launch options of Gemini CLI 0.63.0, Google's terminal coding agent, checked against the keyboard-shortcut, command and cheatsheet pages in its repository and the CLI's own help output. A single column serves Windows, macOS and Linux, because the bindings are terminal keys; only undo differs by system. Words in capitals such as QUERY or NAME stand for your own value. Vim keys apply once /vim is on, and every default can be remapped in ~/.gemini/keybindings.json.

307 shortcuts in 20 sections. Checked row by row against Gemini CLI documentation: Keyboard shortcuts (release v0.63.0) on . Edited by Jay.

Prompt input 12

ActionShortcut
Send the promptPlain Enter never adds a line break, so multi-line text needs one of the newline keys.Enter
Queue a follow-up promptWhile a task is running, the typed text waits and is handled once that task ends.Tab
Insert a line breakShift + Enter fails in the macOS Terminal app and needs Windows Terminal 1.25 or later.Ctrl+EnterorCmd+EnterorAlt+EnterorShift+EnterorCtrl+J
Break the line with a backslashType the backslash as the last character, then Enter; the input stays in single-line mode.\thenEnter
Open external editorHands the prompt being written, or a plan on screen, to your configured editor.Ctrl+GorCtrl+Shift+G
Edit the presented planWorks while a plan is on screen; the key table also lists it as the deprecated external-editor command.Ctrl+X
Paste from the clipboardCtrl+VorCmd+VorAlt+V
Expand a paste placeholderWith the cursor on a [Pasted Text: X lines] marker, shows or hides the pasted text inline.Ctrl+O
Expand a placeholder by mouseAlternate buffer mode only; a second double-click folds the text away again.Double-click
Toggle the shortcuts panelWorks on an empty prompt; Esc, Backspace or any printable key closes the panel again.?
Switch minimal and full UIPress Tab twice while typing with no completion or search active; the choice is remembered for later sessions.TabthenTab
Push to talk in Voice ModeHold the key down for as long as you are speaking.Space

Cursor movement 8

ActionShortcut
Go to line startCtrl+AorHome
Go to line endCtrl+EorEnd
Move up one lineOn the top line of the input it recalls the previous prompt from history instead.Up
Move down one lineOn the bottom line of the input it steps forward through prompt history instead.Down
Move left one characterLeft
Move right one characterRightorCtrl+F
Move left one wordCtrl+LeftorAlt+LeftorAlt+B
Move right one wordCtrl+RightorAlt+RightorAlt+F

Editing text 9

Where Google's key table prints Cmd/Win, this page writes Cmd: the Command key on a Mac keyboard, the Windows key on others.

ActionShortcut
Delete to line endCtrl+K
Delete to line startCtrl+U
Clear the inputWipes everything typed in the input field; on an empty input the same key cancels or quits.Ctrl+C
Delete previous wordCtrl+BackspaceorAlt+BackspaceorCtrl+W
Delete next wordCtrl+DeleteorAlt+DeleteorAlt+D
Delete previous characterBackspaceorCtrl+H
Delete next characterOn an empty input, Ctrl + D exits the CLI instead.DeleteorCtrl+D
Undo a text editThe commands page gives Ctrl + Z for Windows, Cmd + Z for macOS and Alt + Z for Linux or WSL.Ctrl+ZorAlt+ZorCmd+Z
Redo a text editRestores the change that the last undo removed from the input.Ctrl+Shift+ZorCmd+Shift+ZorAlt+Shift+Z

History and suggestions 11

ActionShortcut
Previous history entryCtrl+P
Next history entryCtrl+N
Browse prompt historyTakes effect when the cursor sits on the top or bottom line of a single-line input.UporDown
Reverse history searchOpens a backwards search over the prompts entered earlier.Ctrl+R
Submit the search matchOnly during a reverse search, where it sends the match that is selected.Enter
Accept a search suggestionOnly applies while a reverse history search is open.Tab
Accept the inline suggestionTaborEnter
Previous completion optionUporCtrl+P
Next completion optionDownorCtrl+N
Expand an inline suggestionRight
Collapse an inline suggestionLeft

Approval modes and session control 8

In Windows Terminal, Shift+Tab is not supported on Node 20 and on earlier versions of Node 22.

ActionShortcut
Cycle approval modesSteps through default, auto-edit and plan; plan is left out while the agent is busy.Shift+Tab
Toggle YOLO modeWhile it is on, tool calls go ahead without asking for approval.Ctrl+Y
Cancel request or quitStops the request in progress, or quits the CLI if the input is already empty.Ctrl+C
Exit the CLIExits only when nothing is typed; with text present it deletes the character to the right.Ctrl+D
Dismiss or cancelCloses the open dialog or cancels whatever currently has focus.EscorCtrl+[
Clear input or rewindClears a prompt that has text in it; on an empty one it opens the rewind view of earlier interactions.EscthenEsc
Suspend the CLICtrl+Z
Restart the applicationRorShift+R

Scrolling and display 17

ActionShortcut
Scroll content upShift+Up
Scroll content downShift+Down
Scroll to the topCtrl+HomeorShift+Home
Scroll to the bottomCtrl+EndorShift+End
Scroll up one pagePage Up
Scroll down one pagePage Down
Clear the screenRedraws the UI and keeps the conversation; /clear is what starts a new session.Ctrl+L
Show or hide the TODO listCtrl+T
Expand or collapse output blocksApplies outside alternate buffer mode, to long blocks of content.Ctrl+O
Toggle Markdown renderingAlt+M
Toggle mouse modeMouse mode is what lets you scroll and click inside the UI.Ctrl+S
Toggle copy modeOnly has an effect when the UI runs in alternate buffer mode.F9
Toggle the debug consoleShows detailed error information, plus the extra logging when started with --debug.F12
Show IDE context detailsF4
Start recording the sessionF6
Stop recording the sessionF7
Dump the current frameSaves the frame on screen as a snapshot.F8

Dialogs and lists 14

ActionShortcut
Confirm the selectionEnter
Select the previous list itemUp
Select the next list itemDown
Previous dialog optionUporK
Next dialog optionDownorJ
Next dialog item or questionTab
Previous dialog item or questionShift+Tab
Pick a numbered optionIn selection dialogs; multi-digit numbers work, and the option is confirmed once the whole number is typed.1-9
Search the session browserTyping after the slash filters the /resume list by session ID or content./
Resume the selected sessionEnter
Close the session browserEsc
Delete the highlighted sessionWorks on the entry you have navigated to in the /resume session browser.X
Update the current extensionDoes something only if an update is available for it.I
Link the extension locallyL

Shell focus and background shells 9

ActionShortcut
Focus the active shellMoves keyboard focus from the Gemini prompt into the shell that is running.Tab
Return focus to GeminiLeaves the shell input and puts focus back on the prompt.Shift+Tab
Show or hide background shellCtrl+B
Toggle the background shell listCtrl+L
Kill the background shellCtrl+K
Select a background shellConfirms the entry highlighted in the background shell list.Enter
Dismiss the background shell listEsc
Leave the background shellFocus goes from the background shell back to Gemini.Shift+Tab
Leave the background shell listFocus goes from the list of background shells back to Gemini.Tab

File references and shell mode 6

ActionShortcut
Reference a file or directoryType a path right after the sign to add its content to the prompt; git-ignored files are skipped by default.@
Include one fileThe file is read and its text is inserted into the query before it is sent.@path/to/your/file.txt
Include a whole directoryReads the files in that folder and in its subdirectories.@src/my_project/
Reference a path with spacesPut a backslash before each space in the path.@My\ Documents/file.txt
Toggle shell modeTyped alone on an empty prompt; while it is on, each line you enter runs as a shell command.!
Run one shell commandWhatever follows the exclamation mark runs in bash, or PowerShell on Windows, and control then returns to Gemini CLI.!ls -la

Vim mode switching and movement 24

ActionShortcut
Return to NORMAL modeLeaves INSERT mode; the status footer then shows [NORMAL].Esc
Insert at the cursori
Insert after the cursora
Insert at line startI
Insert at line endA
Open a line belowAdds the new line under the current one and switches to INSERT mode.o
Open a line aboveO
Clear the input (NORMAL mode)EscthenEsc
Move lefth
Move downj
Move upk
Move rightl
Go to line start0
Go to first non-blank character^
Go to line end$
Forward one wordw
Back one wordb
Go to word ende
Forward one WORDW
Back one WORDB
Go to WORD endE
Go to first linegg
Go to last lineG
Go to line NN stands for the line number, typed before the command.N GorN gg

Vim mode editing 27

A count typed first repeats a command: 3dd deletes three lines and 2cw changes two words. Delete and change also combine with character finds, as in dfx or cTx.

ActionShortcut
Delete character under cursorx
Delete to line endD
Delete linedd
Change to line endC
Change linecc
Delete forward one worddw
Delete back one worddb
Delete to word endde
Delete forward one WORDdW
Delete back one WORDdB
Delete to WORD enddE
Change forward one wordcw
Change back one wordcb
Change to word endce
Change forward one WORDcW
Change back one WORDcB
Change to WORD endcE
Delete to line startd0
Delete to first non-blankd^
Change to line startc0
Change to first non-blankc^
Delete up to first linedgg
Delete down to last linedG
Change up to first linecgg
Change down to last linecG
Undo last changeu
Repeat last command.

Vim mode find, yank and paste 17

ActionShortcut
Find character forwardf{char}
Find character backwardF{char}
Jump to just before next matcht{char}
Jump to just after previous matchT{char}
Repeat character find;
Repeat find in reverse,
Delete character before cursorX
Toggle case under cursor~
Replace character under cursorr{char}
Yank lineyy
Yank to line endYory$
Yank wordyw
Yank WORDyW
Yank to word endye
Yank to WORD endyE
Paste after cursorp
Paste before cursorP

Slash commands for sessions and context 24

ActionShortcut
Browse and resume sessionsOpens the session browser for automatically saved conversations; checkpoint subcommands hang off the same command./resume
Alias of /resumeKept as a second name: it opens the same session browser and takes the same checkpoint subcommands./chat
List saved checkpointsCheckpoints are project-scoped, so tags from other project directories do not appear./resume list
Save a tagged checkpointStores the conversation so far under the tag you give; the tag is required./resume save TAG
Load a tagged checkpointOnly checkpoints saved in the same project can be loaded; /resume load is an alias./resume resume TAG
Delete a tagged checkpoint/resume delete TAG
Export the conversationGive a .md or .json name for Markdown or JSON; without a name the CLI generates one./resume share FILENAME
Clear context and screenWipes the conversation context as well as the display, unlike Ctrl + L, which only redraws the UI./clear
Summarise the chat contextReplaces the whole context with a summary, which saves tokens on later tasks./compress
Rewind the conversationPick an earlier interaction, then rewind the history, revert the code changes, or both./rewind
List restorable checkpointsRun with no tool call ID; it needs checkpointing to be configured in settings./restore
Restore files to a checkpointPuts project files back as they were just before that tool call ran, undoing its edits./restore TOOL_CALL_ID
Copy the last outputUses pbcopy, xclip or clip locally and OSC 52 in SSH or WSL sessions./copy
Show the loaded contextPrints the combined text of every GEMINI.md file currently in use./memory show
Reload GEMINI.md context files/memory refresh does the same re-scan of all context files./memory reload
List loaded context file paths/memory list
Generate a GEMINI.md fileAnalyses the current directory and writes a context file tailored to the project./init
Add workspace directoriesSeveral paths can be given at once, separated by commas; /dir is the short name./directory add PATH
List workspace directoriesCovers folders added with /directory add as well as with --include-directories./directory show
Switch to Plan ModePlan Mode is read-only; the command also shows the current plan when one exists./plan
Plan toward a stated goalSwitches to Plan Mode and submits the text straight away as the prompt./plan GOAL
Copy the approved plan/plan copy
Exit Gemini CLI/exit is accepted as another name for it./quit
Exit and erase the sessionAlso wipes the chat recording, tool outputs and other history of this session for good./quit --delete

Slash commands for tools and extensions 32

ActionShortcut
List available tools/tools
List tools with descriptionsEach name comes with the full description that is handed to the model; descriptions is the long spelling./tools desc
List tool names only/tools nodesc
List MCP servers and toolsListing is the default action; enable, disable and schema are further subcommands./mcp
List servers with descriptions/mcp desc
Sign in to an MCP serverBegins OAuth sign-in for the named server; leave the name out to see which servers offer OAuth./mcp auth SERVER-NAME
Reload MCP serversRestarts the servers and discovers their tools again./mcp reload
Manage extensionsSubcommands include list, install, update, enable, disable, link, uninstall, explore and config./extensions
Reload active extensions/extensions reload
Manage Agent SkillsSubcommands are list, enable, disable and reload./skills
Enable a skill/skills enable NAME
Disable a skill/skills disable NAME
Reload discovered skillsRescans the workspace, user and extension tiers for skills./skills reload
List subagentsShows local and remote agents along with the built-in ones./agents list
Reload the agent registryRescans ~/.gemini/agents and .gemini/agents; refresh is an alias./agents reload
Enable a subagent/agents enable AGENT-NAME
Disable a subagent/agents disable AGENT-NAME
Configure a subagentOpens a dialog for the agent's model, temperature and execution limits./agents config AGENT-NAME
View registered hooksShows every hook with its status; list and show open the same view./hooks panel
Enable all hooks/hooks enable-all
Disable all hooks/hooks disable-all
Enable one hook/hooks enable NAME
Disable one hook/hooks disable NAME
List custom command filesLists .toml files from the user folder, the project folder and active extensions./commands list
Reload custom commandsRun it after adding or editing a .toml file so no restart is needed./commands reload
Check the IDE connection/ide status
Install the IDE companion/ide install
Turn on IDE integration/ide enable
Turn off IDE integration/ide disable
Manage folder trust/permissions trust DIRECTORY-PATH
List active policiesPolicies are shown grouped by mode./policies list
Open background shells view/bashes is a second name for the same view of long-running background processes./shells

Slash commands for settings and help 19

ActionShortcut
Show command helpLists the available commands and how to use them; /? is the short form./help
Show version infoUseful to paste into an issue report./about
Change the sign-in methodOpens a dialog for choosing a different authentication method./auth
File an issueText typed after the command becomes the headline of the issue, filed on GitHub by default./bug
Open the documentationOpens the Gemini CLI docs in your browser./docs
Choose an external editorOpens a dialog listing the supported editors./editor
Manage model configurationHas two subcommands: manage opens a dialog and set takes a model name./model
Open the model dialog/model manage
Set the model by nameThe usage line also accepts an optional --persist flag./model set MODEL-NAME
Open the settings editorEdits the same values as .gemini/settings.json, with validation; some changes need a restart./settings
Change the visual theme/theme
Toggle vim modeThe setting is saved to ~/.gemini/settings.json and the footer shows [NORMAL] or [INSERT]./vim
Show session statisticsDefaults to the session view, with duration, tool-call and performance figures./stats
Show per-model usageIncludes token counts and quota information./stats model
Show per-tool usage/stats tools
Show the Privacy NoticeAlso lets you choose whether to consent to data collection for service improvement./privacy
Set up multiline keybindingsConfigures terminal keybindings for multiline input in VS Code, Cursor and Windsurf./terminal-setup
Set up GitHub ActionsSets up workflows in which Gemini triages issues and reviews pull requests./setup-github
Open the upgrade pageOpens the Gemini Code Assist page in a browser; only offered when logged in with Google./upgrade

Installing and starting 10

The cheatsheet also lists gemini update, but the help output of release 0.63.0 has no update command; reinstall the npm package with the @latest tag to upgrade.

ActionShortcut
Install with npmGlobal install; add @latest, @preview or @nightly to the package name to choose a release channel.npm install -g @google/gemini-cli
Run without installingnpx @google/gemini-cli
Install with HomebrewThe Homebrew package is offered for macOS and Linux.brew install gemini-cli
Start an interactive sessiongemini
Start with an opening promptThe query is answered first and the session then stays interactive.gemini QUERY
Run one prompt and exitNon-interactive (headless) mode; --prompt is the long form, and the prompt is appended to anything piped on stdin.gemini -p QUERY
Run a prompt, then stay interactiveLong form --prompt-interactive; it cannot be combined with input piped on stdin.gemini -i QUERY
Pipe content into GeminiPowerShell users pipe with Get-Content in place of cat.cat FILE | gemini
Print the version numbergemini --version
Show command-line helpgemini --help

Command-line options 17

ActionShortcut
Choose the modelLong form --model; takes an alias (auto, pro, flash, flash-lite) or a concrete model name.gemini -m MODEL
Ask before each tool callThis is the mode the CLI starts in when no flag is given.gemini --approval-mode default
Auto-approve edit toolsEdits are applied without asking; other tool calls still prompt.gemini --approval-mode auto_edit
Auto-approve every tool callReplaces the deprecated --yolo (-y) flag.gemini --approval-mode yolo
Start in read-only Plan ModeThe Plan Mode guide also writes it with an equals sign, --approval-mode=plan.gemini --approval-mode plan
Run in a sandboxShort form -s; tools then execute inside a sandboxed environment.gemini --sandbox
Trust this workspace onceSkips the folder trust check for the current session only.gemini --skip-trust
Work in a fresh git worktreeShort form -w; a name is generated if none is given, and experimental.worktrees must be enabled in settings.gemini --worktree NAME
Add directories at launchComma-separated list, or repeat the flag; the configuration reference caps it at five directories.gemini --include-directories DIRECTORIES
Load only named extensionsLong form --extensions; repeat the flag for several, and without it every extension is used.gemini -e EXTENSION_NAME
Start with extensions disabledgemini -e none
List extensions and exitgemini --list-extensions
Restrict MCP serversOnly the named servers are allowed for the session; separate several with commas.gemini --allowed-mcp-server-names NAMES
Print the result as JSONMeant for non-interactive runs; -o is the short form.gemini --output-format json
Stream events as JSONEmits newline-delimited JSON events in real time while the run is in progress.gemini --output-format stream-json
Run with verbose loggingShort form -d; F12 opens the debug console where the extra output appears.gemini --debug
Enable screen reader modegemini --screen-reader

Sessions from the command line 8

ActionShortcut
Resume the latest sessionShort form -r; with no value the newest session is the one loaded.gemini --resume
Resume a session by indexIndex numbers come from the --list-sessions output.gemini --resume INDEX
Resume by ID with a promptgemini -r SESSION-ID QUERY
Continue with a new promptReopens the most recent session and sends the query to it.gemini -r latest QUERY
List saved sessionsPrints the sessions of the current project with their index numbers, then exits.gemini --list-sessions
Delete a saved sessionTakes the index number shown by --list-sessions, or the session ID.gemini --delete-session INDEX
Start with a chosen session IDgemini --session-id UUID
Load a session from JSONgemini --session-file FILE

Extension commands 15

ActionShortcut
Install an extensionThe source is a Git URL or a local path.gemini extensions install SOURCE
Install from a branch, tag or commitgemini extensions install SOURCE --ref REF
Install with auto-update ongemini extensions install SOURCE --auto-update
Allow pre-release versionsgemini extensions install SOURCE --pre-release
Skip the install confirmationAcknowledges the security risks up front, so no prompt appears.gemini extensions install SOURCE --consent
Uninstall extensionsSeveral names can be given in one command.gemini extensions uninstall NAME
List installed extensionsgemini extensions list
Update one extensiongemini extensions update NAME
Update every extensiongemini extensions update --all
Enable an extensiongemini extensions enable NAME
Disable an extensiongemini extensions disable NAME
Link a local extensionFor development: changes made in the local path are always reflected.gemini extensions link PATH
Create an extension from a templateA template name can follow the path, for example mcp-server, hooks or custom-commands.gemini extensions new PATH
Validate an extensiongemini extensions validate PATH
Configure an extension settingBoth arguments are optional; --scope chooses user or workspace.gemini extensions config NAME SETTING

MCP server, skill and hook commands 20

ActionShortcut
Add a stdio MCP serverEverything after the name is the command that launches the server; stdio is the default transport.gemini mcp add NAME COMMAND
Add an HTTP MCP serverTransport can be stdio, sse or http; stdio is the default.gemini mcp add NAME URL --transport http
Set server environment variablesgemini mcp add NAME COMMAND --env KEY=value
Save the server in user scopeWithout the flag the server is saved in the project scope.gemini mcp add NAME COMMAND --scope user
Expose only selected toolsgemini mcp add NAME COMMAND --include-tools TOOL1,TOOL2
Trust the serverTool calls from this server skip every confirmation prompt.gemini mcp add NAME COMMAND --trust
Send an HTTP headerShort form -H; repeat it for each header, for SSE and HTTP transports only.gemini mcp add NAME URL --header HEADER
Remove an MCP serverActs on the project scope unless --scope user is added.gemini mcp remove NAME
List configured MCP serversgemini mcp list
Enable an MCP servergemini mcp enable NAME
Disable an MCP servergemini mcp disable NAME
Disable for this session onlygemini mcp disable NAME --session
List discovered skillsgemini skills list
Include built-in skillsgemini skills list --all
Install a skillSource can be a Git repository, a local path or a file; --scope picks user or workspace.gemini skills install SOURCE
Link local skillsCreates a symlink, so later changes in the source folder show up at once.gemini skills link PATH
Uninstall a skillgemini skills uninstall NAME
Enable a skill from the shellgemini skills enable NAME
Disable a skill from the shellgemini skills disable NAME
Migrate hooks from Claude Codegemini hooks migrate --from-claude

Notes

Prompting and history

Enter submits, and a newline needs a modifier: Ctrl + Enter, Alt + Enter, Shift + Enter or Ctrl + J. Ctrl + R starts a reverse search through your prompt history, and Ctrl + P and Ctrl + N step to the previous and next entries. Tab queues the current prompt so it runs after the task in progress, which is useful when you know the next instruction before the model is done. Ctrl + O expands a paste placeholder under the cursor; outside alternate buffer mode it also expands or collapses long blocks of output.

Approval modes and YOLO

Shift + Tab cycles the approval mode (default, auto-edit, plan) that decides whether the CLI asks before running tools and editing files; Ctrl + Y toggles YOLO mode, where every tool call is approved automatically. The same modes can be chosen at launch, for example gemini --approval-mode auto_edit or gemini --approval-mode plan. YOLO is fine for a scratch directory and a bad idea in a repository with uncommitted work: the /restore command can roll back file edits from a checkpoint, but only if checkpointing is configured. Esc, Esc (Escape twice) clears the current input, or opens the rewind view when the prompt is empty, and /rewind opens that view directly.

Shell mode and the editor

Typing ! on an empty prompt toggles shell mode, in which each line runs as a shell command; a one-off such as !ls -la runs a single command and returns to the session, which saves leaving it for a quick git status. Ctrl + G opens the current prompt in your external editor for longer instructions, and Ctrl + T shows or hides the full TODO list. Ctrl + C cancels the current request, or quits the CLI when the input is empty, and Ctrl + D exits at an empty prompt.

Questions

How do I write a multi-line prompt?

Ctrl + Enter, Alt + Enter, Shift + Enter and Ctrl + J insert a newline; Enter alone submits. Ending a line with a backslash before Enter also works. For anything long, Ctrl + G opens the prompt in your editor.

What does YOLO mode do?

It approves every tool call automatically, so tools run and files change without confirmation. Ctrl + Y toggles it during a session, and gemini --approval-mode yolo starts the CLI in it.

Where is the built-in list of shortcuts?

Type ? at an empty prompt to open the shortcuts panel, or run /help for slash commands.

How do I run a shell command without leaving the session?

Start the line with ! (for example !ls -la) and it executes in the shell instead of being sent to the model. Typing ! on its own toggles shell mode.

How do I pick up the previous Gemini CLI session?

gemini --resume reopens the most recent session, gemini --resume INDEX takes a number from gemini --list-sessions, and inside the CLI /resume opens the session browser.

Can the default key bindings be changed?

Yes. Add entries to ~/.gemini/keybindings.json, each with a command name from the shortcut reference and a key; a minus sign in front of the command name removes a default binding.

Sources and checks

3 more source pages

Every row on this page was matched to a line in the documentation above on . A binding that could not be found there is not listed.

Found a wrong or missing key? Tell us and it gets checked against the source. How we verify describes the process and its limits.