fix: add folderTrust+yolo settings to Gemini installers and README

- settings.json now includes security.folderTrust.enabled=false and
  general.defaultApprovalMode=yolo to suppress trust/permission prompts
- Linux installer creates trustedFolders.json with common paths
- Windows PS1 installer creates trustedFolders.json for C:\ paths
- README Windows section adds $env: vars for current session
- Fixed BOM issue: all PS1 use WriteAllText instead of Set-Content

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
delta-cloud-208e
2026-03-08 07:29:33 +00:00
parent f50c0dfced
commit 8717236f29
3 changed files with 39 additions and 6 deletions

View File

@@ -130,8 +130,12 @@ source ~/.bashrc
mkdir -p ~/.gemini
cat > ~/.gemini/settings.json << 'EOF'
{
"security": { "auth": { "selectedType": "gemini-api-key" } },
"telemetry": { "enabled": false, "logPrompts": false }
"security": {
"auth": { "selectedType": "gemini-api-key" },
"folderTrust": { "enabled": false }
},
"telemetry": { "enabled": false, "logPrompts": false },
"general": { "defaultApprovalMode": "yolo" }
}
EOF
```
@@ -140,8 +144,10 @@ Then configure (Windows — run in **PowerShell**, not CMD):
```powershell
[System.Environment]::SetEnvironmentVariable("GEMINI_API_KEY", "ClauderAPI", "User")
[System.Environment]::SetEnvironmentVariable("GOOGLE_GEMINI_BASE_URL", "https://ai.37-187-136-86.sslip.io", "User")
$env:GEMINI_API_KEY = "ClauderAPI"
$env:GOOGLE_GEMINI_BASE_URL = "https://ai.37-187-136-86.sslip.io"
$d = "$env:USERPROFILE\.gemini"; New-Item -ItemType Directory -Force -Path $d | Out-Null
[System.IO.File]::WriteAllText("$d\settings.json", '{"security":{"auth":{"selectedType":"gemini-api-key"}},"telemetry":{"enabled":false,"logPrompts":false}}')
[System.IO.File]::WriteAllText("$d\settings.json", '{"security":{"auth":{"selectedType":"gemini-api-key"},"folderTrust":{"enabled":false}},"telemetry":{"enabled":false,"logPrompts":false},"general":{"defaultApprovalMode":"yolo"}}')
```
Or use CMD:
@@ -149,7 +155,7 @@ Or use CMD:
setx GEMINI_API_KEY "ClauderAPI"
setx GOOGLE_GEMINI_BASE_URL "https://ai.37-187-136-86.sslip.io"
mkdir "%USERPROFILE%\.gemini" 2>nul
echo {"security":{"auth":{"selectedType":"gemini-api-key"}},"telemetry":{"enabled":false,"logPrompts":false}} > "%USERPROFILE%\.gemini\settings.json"
echo {"security":{"auth":{"selectedType":"gemini-api-key"},"folderTrust":{"enabled":false}},"telemetry":{"enabled":false,"logPrompts":false},"general":{"defaultApprovalMode":"yolo"}} > "%USERPROFILE%\.gemini\settings.json"
```
Verify: `gemini -p "Hello"`