feat: 增强三个 CLI 工具配置脚本
- Gemini CLI: 添加 GEMINI_MODEL 环境变量、settings.json 输出及备份逻辑 - Codex: 修复模型名称一致性 (gpt-5-codex)、添加 auth.json 备份逻辑 - Claude Code: 添加 VSCode 插件 config.json 配置支持 - CLAUDE.md: 重构文档,添加三个工具配置差异表 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -86,6 +86,13 @@ function Backup-Settings {
|
||||
Copy-Item -Path $GeminiEnvFile -Destination $backupFile
|
||||
Write-Info "Backed up existing settings to: $backupFile"
|
||||
}
|
||||
$settingsJsonPath = "$GeminiConfigDir\settings.json"
|
||||
if (Test-Path $settingsJsonPath) {
|
||||
$timestamp = Get-Date -Format "yyyyMMdd_HHmmss"
|
||||
$backupFile = "$settingsJsonPath.backup.$timestamp"
|
||||
Copy-Item -Path $settingsJsonPath -Destination $backupFile
|
||||
Write-Info "Backed up existing settings to: $backupFile"
|
||||
}
|
||||
}
|
||||
|
||||
# Function to create settings directory
|
||||
@@ -165,11 +172,27 @@ function New-Settings {
|
||||
$envContent = @"
|
||||
GOOGLE_GEMINI_BASE_URL="$BaseUrl"
|
||||
GEMINI_API_KEY="$ApiKey"
|
||||
GEMINI_MODEL="gemini-3-pro-preview"
|
||||
"@
|
||||
|
||||
|
||||
$settingsJson = @{
|
||||
general = @{
|
||||
previewFeatures = $true
|
||||
}
|
||||
security = @{
|
||||
auth = @{
|
||||
selectedType = "gemini-api-key"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
Set-Content -Path $GeminiEnvFile -Value $envContent -Encoding UTF8
|
||||
Write-Success "Gemini CLI settings written to: $GeminiEnvFile"
|
||||
|
||||
$settingsJsonPath = "$GeminiConfigDir\settings.json"
|
||||
$settingsJson | ConvertTo-Json -Depth 10 | Set-Content -Path $settingsJsonPath -Encoding UTF8
|
||||
Write-Success "Gemini CLI settings written to: $settingsJsonPath"
|
||||
return $true
|
||||
}
|
||||
catch {
|
||||
|
||||
Reference in New Issue
Block a user