mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-13 05:12:55 -07:00
Prompte telemetry, debug and proxy flags to global (#8811)
Co-authored-by: matt korwel <matt.korwel@gmail.com>
This commit is contained in:
@@ -93,6 +93,76 @@ export async function parseArguments(settings: Settings): Promise<CliArgs> {
|
|||||||
.usage(
|
.usage(
|
||||||
'Usage: gemini [options] [command]\n\nGemini CLI - Launch an interactive CLI, use -p/--prompt for non-interactive mode',
|
'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) =>
|
.command('$0 [promptWords...]', 'Launch Gemini CLI', (yargsInstance) =>
|
||||||
yargsInstance
|
yargsInstance
|
||||||
.option('model', {
|
.option('model', {
|
||||||
@@ -120,12 +190,6 @@ export async function parseArguments(settings: Settings): Promise<CliArgs> {
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
description: 'Sandbox image URI.',
|
description: 'Sandbox image URI.',
|
||||||
})
|
})
|
||||||
.option('debug', {
|
|
||||||
alias: 'd',
|
|
||||||
type: 'boolean',
|
|
||||||
description: 'Run in debug mode?',
|
|
||||||
default: false,
|
|
||||||
})
|
|
||||||
.option('all-files', {
|
.option('all-files', {
|
||||||
alias: ['a'],
|
alias: ['a'],
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
@@ -150,37 +214,6 @@ export async function parseArguments(settings: Settings): Promise<CliArgs> {
|
|||||||
description:
|
description:
|
||||||
'Set the approval mode: default (prompt for approval), auto_edit (auto-approve edit tools), yolo (auto-approve all tools)',
|
'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', {
|
.option('checkpointing', {
|
||||||
alias: 'c',
|
alias: 'c',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
@@ -213,11 +246,6 @@ export async function parseArguments(settings: Settings): Promise<CliArgs> {
|
|||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
description: 'List all available extensions and exit.',
|
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', {
|
.option('include-directories', {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
string: true,
|
string: true,
|
||||||
@@ -238,30 +266,6 @@ export async function parseArguments(settings: Settings): Promise<CliArgs> {
|
|||||||
description: 'The format of the CLI output.',
|
description: 'The format of the CLI output.',
|
||||||
choices: ['text', 'json'],
|
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(
|
.deprecateOption(
|
||||||
'show-memory-usage',
|
'show-memory-usage',
|
||||||
'Use the "ui.showMemoryUsage" setting in settings.json instead. This flag will be removed in a future version.',
|
'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<CliArgs> {
|
|||||||
'sandbox-image',
|
'sandbox-image',
|
||||||
'Use the "tools.sandbox" setting in settings.json instead. This flag will be removed in a future version.',
|
'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(
|
.deprecateOption(
|
||||||
'checkpointing',
|
'checkpointing',
|
||||||
'Use the "general.checkpointing.enabled" setting in settings.json instead. This flag will be removed in a future version.',
|
'Use the "general.checkpointing.enabled" setting in settings.json instead. This flag will be removed in a future version.',
|
||||||
|
|||||||
Reference in New Issue
Block a user