# 🚀 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

@@ -24,6 +24,7 @@ import {
import { themeManager } from './ui/themes/theme-manager.js';
import { getStartupWarnings } from './utils/startupWarnings.js';
import { getUserStartupWarnings } from './utils/userStartupWarnings.js';
import { ConsolePatcher } from './ui/utils/ConsolePatcher.js';
import { runNonInteractive } from './nonInteractiveCli.js';
import { loadExtensions } from './config/extension.js';
import { cleanupCheckpoints, registerCleanup } from './utils/cleanup.js';
@@ -79,7 +80,7 @@ function getNodeMemoryArgs(config: Config): string[] {
);
}
if (process.env.GEMINI_CLI_NO_RELAUNCH) {
if (process.env['GEMINI_CLI_NO_RELAUNCH']) {
return [];
}
@@ -140,7 +141,7 @@ export async function main() {
if (settings.errors.length > 0) {
for (const error of settings.errors) {
let errorMessage = `Error in ${error.path}: ${error.message}`;
if (!process.env.NO_COLOR) {
if (!process.env['NO_COLOR']) {
errorMessage = `\x1b[31m${errorMessage}\x1b[0m`;
}
console.error(errorMessage);
@@ -158,6 +159,13 @@ export async function main() {
argv,
);
const consolePatcher = new ConsolePatcher({
stderr: true,
debugMode: config.getDebugMode(),
});
consolePatcher.patch();
registerCleanup(consolePatcher.cleanup);
dns.setDefaultResultOrder(
validateDnsResolutionOrder(settings.merged.dnsResolutionOrder),
);
@@ -179,7 +187,7 @@ export async function main() {
// Set a default auth type if one isn't set.
if (!settings.merged.selectedAuthType) {
if (process.env.CLOUD_SHELL === 'true') {
if (process.env['CLOUD_SHELL'] === 'true') {
settings.setValue(
SettingScope.User,
'selectedAuthType',
@@ -209,7 +217,7 @@ export async function main() {
}
// hop into sandbox if we are outside and sandboxing is enabled
if (!process.env.SANDBOX) {
if (!process.env['SANDBOX']) {
const memoryArgs = settings.merged.autoConfigureMaxOldSpaceSize
? getNodeMemoryArgs(config)
: [];
@@ -297,8 +305,11 @@ export async function main() {
}
// If not a TTY, read from stdin
// This is for cases where the user pipes input directly into the command
if (!process.stdin.isTTY && !input) {
input += await readStdin();
if (!process.stdin.isTTY) {
const stdinData = await readStdin();
if (stdinData) {
input = `${stdinData}\n\n${input}`;
}
}
if (!input) {
console.error('No input provided via stdin.');
@@ -327,7 +338,7 @@ export async function main() {
function setWindowTitle(title: string, settings: LoadedSettings) {
if (!settings.merged.hideWindowTitle) {
const windowTitle = (process.env.CLI_TITLE || `Qwen - ${title}`).replace(
const windowTitle = (process.env['CLI_TITLE'] || `Qwen - ${title}`).replace(
// eslint-disable-next-line no-control-regex
/[\x00-\x1F\x7F]/g,
'',