Skip to main content
Watch: I Built an AI App Without Leaving Databricks

Gemini CLI reference - CLI flags

Gemini CLI command-line flags

Gemini CLI documents 31 CLI flags, including --skip-trust, --approval-mode and --acp. You pass these to gemini on the command line. Each row gives the docs' description, accepted values and an example where one is documented.

Last verified 6 official pagesFull Gemini CLI reference

Gemini CLI CLI flags
FlagDescriptionExample
--debug, -d

Run in debug mode with verbose logging. Open the debug console with F12 to see the additional logging.

boolean; default: false

Docs: --debug, -d
-no example
--version, -v

Show CLI version number and exit.

Docs: --version, -v
gemini --version
--help, -h

Show help information about command-line arguments.

Docs: --help, -h
-no example
--model, -m

Model to use for this session. Accepts aliases (auto, pro, flash, flash-lite) or concrete model names.

string; default: auto

Docs: --model, -m
-no example
--prompt, -p

Prompt text, appended to stdin input if provided. Forces non-interactive mode.

string

Docs: --prompt, -p
gemini -p "summarize README.md"
--prompt-interactive, -i

Execute the prompt and continue in interactive mode. Cannot be used when piping input from stdin.

string

Docs: --prompt-interactive, -i
gemini -i "What is the purpose of this project?"
--worktree, -w

Start Gemini in a new git worktree; a name is generated if none is given. Requires experimental.worktrees: true.

string (optional name)

Docs: --worktree, -w
gemini --worktree feature-search
--sandbox, -s

Run in a sandboxed environment for safer execution.

boolean; default: false

Docs: --sandbox, -s
gemini -s -p "analyze the code structure"
--skip-trust

Trust the current workspace for this session, skipping the folder trust check.

boolean; default: false

Docs: --skip-trust
-no example
--approval-mode

Approval mode for tool execution: default prompts, auto_edit auto-approves edit tools, yolo auto-approves all, plan is read-only. Cannot be combined with --yolo.

string; choices: default, auto_edit, yolo, plan; default: default

Docs: --approval-mode
gemini --approval-mode auto_edit
--yolo, -y

Deprecated. Auto-approve all actions; use --approval-mode=yolo instead.

boolean; default: false

Docs: --yolo, -y
-no example
--acp

Starts the agent in Agent Client Protocol (ACP) mode, JSON-RPC over stdio for IDE and tool integrations.

boolean

Docs: --acp
gemini --acp
--experimental-acp

Start in ACP mode. Experimental feature.

boolean

Docs: --experimental-acp
-no example
--experimental-zed-integration

Run in Zed editor integration mode. Experimental feature.

boolean

Docs: --experimental-zed-integration
-no example
--allowed-mcp-server-names

Allowed MCP server names for the session (comma-separated or multiple flags).

array

Docs: --allowed-mcp-server-names
-no example
--allowed-tools

Deprecated; use the Policy Engine instead. Tools allowed to run without confirmation.

array

Docs: --allowed-tools
gemini --allowed-tools "ShellTool(git status)"
--extensions, -e

List of extensions to use; all are enabled if omitted. Use -e none to disable all extensions.

array

Docs: --extensions, -e
gemini -e my-extension -e my-other-extension
--list-extensions, -l

List all available extensions and exit.

boolean

Docs: --list-extensions, -l
-no example
--resume, -r

Resume a previous session by "latest", index number, or session UUID; defaults to "latest".

string

Docs: --resume, -r
gemini --resume 5
--list-sessions

List available sessions for the current project and exit.

boolean

Docs: --list-sessions
gemini --list-sessions
--delete-session

Delete a session by index number or full session UUID.

string

Docs: --delete-session
gemini --delete-session 3
--include-directories

Additional workspace directories (comma-separated or multiple flags). 5 directories can be added at maximum.

array

Docs: --include-directories
--include-directories /path/to/project1,/path/to/project2
--screen-reader

Enable screen reader mode for accessibility.

boolean

Docs: --screen-reader
-no example
--output-format, -o

Output format for non-interactive mode.

string; choices: text, json, stream-json; default: text

Docs: --output-format, -o
-no example
--fake-responses

Path to a file with fake model responses for testing.

string (path)

Docs: --fake-responses
-no example
--record-responses

Path to a file to record model responses for testing.

string (path)

Docs: --record-responses
-no example
--admin-policy

Supplemental admin policy path; ignored if .toml policy files exist in the standard system location.

string (path)

Docs: --admin-policy
-no example
query (positional)

Positional prompt. Defaults to interactive mode in a TTY; use -p/--prompt for non-interactive execution.

string (variadic)

Docs: query (positional)
gemini "explain this project"
gemini mcp add --scope, -s

Configuration scope: user (~/.gemini/settings.json) or project (.gemini/settings.json).

user or project; default: "project"

Docs: gemini mcp add --scope, -s
gemini mcp add db node db-server.js --scope user
gemini mcp add --transport, -t

Transport type for the server.

stdio, sse, http; default: "stdio"

Docs: gemini mcp add --transport, -t
gemini mcp add --transport http http-server https://api.example.com/mcp/
gemini extensions install --ref

The git ref (branch, tag, or commit) to install.

Docs: gemini extensions install --ref
gemini extensions install https://github.com/user/my-extension --ref develop

The rest of the Gemini CLI reference

FAQ

How many CLI flags does Gemini CLI have?

The official Gemini CLI docs list 31 CLI flags, including --skip-trust, --approval-mode and --acp. All of them are in the table above, in the docs' order.

What does --debug, -d do in Gemini CLI?

Run in debug mode with verbose logging. Open the debug console with F12 to see the additional logging. Values: boolean; default: false.

Where are Gemini CLI command-line flags documented?

On 6 official docs pages at github.com, last read on October 17, 2026. Every row in the table links the exact section it came from.

More on Gemini CLI

Sources

Last verified . Names and examples are copied verbatim from the 6 official pages below, and every row above links the exact section it came from.

Newsletter

Know when your tools change

One email per week. New coding agent releases, the flags and commands they add, and what they mean for how you work.