From ecd95ed6b30966831cb0471080a8d03ce0257a32 Mon Sep 17 00:00:00 2001 From: Billy Biggs Date: Thu, 18 Sep 2025 23:13:44 -0700 Subject: [PATCH] Prompte telemetry, debug and proxy flags to global (#8811) Co-authored-by: matt korwel --- packages/cli/src/config/config.ts | 140 +++++++++++++++--------------- 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/packages/cli/src/config/config.ts b/packages/cli/src/config/config.ts index f56aec679e..eaace7b074 100755 --- a/packages/cli/src/config/config.ts +++ b/packages/cli/src/config/config.ts @@ -93,6 +93,76 @@ export async function parseArguments(settings: Settings): Promise { .usage( 'Usage: gemini [options] [command]\n\nGemini CLI - Launch an interactive CLI, use -p/--prompt for non-interactive mode', ) + .option('telemetry', { + type: 'boolean', + description: + 'Enable telemetry? This flag specifically controls if telemetry is sent. Other --telemetry-* flags set specific values but do not enable telemetry on their own.', + }) + .option('telemetry-target', { + type: 'string', + choices: ['local', 'gcp'], + description: + 'Set the telemetry target (local or gcp). Overrides settings files.', + }) + .option('telemetry-otlp-endpoint', { + type: 'string', + description: + 'Set the OTLP endpoint for telemetry. Overrides environment variables and settings files.', + }) + .option('telemetry-otlp-protocol', { + type: 'string', + choices: ['grpc', 'http'], + description: + 'Set the OTLP protocol for telemetry (grpc or http). Overrides settings files.', + }) + .option('telemetry-log-prompts', { + type: 'boolean', + description: + 'Enable or disable logging of user prompts for telemetry. Overrides settings files.', + }) + .option('telemetry-outfile', { + type: 'string', + description: 'Redirect all telemetry output to the specified file.', + }) + .deprecateOption( + 'telemetry', + 'Use the "telemetry.enabled" setting in settings.json instead. This flag will be removed in a future version.', + ) + .deprecateOption( + 'telemetry-target', + 'Use the "telemetry.target" setting in settings.json instead. This flag will be removed in a future version.', + ) + .deprecateOption( + 'telemetry-otlp-endpoint', + 'Use the "telemetry.otlpEndpoint" setting in settings.json instead. This flag will be removed in a future version.', + ) + .deprecateOption( + 'telemetry-otlp-protocol', + 'Use the "telemetry.otlpProtocol" setting in settings.json instead. This flag will be removed in a future version.', + ) + .deprecateOption( + 'telemetry-log-prompts', + 'Use the "telemetry.logPrompts" setting in settings.json instead. This flag will be removed in a future version.', + ) + .deprecateOption( + 'telemetry-outfile', + 'Use the "telemetry.outfile" setting in settings.json instead. This flag will be removed in a future version.', + ) + .option('debug', { + alias: 'd', + type: 'boolean', + description: 'Run in debug mode?', + default: false, + }) + .option('proxy', { + type: 'string', + description: + 'Proxy for gemini client, like schema://user:password@host:port', + }) + .deprecateOption( + 'proxy', + 'Use the "proxy" setting in settings.json instead. This flag will be removed in a future version.', + ) .command('$0 [promptWords...]', 'Launch Gemini CLI', (yargsInstance) => yargsInstance .option('model', { @@ -120,12 +190,6 @@ export async function parseArguments(settings: Settings): Promise { type: 'string', description: 'Sandbox image URI.', }) - .option('debug', { - alias: 'd', - type: 'boolean', - description: 'Run in debug mode?', - default: false, - }) .option('all-files', { alias: ['a'], type: 'boolean', @@ -150,37 +214,6 @@ export async function parseArguments(settings: Settings): Promise { description: 'Set the approval mode: default (prompt for approval), auto_edit (auto-approve edit tools), yolo (auto-approve all tools)', }) - .option('telemetry', { - type: 'boolean', - description: - 'Enable telemetry? This flag specifically controls if telemetry is sent. Other --telemetry-* flags set specific values but do not enable telemetry on their own.', - }) - .option('telemetry-target', { - type: 'string', - choices: ['local', 'gcp'], - description: - 'Set the telemetry target (local or gcp). Overrides settings files.', - }) - .option('telemetry-otlp-endpoint', { - type: 'string', - description: - 'Set the OTLP endpoint for telemetry. Overrides environment variables and settings files.', - }) - .option('telemetry-otlp-protocol', { - type: 'string', - choices: ['grpc', 'http'], - description: - 'Set the OTLP protocol for telemetry (grpc or http). Overrides settings files.', - }) - .option('telemetry-log-prompts', { - type: 'boolean', - description: - 'Enable or disable logging of user prompts for telemetry. Overrides settings files.', - }) - .option('telemetry-outfile', { - type: 'string', - description: 'Redirect all telemetry output to the specified file.', - }) .option('checkpointing', { alias: 'c', type: 'boolean', @@ -213,11 +246,6 @@ export async function parseArguments(settings: Settings): Promise { type: 'boolean', description: 'List all available extensions and exit.', }) - .option('proxy', { - type: 'string', - description: - 'Proxy for gemini client, like schema://user:password@host:port', - }) .option('include-directories', { type: 'array', string: true, @@ -238,30 +266,6 @@ export async function parseArguments(settings: Settings): Promise { description: 'The format of the CLI output.', choices: ['text', 'json'], }) - .deprecateOption( - 'telemetry', - 'Use the "telemetry.enabled" setting in settings.json instead. This flag will be removed in a future version.', - ) - .deprecateOption( - 'telemetry-target', - 'Use the "telemetry.target" setting in settings.json instead. This flag will be removed in a future version.', - ) - .deprecateOption( - 'telemetry-otlp-endpoint', - 'Use the "telemetry.otlpEndpoint" setting in settings.json instead. This flag will be removed in a future version.', - ) - .deprecateOption( - 'telemetry-otlp-protocol', - 'Use the "telemetry.otlpProtocol" setting in settings.json instead. This flag will be removed in a future version.', - ) - .deprecateOption( - 'telemetry-log-prompts', - 'Use the "telemetry.logPrompts" setting in settings.json instead. This flag will be removed in a future version.', - ) - .deprecateOption( - 'telemetry-outfile', - 'Use the "telemetry.outfile" setting in settings.json instead. This flag will be removed in a future version.', - ) .deprecateOption( 'show-memory-usage', 'Use the "ui.showMemoryUsage" setting in settings.json instead. This flag will be removed in a future version.', @@ -270,10 +274,6 @@ export async function parseArguments(settings: Settings): Promise { 'sandbox-image', 'Use the "tools.sandbox" setting in settings.json instead. This flag will be removed in a future version.', ) - .deprecateOption( - 'proxy', - 'Use the "proxy" setting in settings.json instead. This flag will be removed in a future version.', - ) .deprecateOption( 'checkpointing', 'Use the "general.checkpointing.enabled" setting in settings.json instead. This flag will be removed in a future version.',