Skip to content

Commit ecd95ed

Browse files
bbiggsmattKorwel
andauthored
Prompte telemetry, debug and proxy flags to global (google-gemini#8811)
Co-authored-by: matt korwel <matt.korwel@gmail.com>
1 parent 4e6ca95 commit ecd95ed

1 file changed

Lines changed: 70 additions & 70 deletions

File tree

packages/cli/src/config/config.ts

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,76 @@ export async function parseArguments(settings: Settings): Promise<CliArgs> {
9393
.usage(
9494
'Usage: gemini [options] [command]\n\nGemini CLI - Launch an interactive CLI, use -p/--prompt for non-interactive mode',
9595
)
96+
.option('telemetry', {
97+
type: 'boolean',
98+
description:
99+
'Enable telemetry? This flag specifically controls if telemetry is sent. Other --telemetry-* flags set specific values but do not enable telemetry on their own.',
100+
})
101+
.option('telemetry-target', {
102+
type: 'string',
103+
choices: ['local', 'gcp'],
104+
description:
105+
'Set the telemetry target (local or gcp). Overrides settings files.',
106+
})
107+
.option('telemetry-otlp-endpoint', {
108+
type: 'string',
109+
description:
110+
'Set the OTLP endpoint for telemetry. Overrides environment variables and settings files.',
111+
})
112+
.option('telemetry-otlp-protocol', {
113+
type: 'string',
114+
choices: ['grpc', 'http'],
115+
description:
116+
'Set the OTLP protocol for telemetry (grpc or http). Overrides settings files.',
117+
})
118+
.option('telemetry-log-prompts', {
119+
type: 'boolean',
120+
description:
121+
'Enable or disable logging of user prompts for telemetry. Overrides settings files.',
122+
})
123+
.option('telemetry-outfile', {
124+
type: 'string',
125+
description: 'Redirect all telemetry output to the specified file.',
126+
})
127+
.deprecateOption(
128+
'telemetry',
129+
'Use the "telemetry.enabled" setting in settings.json instead. This flag will be removed in a future version.',
130+
)
131+
.deprecateOption(
132+
'telemetry-target',
133+
'Use the "telemetry.target" setting in settings.json instead. This flag will be removed in a future version.',
134+
)
135+
.deprecateOption(
136+
'telemetry-otlp-endpoint',
137+
'Use the "telemetry.otlpEndpoint" setting in settings.json instead. This flag will be removed in a future version.',
138+
)
139+
.deprecateOption(
140+
'telemetry-otlp-protocol',
141+
'Use the "telemetry.otlpProtocol" setting in settings.json instead. This flag will be removed in a future version.',
142+
)
143+
.deprecateOption(
144+
'telemetry-log-prompts',
145+
'Use the "telemetry.logPrompts" setting in settings.json instead. This flag will be removed in a future version.',
146+
)
147+
.deprecateOption(
148+
'telemetry-outfile',
149+
'Use the "telemetry.outfile" setting in settings.json instead. This flag will be removed in a future version.',
150+
)
151+
.option('debug', {
152+
alias: 'd',
153+
type: 'boolean',
154+
description: 'Run in debug mode?',
155+
default: false,
156+
})
157+
.option('proxy', {
158+
type: 'string',
159+
description:
160+
'Proxy for gemini client, like schema://user:password@host:port',
161+
})
162+
.deprecateOption(
163+
'proxy',
164+
'Use the "proxy" setting in settings.json instead. This flag will be removed in a future version.',
165+
)
96166
.command('$0 [promptWords...]', 'Launch Gemini CLI', (yargsInstance) =>
97167
yargsInstance
98168
.option('model', {
@@ -120,12 +190,6 @@ export async function parseArguments(settings: Settings): Promise<CliArgs> {
120190
type: 'string',
121191
description: 'Sandbox image URI.',
122192
})
123-
.option('debug', {
124-
alias: 'd',
125-
type: 'boolean',
126-
description: 'Run in debug mode?',
127-
default: false,
128-
})
129193
.option('all-files', {
130194
alias: ['a'],
131195
type: 'boolean',
@@ -150,37 +214,6 @@ export async function parseArguments(settings: Settings): Promise<CliArgs> {
150214
description:
151215
'Set the approval mode: default (prompt for approval), auto_edit (auto-approve edit tools), yolo (auto-approve all tools)',
152216
})
153-
.option('telemetry', {
154-
type: 'boolean',
155-
description:
156-
'Enable telemetry? This flag specifically controls if telemetry is sent. Other --telemetry-* flags set specific values but do not enable telemetry on their own.',
157-
})
158-
.option('telemetry-target', {
159-
type: 'string',
160-
choices: ['local', 'gcp'],
161-
description:
162-
'Set the telemetry target (local or gcp). Overrides settings files.',
163-
})
164-
.option('telemetry-otlp-endpoint', {
165-
type: 'string',
166-
description:
167-
'Set the OTLP endpoint for telemetry. Overrides environment variables and settings files.',
168-
})
169-
.option('telemetry-otlp-protocol', {
170-
type: 'string',
171-
choices: ['grpc', 'http'],
172-
description:
173-
'Set the OTLP protocol for telemetry (grpc or http). Overrides settings files.',
174-
})
175-
.option('telemetry-log-prompts', {
176-
type: 'boolean',
177-
description:
178-
'Enable or disable logging of user prompts for telemetry. Overrides settings files.',
179-
})
180-
.option('telemetry-outfile', {
181-
type: 'string',
182-
description: 'Redirect all telemetry output to the specified file.',
183-
})
184217
.option('checkpointing', {
185218
alias: 'c',
186219
type: 'boolean',
@@ -213,11 +246,6 @@ export async function parseArguments(settings: Settings): Promise<CliArgs> {
213246
type: 'boolean',
214247
description: 'List all available extensions and exit.',
215248
})
216-
.option('proxy', {
217-
type: 'string',
218-
description:
219-
'Proxy for gemini client, like schema://user:password@host:port',
220-
})
221249
.option('include-directories', {
222250
type: 'array',
223251
string: true,
@@ -238,30 +266,6 @@ export async function parseArguments(settings: Settings): Promise<CliArgs> {
238266
description: 'The format of the CLI output.',
239267
choices: ['text', 'json'],
240268
})
241-
.deprecateOption(
242-
'telemetry',
243-
'Use the "telemetry.enabled" setting in settings.json instead. This flag will be removed in a future version.',
244-
)
245-
.deprecateOption(
246-
'telemetry-target',
247-
'Use the "telemetry.target" setting in settings.json instead. This flag will be removed in a future version.',
248-
)
249-
.deprecateOption(
250-
'telemetry-otlp-endpoint',
251-
'Use the "telemetry.otlpEndpoint" setting in settings.json instead. This flag will be removed in a future version.',
252-
)
253-
.deprecateOption(
254-
'telemetry-otlp-protocol',
255-
'Use the "telemetry.otlpProtocol" setting in settings.json instead. This flag will be removed in a future version.',
256-
)
257-
.deprecateOption(
258-
'telemetry-log-prompts',
259-
'Use the "telemetry.logPrompts" setting in settings.json instead. This flag will be removed in a future version.',
260-
)
261-
.deprecateOption(
262-
'telemetry-outfile',
263-
'Use the "telemetry.outfile" setting in settings.json instead. This flag will be removed in a future version.',
264-
)
265269
.deprecateOption(
266270
'show-memory-usage',
267271
'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> {
270274
'sandbox-image',
271275
'Use the "tools.sandbox" setting in settings.json instead. This flag will be removed in a future version.',
272276
)
273-
.deprecateOption(
274-
'proxy',
275-
'Use the "proxy" setting in settings.json instead. This flag will be removed in a future version.',
276-
)
277277
.deprecateOption(
278278
'checkpointing',
279279
'Use the "general.checkpointing.enabled" setting in settings.json instead. This flag will be removed in a future version.',

0 commit comments

Comments
 (0)