Answer: Headless mode is triggered when the CLI is run in a non-TTY environment or when providing a query with the `-p` (or `--prompt`) flag. Status: Confirmed Entry: tool/gemini-cli/agents-and-automation/trigger-headless-mode Revision: 1 Digest: sha256:076ebc7cb7a60fd0 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:17:34Z Last changed: 2026-11-13T03:17:34Z Last verified: 2026-11-20T12:51:04Z Next check: 2026-11-21T12:51:04Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of Trigger condition | non-TTY environment | [1] | 2026-11-20 Flag | -p | [1] | 2026-11-20 Long flag | --prompt | [1] | 2026-11-20 Sources: [1] Google. "Headless mode reference". https://geminicli.com/docs/cli/headless.md Role: primary. Accessed: 2026-11-20T12:51:04Z Quote: "Headless mode is triggered when the CLI is run in a non-TTY environment or when" (Supports: Trigger condition) Quote: "providing a query with the `-p` (or `--prompt`) flag." (Supports: Flag, Long flag) Published: 2026-10-16T02:36:07Z Snapshot SHA-256: 0c76556026820577ca1ead8c836c590a079e637100bff9790c0f1599d0f9f172 (captured 2026-11-13T03:17:33Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-13T03:17:34Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:51:04Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:51:04Z Last attempt: 2026-11-20T12:51:04Z Notes and limitations: Extracted automatically from a single official source (section "Technical reference"). Related: https://latestn.com/tool/gemini-cli/agents-and-automation/trusted-folders-headless How does Gemini CLI handle trusted folders in headless or automated environments? https://latestn.com/tool/gemini-cli/agents-and-automation/unassign-inactive-assignees How does Gemini CLI automatically unassign inactive issue assignees? https://latestn.com/tool/gemini-cli/agents-and-automation/use-agent-skill-in-session How do I activate or use an Agent Skill during a Gemini CLI session? https://latestn.com/tool/gemini-cli/agents-and-automation/steer-research-phase How do I steer Gemini CLI's research phase during Plan Mode? https://latestn.com/tool/gemini-cli/agents-and-automation/streaming-json-event-types What event types does Gemini CLI streaming JSON output emit? https://latestn.com/tool/gemini-cli/agents-and-automation/tool-hook-matchers How do I use a matcher to filter which tools a Gemini CLI hook runs for? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:17:34Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/gemini-cli/agents-and-automation/trigger-headless-mode/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/gemini-cli/agents-and-automation/trigger-headless-mode POST: https://latestn.com/dispute/tool/gemini-cli/agents-and-automation/trigger-headless-mode with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/gemini-cli/agents-and-automation/trigger-headless-mode?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I trigger headless mode in Gemini CLI? Revision 1, last verified 2026-11-20T12:51:04Z. https://latestn.com/tool/gemini-cli/agents-and-automation/trigger-headless-mode (accessed 2026-11-21T09:57:47Z). @misc{LatestN_tool_gemini_cli_agents_and_automation_trigger_headless_mode_r1, title = {How do I trigger headless mode in Gemini CLI?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/gemini-cli/agents-and-automation/trigger-headless-mode}}, note = {Revision 1; digest sha256:076ebc7cb7a60fd0; last verified 2026-11-20T12:51:04Z; accessed 2026-11-21T09:57:47Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/gemini-cli/agents-and-automation/trigger-headless-mode