@@ -52,6 +52,58 @@ and Gemini CLI (the server).
5252The core of the ACP implementation can be found in
5353` packages/cli/src/acp/acpClient.ts ` .
5454
55+ ## Host input extensions
56+
57+ ACP covers prompts, cancellations, permissions, and session control. Gemini CLI
58+ also exposes a Gemini-specific ACP extension for structured host input so an ACP
59+ client can surface questions in its own UI instead of handing control back to
60+ the terminal.
61+
62+ During ` initialize ` , Gemini CLI advertises the extension in
63+ ` agentCapabilities._meta.geminiCli.hostInput ` :
64+
65+ ``` json
66+ {
67+ "version" : 1 ,
68+ "requestUserInput" : true ,
69+ "method" : " gemini/requestUserInput" ,
70+ "supportedKinds" : [" ask_user" , " exit_plan_mode" ]
71+ }
72+ ```
73+
74+ To enable host input, the ACP client must advertise
75+ ` clientCapabilities._meta.geminiCli.hostInput ` with ` requestUserInput: true ` .
76+ The client can also narrow support by setting ` supportedKinds ` .
77+
78+ - Include ` ask_user ` to let Gemini CLI surface ` ask_user ` tool requests over
79+ ACP.
80+ - Include ` exit_plan_mode ` to let Gemini CLI surface plan-approval questions
81+ over ACP.
82+ - Omit ` ask_user ` if you want to keep ` ask_user ` disabled in ACP mode while
83+ still supporting other host-input request kinds.
84+
85+ If the client doesn't opt in, Gemini CLI keeps ` ask_user ` excluded in ACP mode.
86+ This preserves the default ACP behavior and avoids opening host-driven dialogs
87+ unless the client has explicitly implemented them.
88+
89+ When Gemini CLI needs host input, it calls ` gemini/requestUserInput ` as an ACP
90+ extension request. The request includes:
91+
92+ - ` sessionId ` for the active ACP session
93+ - ` requestId ` for the host-input interaction
94+ - ` kind ` , such as ` ask_user ` or ` exit_plan_mode `
95+ - ` title ` and ` questions `
96+ - optional ` extraParts `
97+ - optional ` toolCall ` metadata
98+
99+ The client responds with either:
100+
101+ - ` {"outcome":"submitted","answers":{"0":"..."}} `
102+ - ` {"outcome":"cancelled"} `
103+
104+ This extension is separate from MCP. Use it when you want Gemini CLI to keep
105+ owning the tool flow while your ACP host owns the user-facing input surface.
106+
55107### Extending with MCP
56108
57109ACP can be used with the Model Context Protocol (MCP). This lets an ACP client
@@ -78,7 +130,7 @@ control Gemini CLI.
78130### Core methods
79131
80132- ` initialize ` : Establishes the initial connection and lets the client to
81- register its MCP server.
133+ register its MCP server and negotiate Gemini-specific ACP extensions .
82134- ` authenticate ` : Authenticates the user.
83135- ` newSession ` : Starts a new chat session.
84136- ` loadSession ` : Loads a previous session.
0 commit comments