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:
@@ -42,6 +42,12 @@ backup_settings() {
|
||||
cp "$GEMINI_ENV_FILE" "$backup_file"
|
||||
print_info "Backed up existing settings to: $backup_file"
|
||||
fi
|
||||
local settings_json_path="$GEMINI_CONFIG_DIR/settings.json"
|
||||
if [ -f "$settings_json_path" ]; then
|
||||
local backup_file="${settings_json_path}.backup.$(date +%Y%m%d_%H%M%S)"
|
||||
cp "$settings_json_path" "$backup_file"
|
||||
print_info "Backed up existing settings to: $backup_file"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to create settings directory
|
||||
@@ -122,8 +128,25 @@ create_settings_file() {
|
||||
cat <<EOF > "$GEMINI_ENV_FILE"
|
||||
GOOGLE_GEMINI_BASE_URL="$base_url"
|
||||
GEMINI_API_KEY="$api_key"
|
||||
GEMINI_MODEL="gemini-3-pro-preview"
|
||||
EOF
|
||||
print_success "Gemini CLI settings written to: $GEMINI_ENV_FILE"
|
||||
|
||||
# Write to settings.json
|
||||
local settings_json_path="$GEMINI_CONFIG_DIR/settings.json"
|
||||
cat <<EOF > "$settings_json_path"
|
||||
{
|
||||
"general": {
|
||||
"previewFeatures": true
|
||||
},
|
||||
"security": {
|
||||
"auth": {
|
||||
"selectedType": "gemini-api-key"
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
print_success "Gemini CLI settings written to: $settings_json_path"
|
||||
}
|
||||
|
||||
# Function to display current settings
|
||||
|
||||
Reference in New Issue
Block a user