docs: cross-platform install/update/uninstall instructions for codex/gemini/qwen
- Add Linux / macOS / Windows PowerShell / Windows CMD sections to all CLI READMEs - Update product table versions (claude v2.1.112, codex v0.116.0, qwen v0.14.5) - Make qwen install/update/uninstall scripts macOS-aware (sedi wrapper, launchctl, /Users scan, ~/.zshrc) - Make gemini uninstall script macOS-aware (matching install/update) - Fix CRLF line endings in qwen/gemini uninstall scripts Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
258
gemini/README.md
258
gemini/README.md
@@ -5,9 +5,54 @@ Patched Gemini CLI for use with custom API endpoints.
|
||||
Latest: **v0.35.3** (13 patches).
|
||||
<!-- VERSION_BADGE:END -->
|
||||
|
||||
## npm Install (Recommended)
|
||||
> Node.js v20+ required. One-liner installer подтянет Node.js если его нет.
|
||||
|
||||
**Step 1 — Install patched CLI:**
|
||||
## Install
|
||||
|
||||
### One-liner — все платформы
|
||||
|
||||
**Linux (Debian/Ubuntu/RHEL/Fedora):**
|
||||
```bash
|
||||
curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \
|
||||
https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/gemini/ugemini_install.sh \
|
||||
-o /tmp/ugemini_install.sh && sudo bash /tmp/ugemini_install.sh
|
||||
```
|
||||
|
||||
**macOS (Intel & Apple Silicon):**
|
||||
```bash
|
||||
curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \
|
||||
https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/gemini/ugemini_install.sh \
|
||||
-o /tmp/ugemini_install.sh && sudo bash /tmp/ugemini_install.sh
|
||||
```
|
||||
|
||||
> macOS: env vars (`GEMINI_API_KEY`, `GOOGLE_GEMINI_BASE_URL`) добавляются в `~/.zshrc`.
|
||||
> Если sudo попросит — введите пароль.
|
||||
|
||||
**Windows (PowerShell as Administrator):**
|
||||
```powershell
|
||||
$h=@{Authorization="token cadffcb0a6a3be728ac1ff619bb40c86588f6837"}
|
||||
Set-ExecutionPolicy Bypass -Scope Process -Force
|
||||
iwr "https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/gemini/ugemini_install.ps1" -OutFile "$env:TEMP\ugemini_install.ps1" -Headers $h
|
||||
. "$env:TEMP\ugemini_install.ps1"
|
||||
```
|
||||
|
||||
**Windows (CMD as Administrator):**
|
||||
```cmd
|
||||
powershell -NoProfile -ExecutionPolicy Bypass -Command "$h=@{Authorization='token cadffcb0a6a3be728ac1ff619bb40c86588f6837'}; iwr 'https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/gemini/ugemini_install.ps1' -OutFile \"$env:TEMP\ugemini_install.ps1\" -Headers $h; & \"$env:TEMP\ugemini_install.ps1\""
|
||||
```
|
||||
|
||||
> Windows: после установки **перезапустите CMD/PowerShell** для подхвата env vars и PATH.
|
||||
|
||||
Установщик выполнит:
|
||||
1. Проверит prerequisites (Node.js >= 20, Python3)
|
||||
2. Установит `@google/gemini-cli` если нет
|
||||
3. Скачает и применит 13 патчей
|
||||
4. Настроит auth и env vars
|
||||
5. Проверит тестовым промптом
|
||||
|
||||
### Two-command npm install (manual)
|
||||
|
||||
Если установщик не подходит — можно вручную через npm registry:
|
||||
|
||||
**Linux / macOS:**
|
||||
```bash
|
||||
@@ -21,113 +66,132 @@ npm config set "@google:registry" "https://npm.sensey24.ru/"
|
||||
npm install -g @google/gemini-cli
|
||||
```
|
||||
|
||||
> Node.js required. Install from https://nodejs.org/ if not present.
|
||||
**Windows (CMD):**
|
||||
```cmd
|
||||
npm config set "@google:registry" "https://npm.sensey24.ru/"
|
||||
npm install -g @google/gemini-cli
|
||||
```
|
||||
|
||||
**Step 2 — Configure settings and environment:**
|
||||
После npm-установки нужно вручную настроить auth и env vars (см. ниже).
|
||||
|
||||
The npm package includes all 13 patches baked in (proxy URLs, model defaults, UI, compression).
|
||||
You still need to configure auth and env vars:
|
||||
### Manual configure (если устанавливали через npm)
|
||||
|
||||
npm-пакет содержит все 13 патчей (proxy URLs, model defaults, UI, compression).
|
||||
Нужно лишь настроить auth и env vars.
|
||||
|
||||
**Linux / macOS:**
|
||||
```bash
|
||||
# Set environment variables
|
||||
echo 'export GEMINI_API_KEY="ClauderAPI2"' >> ~/.bashrc
|
||||
echo 'export GOOGLE_GEMINI_BASE_URL="https://ai.37-187-136-86.sslip.io"' >> ~/.bashrc
|
||||
source ~/.bashrc
|
||||
|
||||
# Configure auth (switch from OAuth to API key)
|
||||
mkdir -p ~/.gemini
|
||||
cat > ~/.gemini/settings.json << 'EOF'
|
||||
{
|
||||
"security": {
|
||||
"auth": {
|
||||
"selectedType": "gemini-api-key"
|
||||
}
|
||||
"auth": { "selectedType": "gemini-api-key" },
|
||||
"folderTrust": { "enabled": false }
|
||||
},
|
||||
"telemetry": {
|
||||
"enabled": false,
|
||||
"logPrompts": false
|
||||
}
|
||||
"telemetry": { "enabled": false, "logPrompts": false },
|
||||
"general": { "defaultApprovalMode": "yolo" }
|
||||
}
|
||||
EOF
|
||||
```
|
||||
|
||||
**Windows (PowerShell):**
|
||||
```powershell
|
||||
# Set environment variables
|
||||
[System.Environment]::SetEnvironmentVariable("GEMINI_API_KEY", "ClauderAPI2", "User")
|
||||
[System.Environment]::SetEnvironmentVariable("GOOGLE_GEMINI_BASE_URL", "https://ai.37-187-136-86.sslip.io", "User")
|
||||
|
||||
# Configure auth
|
||||
$geminiDir = "$env:USERPROFILE\.gemini"
|
||||
New-Item -ItemType Directory -Force -Path $geminiDir | Out-Null
|
||||
@'
|
||||
{
|
||||
"security": {
|
||||
"auth": {
|
||||
"selectedType": "gemini-api-key"
|
||||
}
|
||||
},
|
||||
"telemetry": {
|
||||
"enabled": false,
|
||||
"logPrompts": false
|
||||
}
|
||||
}
|
||||
'@ | Set-Content "$geminiDir\settings.json" -Encoding UTF8
|
||||
**macOS (zsh — default):**
|
||||
```bash
|
||||
echo 'export GEMINI_API_KEY="ClauderAPI2"' >> ~/.zshrc
|
||||
echo 'export GOOGLE_GEMINI_BASE_URL="https://ai.37-187-136-86.sslip.io"' >> ~/.zshrc
|
||||
source ~/.zshrc
|
||||
```
|
||||
|
||||
**Step 3 — Verify:**
|
||||
**Windows (PowerShell):**
|
||||
```powershell
|
||||
[System.Environment]::SetEnvironmentVariable("GEMINI_API_KEY", "ClauderAPI2", "User")
|
||||
[System.Environment]::SetEnvironmentVariable("GOOGLE_GEMINI_BASE_URL", "https://ai.37-187-136-86.sslip.io", "User")
|
||||
$env:GEMINI_API_KEY = "ClauderAPI2"
|
||||
$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"},"folderTrust":{"enabled":false}},"telemetry":{"enabled":false,"logPrompts":false},"general":{"defaultApprovalMode":"yolo"}}')
|
||||
```
|
||||
|
||||
**Windows (CMD):**
|
||||
```cmd
|
||||
setx GEMINI_API_KEY "ClauderAPI2"
|
||||
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"},"folderTrust":{"enabled":false}},"telemetry":{"enabled":false,"logPrompts":false},"general":{"defaultApprovalMode":"yolo"}} > "%USERPROFILE%\.gemini\settings.json"
|
||||
```
|
||||
|
||||
### Verify
|
||||
|
||||
```bash
|
||||
gemini -p "Hello"
|
||||
```
|
||||
|
||||
### What's included in the npm package vs what needs manual setup
|
||||
## Update
|
||||
|
||||
### One-liner
|
||||
|
||||
**Linux / macOS:**
|
||||
```bash
|
||||
curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \
|
||||
https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/gemini/ugemini_update.sh \
|
||||
-o /tmp/ugemini_update.sh && sudo bash /tmp/ugemini_update.sh
|
||||
```
|
||||
|
||||
**Windows (PowerShell as Administrator):**
|
||||
```powershell
|
||||
$h=@{Authorization="token cadffcb0a6a3be728ac1ff619bb40c86588f6837"}
|
||||
Set-ExecutionPolicy Bypass -Scope Process -Force
|
||||
iwr "https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/gemini/ugemini_update.ps1" -OutFile "$env:TEMP\ugemini_update.ps1" -Headers $h
|
||||
. "$env:TEMP\ugemini_update.ps1"
|
||||
```
|
||||
|
||||
**Windows (CMD as Administrator):**
|
||||
```cmd
|
||||
powershell -NoProfile -ExecutionPolicy Bypass -Command "$h=@{Authorization='token cadffcb0a6a3be728ac1ff619bb40c86588f6837'}; iwr 'https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/gemini/ugemini_update.ps1' -OutFile \"$env:TEMP\ugemini_update.ps1\" -Headers $h; & \"$env:TEMP\ugemini_update.ps1\""
|
||||
```
|
||||
|
||||
### Manual update via npm
|
||||
|
||||
```bash
|
||||
npm install -g @google/gemini-cli
|
||||
```
|
||||
|
||||
Settings и env vars сохраняются между обновлениями.
|
||||
|
||||
## Uninstall
|
||||
|
||||
**Linux / macOS:**
|
||||
```bash
|
||||
curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \
|
||||
https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/gemini/ugemini_uninstall.sh \
|
||||
-o /tmp/ugemini_uninstall.sh && sudo bash /tmp/ugemini_uninstall.sh
|
||||
```
|
||||
|
||||
**Windows (PowerShell as Administrator):**
|
||||
```powershell
|
||||
$h=@{Authorization="token cadffcb0a6a3be728ac1ff619bb40c86588f6837"}
|
||||
Set-ExecutionPolicy Bypass -Scope Process -Force
|
||||
iwr "https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/gemini/ugemini_uninstall.ps1" -OutFile "$env:TEMP\ugemini_uninstall.ps1" -Headers $h
|
||||
. "$env:TEMP\ugemini_uninstall.ps1"
|
||||
```
|
||||
|
||||
Удаляются: npm-пакет, `~/.gemini/`, env vars, npm registry config.
|
||||
|
||||
## What's included in the npm package vs what needs manual setup
|
||||
|
||||
| Patch | What | Included in npm? |
|
||||
|-------|------|:-:|
|
||||
| 1-3 | Proxy URLs (API + Vertex) | Yes |
|
||||
| 4-5 | Sandbox fixes (env vars + whitelist) | Yes |
|
||||
| 6 | Auth settings (~/.gemini/settings.json) | **No — Step 2** |
|
||||
| 6 | Auth settings (~/.gemini/settings.json) | **No — manual** |
|
||||
| 7-8 | Auto-update registry + commands | Yes |
|
||||
| 9 | Auto-permissions (YOLO mode) | Yes |
|
||||
| 10 | Default model constants (3.x) | Yes |
|
||||
| 11-13 | UI descriptions + compression aliases | Yes |
|
||||
|
||||
### Update
|
||||
|
||||
Same install commands — npm will pull the latest patched version from our registry.
|
||||
Settings and env vars persist across updates.
|
||||
|
||||
## One-Line Install (Alternative)
|
||||
|
||||
```bash
|
||||
curl -fsSL https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/gemini/ugemini_install.sh | sudo bash
|
||||
```
|
||||
|
||||
This will:
|
||||
1. Check prerequisites (Node.js >= 20, Python3)
|
||||
2. Install `@google/gemini-cli` if not present
|
||||
3. Download and apply 13 patches
|
||||
4. Configure auth and env vars
|
||||
5. Verify with a test prompt
|
||||
|
||||
## Manual Install
|
||||
|
||||
```bash
|
||||
# 1. Install Gemini CLI
|
||||
npm install -g @google/gemini-cli
|
||||
|
||||
# 2. Download patcher
|
||||
curl -fsSL https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/gemini/gemini_patcher.py -o /tmp/gemini_patcher.py
|
||||
curl -fsSL https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/gemini/gemini_config.json -o /tmp/gemini_config.json
|
||||
|
||||
# 3. Apply patches
|
||||
sudo python3 /tmp/gemini_patcher.py --apply --config /tmp/gemini_config.json
|
||||
|
||||
# 4. Test
|
||||
gemini -p "Hello"
|
||||
```
|
||||
|
||||
## What Gets Patched
|
||||
|
||||
| # | Target | What |
|
||||
@@ -158,19 +222,51 @@ gemini -p "Hello"
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
**"GEMINI_API_KEY not set"**
|
||||
### "GEMINI_API_KEY not set"
|
||||
|
||||
**Linux / macOS:**
|
||||
```bash
|
||||
export GEMINI_API_KEY="ClauderAPI2"
|
||||
export GOOGLE_GEMINI_BASE_URL="https://ai.37-187-136-86.sslip.io"
|
||||
```
|
||||
|
||||
**"IneligibleTierError"**
|
||||
Settings still using OAuth. Re-run patcher:
|
||||
**Windows (PowerShell):**
|
||||
```powershell
|
||||
[System.Environment]::SetEnvironmentVariable("GEMINI_API_KEY", "ClauderAPI2", "User")
|
||||
[System.Environment]::SetEnvironmentVariable("GOOGLE_GEMINI_BASE_URL", "https://ai.37-187-136-86.sslip.io", "User")
|
||||
# Перезапустите PowerShell
|
||||
```
|
||||
|
||||
**Windows (CMD):**
|
||||
```cmd
|
||||
setx GEMINI_API_KEY "ClauderAPI2"
|
||||
setx GOOGLE_GEMINI_BASE_URL "https://ai.37-187-136-86.sslip.io"
|
||||
```
|
||||
|
||||
### "IneligibleTierError"
|
||||
|
||||
Settings ещё используют OAuth. Перезапустите патчер:
|
||||
```bash
|
||||
python3 gemini_patcher.py --settings-only
|
||||
```
|
||||
|
||||
**Rollback**
|
||||
### Windows: "gemini is not recognized"
|
||||
|
||||
Перезапустите CMD/PowerShell. Либо вручную обновите PATH в текущей сессии:
|
||||
```powershell
|
||||
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
|
||||
```
|
||||
|
||||
### Deprecated settings spam
|
||||
|
||||
Если видите повторяющиеся warnings:
|
||||
```
|
||||
The system configuration contains deprecated settings: [experimental.codebaseInvestigatorSettings]
|
||||
```
|
||||
ключ есть в **system-level** конфигах. Удалите его — см. секцию Troubleshooting в [главном README](../README.md#gemini-cli-deprecated-settings-spam).
|
||||
|
||||
### Rollback
|
||||
|
||||
```bash
|
||||
sudo python3 gemini_patcher.py --rollback
|
||||
```
|
||||
@@ -181,5 +277,7 @@ sudo python3 gemini_patcher.py --rollback
|
||||
|------|---------|
|
||||
| `gemini_patcher.py` | Main patcher — detects Gemini CLI, applies 13 patches |
|
||||
| `gemini_config.json` | Config — proxy URL, API key, models |
|
||||
| `ugemini_install.sh` | One-line installer |
|
||||
| `ugemini_install.sh` / `.ps1` | One-liner installer (Linux/macOS / Windows) |
|
||||
| `ugemini_update.sh` / `.ps1` | Update script (Linux/macOS / Windows) |
|
||||
| `ugemini_uninstall.sh` / `.ps1` | Uninstaller (Linux/macOS / Windows) |
|
||||
| `releases/index.json` | Version index |
|
||||
|
||||
@@ -1,85 +1,114 @@
|
||||
#!/usr/bin/env bash
|
||||
# Gemini CLI — Uninstaller
|
||||
# Removes Gemini CLI, settings, env vars, and npm registry config.
|
||||
#
|
||||
# Usage: sudo bash ugemini_uninstall.sh
|
||||
set -euo pipefail
|
||||
|
||||
GREEN="\033[92m"
|
||||
RED="\033[91m"
|
||||
CYAN="\033[96m"
|
||||
YELLOW="\033[93m"
|
||||
BOLD="\033[1m"
|
||||
RESET="\033[0m"
|
||||
|
||||
log() { echo -e "${GREEN}[+]${RESET} $*"; }
|
||||
warn() { echo -e "${YELLOW}[~]${RESET} $*"; }
|
||||
info() { echo -e "${CYAN}[i]${RESET} $*"; }
|
||||
|
||||
echo -e "${BOLD}"
|
||||
echo " +--------------------------------------+"
|
||||
echo " | Gemini CLI — Uninstaller |"
|
||||
echo " +--------------------------------------+"
|
||||
echo -e "${RESET}"
|
||||
|
||||
# ---- Uninstall npm package ----
|
||||
|
||||
if command -v gemini &>/dev/null || npm list -g @google/gemini-cli &>/dev/null 2>&1; then
|
||||
info "Removing @google/gemini-cli..."
|
||||
npm uninstall -g @google/gemini-cli 2>/dev/null || true
|
||||
log "npm package removed"
|
||||
else
|
||||
warn "Gemini CLI not found in npm global packages"
|
||||
fi
|
||||
|
||||
# ---- Remove settings ----
|
||||
|
||||
for user_home in /root /home/*; do
|
||||
GEMINI_DIR="$user_home/.gemini"
|
||||
if [ -d "$GEMINI_DIR" ]; then
|
||||
info "Removing $GEMINI_DIR..."
|
||||
rm -rf "$GEMINI_DIR"
|
||||
log "Removed $GEMINI_DIR"
|
||||
fi
|
||||
done
|
||||
|
||||
# ---- Remove env vars from shell rc files ----
|
||||
|
||||
for user_home in /root /home/*; do
|
||||
for rc_file in "$user_home/.bashrc" "$user_home/.zshrc"; do
|
||||
if [ -f "$rc_file" ] && grep -q 'GEMINI_API_KEY\|GOOGLE_GEMINI_BASE_URL\|Gemini CLI' "$rc_file" 2>/dev/null; then
|
||||
info "Cleaning env vars from $rc_file..."
|
||||
sed -i '/# Gemini CLI/d' "$rc_file"
|
||||
sed -i '/GEMINI_API_KEY/d' "$rc_file"
|
||||
sed -i '/GOOGLE_GEMINI_BASE_URL/d' "$rc_file"
|
||||
log "Cleaned $rc_file"
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
# ---- Remove /etc/profile.d script ----
|
||||
|
||||
if [ -f "/etc/profile.d/gemini-cli.sh" ]; then
|
||||
info "Removing /etc/profile.d/gemini-cli.sh..."
|
||||
rm -f "/etc/profile.d/gemini-cli.sh"
|
||||
log "Removed /etc/profile.d/gemini-cli.sh"
|
||||
fi
|
||||
|
||||
# ---- Remove env vars from /etc/environment ----
|
||||
|
||||
if [ -f "/etc/environment" ] && grep -q 'GEMINI_API_KEY\|GOOGLE_GEMINI_BASE_URL' /etc/environment 2>/dev/null; then
|
||||
info "Cleaning /etc/environment..."
|
||||
sed -i '/GEMINI_API_KEY/d' /etc/environment
|
||||
sed -i '/GOOGLE_GEMINI_BASE_URL/d' /etc/environment
|
||||
log "Cleaned /etc/environment"
|
||||
fi
|
||||
|
||||
# ---- Remove npm registry config ----
|
||||
|
||||
info "Removing npm registry config..."
|
||||
npm config delete @google:registry 2>/dev/null || true
|
||||
log "npm registry config removed"
|
||||
|
||||
echo ""
|
||||
echo -e "${GREEN}${BOLD} Gemini CLI fully uninstalled!${RESET}"
|
||||
echo ""
|
||||
#!/usr/bin/env bash
|
||||
# Gemini CLI — Uninstaller
|
||||
# Removes Gemini CLI, settings, env vars, and npm registry config.
|
||||
#
|
||||
# Usage: sudo bash ugemini_uninstall.sh
|
||||
set -euo pipefail
|
||||
|
||||
GREEN="\033[92m"
|
||||
RED="\033[91m"
|
||||
CYAN="\033[96m"
|
||||
YELLOW="\033[93m"
|
||||
BOLD="\033[1m"
|
||||
RESET="\033[0m"
|
||||
|
||||
log() { echo -e "${GREEN}[+]${RESET} $*"; }
|
||||
warn() { echo -e "${YELLOW}[~]${RESET} $*"; }
|
||||
info() { echo -e "${CYAN}[i]${RESET} $*"; }
|
||||
|
||||
OS="$(uname -s)"
|
||||
IS_MACOS=false
|
||||
[ "$OS" = "Darwin" ] && IS_MACOS=true
|
||||
|
||||
sedi() {
|
||||
if $IS_MACOS; then
|
||||
sed -i '' "$@"
|
||||
else
|
||||
sed -i "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
if $IS_MACOS; then
|
||||
SCAN_DIRS="/Users"
|
||||
else
|
||||
SCAN_DIRS="/home"
|
||||
fi
|
||||
|
||||
echo -e "${BOLD}"
|
||||
echo " +--------------------------------------+"
|
||||
echo " | Gemini CLI — Uninstaller |"
|
||||
echo " +--------------------------------------+"
|
||||
echo -e "${RESET}"
|
||||
|
||||
# ---- Uninstall npm package ----
|
||||
|
||||
if command -v gemini &>/dev/null || npm list -g @google/gemini-cli &>/dev/null 2>&1; then
|
||||
info "Removing @google/gemini-cli..."
|
||||
npm uninstall -g @google/gemini-cli 2>/dev/null || true
|
||||
log "npm package removed"
|
||||
else
|
||||
warn "Gemini CLI not found in npm global packages"
|
||||
fi
|
||||
|
||||
# ---- Remove settings ----
|
||||
|
||||
for user_home in /root $SCAN_DIRS/*; do
|
||||
GEMINI_DIR="$user_home/.gemini"
|
||||
if [ -d "$GEMINI_DIR" ]; then
|
||||
info "Removing $GEMINI_DIR..."
|
||||
rm -rf "$GEMINI_DIR"
|
||||
log "Removed $GEMINI_DIR"
|
||||
fi
|
||||
done
|
||||
|
||||
# ---- Remove env vars from shell rc files ----
|
||||
|
||||
for user_home in /root $SCAN_DIRS/*; do
|
||||
for rc_file in "$user_home/.bashrc" "$user_home/.zshrc"; do
|
||||
if [ -f "$rc_file" ] && grep -q 'GEMINI_API_KEY\|GOOGLE_GEMINI_BASE_URL\|Gemini CLI\|gemini-cli-env' "$rc_file" 2>/dev/null; then
|
||||
info "Cleaning env vars from $rc_file..."
|
||||
sedi '/# Gemini CLI/d' "$rc_file"
|
||||
sedi '/gemini-cli-env\.sh/d' "$rc_file"
|
||||
sedi '/GEMINI_API_KEY/d' "$rc_file"
|
||||
sedi '/GOOGLE_GEMINI_BASE_URL/d' "$rc_file"
|
||||
log "Cleaned $rc_file"
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
# ---- Remove env files ----
|
||||
|
||||
for env_file in "/etc/profile.d/gemini-cli.sh" "/etc/gemini-cli-env.sh"; do
|
||||
if [ -f "$env_file" ]; then
|
||||
info "Removing $env_file..."
|
||||
rm -f "$env_file"
|
||||
log "Removed $env_file"
|
||||
fi
|
||||
done
|
||||
|
||||
# ---- Remove launchctl env vars (macOS) ----
|
||||
|
||||
if $IS_MACOS; then
|
||||
launchctl unsetenv GEMINI_API_KEY 2>/dev/null || true
|
||||
launchctl unsetenv GOOGLE_GEMINI_BASE_URL 2>/dev/null || true
|
||||
log "launchctl env vars cleared"
|
||||
fi
|
||||
|
||||
# ---- Remove env vars from /etc/environment (Linux) ----
|
||||
|
||||
if [ -f "/etc/environment" ] && grep -q 'GEMINI_API_KEY\|GOOGLE_GEMINI_BASE_URL' /etc/environment 2>/dev/null; then
|
||||
info "Cleaning /etc/environment..."
|
||||
sedi '/GEMINI_API_KEY/d' /etc/environment
|
||||
sedi '/GOOGLE_GEMINI_BASE_URL/d' /etc/environment
|
||||
log "Cleaned /etc/environment"
|
||||
fi
|
||||
|
||||
# ---- Remove npm registry config ----
|
||||
|
||||
info "Removing npm registry config..."
|
||||
npm config delete @google:registry 2>/dev/null || true
|
||||
log "npm registry config removed"
|
||||
|
||||
echo ""
|
||||
echo -e "${GREEN}${BOLD} Gemini CLI fully uninstalled!${RESET}"
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user