Uninstallers (.sh + .ps1) for Claude, Gemini, Codex, Qwen: - Remove npm package / binary - Remove settings directory (~/.gemini, ~/.qwen, ~/.codex, ~/.claude) - Remove env vars from bashrc/zshrc, /etc/environment, /etc/profile.d - Remove npm registry config Also: restore defaultApprovalMode=yolo (npm package now includes Target 9a patch in settingsSchema.js) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
47 lines
1.7 KiB
PowerShell
47 lines
1.7 KiB
PowerShell
# Qwen Code — Windows Uninstaller
|
|
# Usage: powershell -ExecutionPolicy Bypass -File qwen\uqwen_uninstall.ps1
|
|
|
|
$ErrorActionPreference = "Continue"
|
|
|
|
Write-Host ""
|
|
Write-Host " +--------------------------------------+" -ForegroundColor Cyan
|
|
Write-Host " | Qwen Code -- Windows Uninstaller |" -ForegroundColor Cyan
|
|
Write-Host " +--------------------------------------+" -ForegroundColor Cyan
|
|
Write-Host ""
|
|
|
|
# ---- Uninstall npm package ----
|
|
|
|
Write-Host " Removing @qwen-code/qwen-code..." -ForegroundColor Cyan
|
|
npm uninstall -g @qwen-code/qwen-code 2>$null
|
|
Write-Host " npm package removed" -ForegroundColor Green
|
|
|
|
# ---- Remove settings ----
|
|
|
|
$qwenDir = "$env:USERPROFILE\.qwen"
|
|
if (Test-Path $qwenDir) {
|
|
Write-Host " Removing $qwenDir..." -ForegroundColor Cyan
|
|
Remove-Item -Recurse -Force $qwenDir
|
|
Write-Host " Settings removed" -ForegroundColor Green
|
|
} else {
|
|
Write-Host " No settings directory found" -ForegroundColor Yellow
|
|
}
|
|
|
|
# ---- Remove env vars ----
|
|
|
|
Write-Host " Removing environment variables..." -ForegroundColor Cyan
|
|
[System.Environment]::SetEnvironmentVariable("QWEN_API_KEY", $null, "User")
|
|
[System.Environment]::SetEnvironmentVariable("QWEN_BASE_URL", $null, "User")
|
|
Remove-Item Env:QWEN_API_KEY -ErrorAction SilentlyContinue
|
|
Remove-Item Env:QWEN_BASE_URL -ErrorAction SilentlyContinue
|
|
Write-Host " Env vars removed" -ForegroundColor Green
|
|
|
|
# ---- Remove npm registry config ----
|
|
|
|
Write-Host " Removing npm registry config..." -ForegroundColor Cyan
|
|
npm config delete "@qwen-code:registry" 2>$null
|
|
Write-Host " Registry config removed" -ForegroundColor Green
|
|
|
|
Write-Host ""
|
|
Write-Host " Qwen Code fully uninstalled!" -ForegroundColor Green
|
|
Write-Host ""
|