diff --git a/docs/cli/cli-reference.md b/docs/cli/cli-reference.md index c1599df69e..bfc6bfc7f5 100644 --- a/docs/cli/cli-reference.md +++ b/docs/cli/cli-reference.md @@ -26,29 +26,29 @@ and parameters. ## CLI Options -| Option | Alias | Type | Default | Description | -| -------------------------------- | ----- | ------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `--debug` | `-d` | boolean | `false` | Run in debug mode with verbose logging | -| `--version` | `-v` | - | - | Show CLI version number and exit | -| `--help` | `-h` | - | - | Show help information | -| `--model` | `-m` | string | `auto` | Model to use. See [Model Selection](#model-selection) for available values. | -| `--prompt` | `-p` | string | - | Prompt text. Appended to stdin input if provided. **Deprecated:** Use positional arguments instead. | -| `--prompt-interactive` | `-i` | string | - | Execute prompt and continue in interactive mode | -| `--sandbox` | `-s` | boolean | `false` | Run in a sandboxed environment for safer execution | -| `--approval-mode` | - | string | `default` | Approval mode for tool execution. Choices: `default`, `auto_edit`, `yolo` | -| `--yolo` | `-y` | boolean | `false` | **Deprecated.** Auto-approve all actions. Use `--approval-mode=yolo` instead. | -| `--experimental-acp` | - | boolean | - | Start in ACP (Agent Code Pilot) mode. **Experimental feature.** | -| `--experimental-zed-integration` | - | boolean | - | Run in Zed editor integration mode. **Experimental feature.** | -| `--allowed-mcp-server-names` | - | array | - | Allowed MCP server names (comma-separated or multiple flags) | -| `--allowed-tools` | - | array | - | **Deprecated.** Use the [Policy Engine](../reference/policy-engine.md) instead. Tools that are allowed to run without confirmation (comma-separated or multiple flags) | -| `--extensions` | `-e` | array | - | List of extensions to use. If not provided, all extensions are enabled (comma-separated or multiple flags) | -| `--list-extensions` | `-l` | boolean | - | List all available extensions and exit | -| `--resume` | `-r` | string | - | Resume a previous session. Use `"latest"` for most recent or index number (e.g. `--resume 5`) | -| `--list-sessions` | - | boolean | - | List available sessions for the current project and exit | -| `--delete-session` | - | string | - | Delete a session by index number (use `--list-sessions` to see available sessions) | -| `--include-directories` | - | array | - | Additional directories to include in the workspace (comma-separated or multiple flags) | -| `--screen-reader` | - | boolean | - | Enable screen reader mode for accessibility | -| `--output-format` | `-o` | string | `text` | The format of the CLI output. Choices: `text`, `json`, `stream-json` | +| Option | Alias | Type | Default | Description | +| ---------------------------- | ----- | ------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `--debug` | `-d` | boolean | `false` | Run in debug mode with verbose logging | +| `--version` | `-v` | - | - | Show CLI version number and exit | +| `--help` | `-h` | - | - | Show help information | +| `--model` | `-m` | string | `auto` | Model to use. See [Model Selection](#model-selection) for available values. | +| `--prompt` | `-p` | string | - | Prompt text. Appended to stdin input if provided. **Deprecated:** Use positional arguments instead. | +| `--prompt-interactive` | `-i` | string | - | Execute prompt and continue in interactive mode | +| `--sandbox` | `-s` | boolean | `false` | Run in a sandboxed environment for safer execution | +| `--approval-mode` | - | string | `default` | Approval mode for tool execution. Choices: `default`, `auto_edit`, `yolo` | +| `--yolo` | `-y` | boolean | `false` | **Deprecated.** Auto-approve all actions. Use `--approval-mode=yolo` instead. | +| `--acp` | `-` | boolean | - | Start in ACP (Agent Client Protocol) mode. | +| `--experimental-acp` | - | boolean | - | **Deprecated.** Use `--acp` instead. | +| `--allowed-mcp-server-names` | - | array | - | Allowed MCP server names (comma-separated or multiple flags) | +| `--allowed-tools` | - | array | - | **Deprecated.** Use the [Policy Engine](../reference/policy-engine.md) instead. Tools that are allowed to run without confirmation (comma-separated or multiple flags) | +| `--extensions` | `-e` | array | - | List of extensions to use. If not provided, all extensions are enabled (comma-separated or multiple flags) | +| `--list-extensions` | `-l` | boolean | - | List all available extensions and exit | +| `--resume` | `-r` | string | - | Resume a previous session. Use `"latest"` for most recent or index number (e.g. `--resume 5`) | +| `--list-sessions` | - | boolean | - | List available sessions for the current project and exit | +| `--delete-session` | - | string | - | Delete a session by index number (use `--list-sessions` to see available sessions) | +| `--include-directories` | - | array | - | Additional directories to include in the workspace (comma-separated or multiple flags) | +| `--screen-reader` | - | boolean | - | Enable screen reader mode for accessibility | +| `--output-format` | `-o` | string | `text` | The format of the CLI output. Choices: `text`, `json`, `stream-json` | ## Model selection diff --git a/docs/reference/configuration.md b/docs/reference/configuration.md index 49954da8c6..fbd35aebf0 100644 --- a/docs/reference/configuration.md +++ b/docs/reference/configuration.md @@ -1583,8 +1583,10 @@ for that specific session. with screen readers. - **`--version`**: - Displays the version of the CLI. -- **`--experimental-acp`**: +- **`--acp`**: - Starts the agent in ACP mode. +- **`--experimental-acp`**: + - **Deprecated.** Use `--acp` instead. - **`--allowed-mcp-server-names`**: - Allowed MCP server names. - **`--fake-responses`**: diff --git a/integration-tests/acp-env-auth.test.ts b/integration-tests/acp-env-auth.test.ts index c83dbafce5..65f8adbf22 100644 --- a/integration-tests/acp-env-auth.test.ts +++ b/integration-tests/acp-env-auth.test.ts @@ -55,7 +55,7 @@ describe.skip('ACP Environment and Auth', () => { const bundlePath = join(import.meta.dirname, '..', 'bundle/gemini.js'); - child = spawn('node', [bundlePath, '--experimental-acp'], { + child = spawn('node', [bundlePath, '--acp'], { cwd: rig.homeDir!, stdio: ['pipe', 'pipe', 'inherit'], env: { @@ -120,7 +120,7 @@ describe.skip('ACP Environment and Auth', () => { const bundlePath = join(import.meta.dirname, '..', 'bundle/gemini.js'); - child = spawn('node', [bundlePath, '--experimental-acp'], { + child = spawn('node', [bundlePath, '--acp'], { cwd: rig.homeDir!, stdio: ['pipe', 'pipe', 'inherit'], env: { diff --git a/integration-tests/acp-telemetry.test.ts b/integration-tests/acp-telemetry.test.ts index 393156df3e..f883b977bf 100644 --- a/integration-tests/acp-telemetry.test.ts +++ b/integration-tests/acp-telemetry.test.ts @@ -58,7 +58,7 @@ describe('ACP telemetry', () => { 'node', [ bundlePath, - '--experimental-acp', + '--acp', '--fake-responses', join(rig.testDir!, 'fake-responses.json'), ], diff --git a/packages/cli/src/config/config.ts b/packages/cli/src/config/config.ts index b478d67478..1fe55a38a0 100755 --- a/packages/cli/src/config/config.ts +++ b/packages/cli/src/config/config.ts @@ -81,6 +81,8 @@ export interface CliArgs { policy: string[] | undefined; allowedMcpServerNames: string[] | undefined; allowedTools: string[] | undefined; + acp: boolean | undefined; + /** @deprecated Use acp instead */ experimentalAcp: boolean | undefined; extensions: string[] | undefined; listExtensions: boolean | undefined; @@ -177,7 +179,8 @@ export async function parseArguments( .filter(Boolean), ), }) - .option('experimental-acp', { + .option('acp', { + alias: 'experimental-acp', type: 'boolean', description: 'Starts the agent in ACP mode', }) @@ -632,6 +635,7 @@ export async function loadCliConfig( // -i/--prompt-interactive forces interactive mode with an initial prompt const interactive = !!argv.promptInteractive || + !!argv.acp || !!argv.experimentalAcp || (!isHeadlessMode({ prompt: argv.prompt, query: argv.query }) && !argv.isCommand); @@ -821,7 +825,7 @@ export async function loadCliConfig( bugCommand: settings.advanced?.bugCommand, model: resolvedModel, maxSessionTurns: settings.model?.maxSessionTurns, - experimentalZedIntegration: argv.experimentalAcp || false, + acpMode: argv.acp || argv.experimentalAcp || false, listExtensions: argv.listExtensions || false, listSessions: argv.listSessions || false, deleteSession: argv.deleteSession, diff --git a/packages/cli/src/gemini.test.tsx b/packages/cli/src/gemini.test.tsx index 2784c5694a..c6625cadd3 100644 --- a/packages/cli/src/gemini.test.tsx +++ b/packages/cli/src/gemini.test.tsx @@ -483,6 +483,7 @@ describe('gemini.tsx main function kitty protocol', () => { policy: undefined, allowedMcpServerNames: undefined, allowedTools: undefined, + acp: undefined, experimentalAcp: undefined, extensions: undefined, listExtensions: undefined, diff --git a/packages/cli/src/gemini.tsx b/packages/cli/src/gemini.tsx index 88f9f404cd..0987069955 100644 --- a/packages/cli/src/gemini.tsx +++ b/packages/cli/src/gemini.tsx @@ -672,7 +672,7 @@ export async function main() { await getOauthClient(settings.merged.security.auth.selectedType, config); } - if (config.getExperimentalZedIntegration()) { + if (config.getAcpMode()) { return runZedIntegration(config, settings, argv); } diff --git a/packages/core/src/code_assist/oauth2.ts b/packages/core/src/code_assist/oauth2.ts index 31bc3c0e5e..82aebf4188 100644 --- a/packages/core/src/code_assist/oauth2.ts +++ b/packages/core/src/code_assist/oauth2.ts @@ -272,7 +272,7 @@ async function initOauthClient( await triggerPostAuthCallbacks(client.credentials); } else { // In Zed integration, we skip the interactive consent and directly open the browser - if (!config.getExperimentalZedIntegration()) { + if (!config.getAcpMode()) { const userConsent = await getConsentForOauth(''); if (!userConsent) { throw new FatalCancellationError('Authentication cancelled by user.'); diff --git a/packages/core/src/config/config.ts b/packages/core/src/config/config.ts index 258bd78f93..78a8e09bc6 100644 --- a/packages/core/src/config/config.ts +++ b/packages/core/src/config/config.ts @@ -503,7 +503,7 @@ export interface ConfigParameters { model: string; disableLoopDetection?: boolean; maxSessionTurns?: number; - experimentalZedIntegration?: boolean; + acpMode?: boolean; listSessions?: boolean; deleteSession?: string; listExtensions?: boolean; @@ -699,7 +699,7 @@ export class Config implements McpContext { private readonly summarizeToolOutput: | Record | undefined; - private readonly experimentalZedIntegration: boolean = false; + private readonly acpMode: boolean = false; private readonly loadMemoryFromIncludeDirectories: boolean = false; private readonly includeDirectoryTree: boolean = true; private readonly importFormat: 'tree' | 'flat'; @@ -894,8 +894,7 @@ export class Config implements McpContext { DEFAULT_PROTECT_LATEST_TURN, }; this.maxSessionTurns = params.maxSessionTurns ?? -1; - this.experimentalZedIntegration = - params.experimentalZedIntegration ?? false; + this.acpMode = params.acpMode ?? false; this.listSessions = params.listSessions ?? false; this.deleteSession = params.deleteSession; this.listExtensions = params.listExtensions ?? false; @@ -1148,7 +1147,7 @@ export class Config implements McpContext { } }); - if (!this.interactive || this.experimentalZedIntegration) { + if (!this.interactive || this.acpMode) { await this.mcpInitializationPromise; } @@ -2205,8 +2204,8 @@ export class Config implements McpContext { return this.usageStatisticsEnabled; } - getExperimentalZedIntegration(): boolean { - return this.experimentalZedIntegration; + getAcpMode(): boolean { + return this.acpMode; } async waitForMcpInit(): Promise {