feat(cli): add explicit proxy option in cli (#2526)

Co-authored-by: Dcatfly <dcatfly@gmail.com>
This commit is contained in:
warjiang 2025-07-18 02:57:37 +08:00 committed by GitHub
parent 4ca471bac6
commit 606a7702de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 126 additions and 12 deletions

View file

@ -57,6 +57,7 @@ export interface CliArgs {
extensions: string[] | undefined;
listExtensions: boolean | undefined;
ideMode: boolean | undefined;
proxy: string | undefined;
}
export async function parseArguments(): Promise<CliArgs> {
@ -182,7 +183,11 @@ export async function parseArguments(): Promise<CliArgs> {
type: 'boolean',
description: 'Run in IDE mode?',
})
.option('proxy', {
type: 'string',
description:
'Proxy for gemini client, like schema://user:password@host:port',
})
.version(await getCliVersion()) // This will enable the --version flag based on package.json
.alias('v', 'version')
.help()
@ -380,6 +385,7 @@ export async function loadCliConfig(
},
checkpointing: argv.checkpointing || settings.checkpointing?.enabled,
proxy:
argv.proxy ||
process.env.HTTPS_PROXY ||
process.env.https_proxy ||
process.env.HTTP_PROXY ||