# 🚀 Sync Gemini CLI v0.2.1 - Major Feature Update (#483)

This commit is contained in:
tanzhenxin
2025-09-01 14:48:55 +08:00
committed by GitHub
parent 1610c1586e
commit 2572faf726
292 changed files with 19401 additions and 5941 deletions

View File

@@ -130,6 +130,10 @@ export const addCommand: CommandModule = {
builder: (yargs) =>
yargs
.usage('Usage: gemini mcp add [options] <name> <commandOrUrl> [args...]')
.parserConfiguration({
'unknown-options-as-args': true, // Pass unknown options as server args
'populate--': true, // Populate server args after -- separator
})
.positional('name', {
describe: 'Name of the server',
type: 'string',
@@ -189,22 +193,29 @@ export const addCommand: CommandModule = {
describe: 'A comma-separated list of tools to exclude',
type: 'array',
string: true,
})
.middleware((argv) => {
// Handle -- separator args as server args if present
if (argv['--']) {
const existingArgs = (argv['args'] as Array<string | number>) || [];
argv['args'] = [...existingArgs, ...(argv['--'] as string[])];
}
}),
handler: async (argv) => {
await addMcpServer(
argv.name as string,
argv.commandOrUrl as string,
argv.args as Array<string | number>,
argv['name'] as string,
argv['commandOrUrl'] as string,
argv['args'] as Array<string | number>,
{
scope: argv.scope as string,
transport: argv.transport as string,
env: argv.env as string[],
header: argv.header as string[],
timeout: argv.timeout as number | undefined,
trust: argv.trust as boolean | undefined,
description: argv.description as string | undefined,
includeTools: argv.includeTools as string[] | undefined,
excludeTools: argv.excludeTools as string[] | undefined,
scope: argv['scope'] as string,
transport: argv['transport'] as string,
env: argv['env'] as string[],
header: argv['header'] as string[],
timeout: argv['timeout'] as number | undefined,
trust: argv['trust'] as boolean | undefined,
description: argv['description'] as string | undefined,
includeTools: argv['includeTools'] as string[] | undefined,
excludeTools: argv['excludeTools'] as string[] | undefined,
},
);
},