feat: add update scripts for all tools + Update section in README

- gemini/ugemini_update.sh + .ps1
- codex/ucodex_update.sh + .ps1
- qwen/uqwen_update.sh + .ps1
- README.md: added Update section with one-line and cloned-repo commands
- README.md: removed outdated Codex update instructions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
delta-cloud-208e
2026-03-08 07:44:38 +00:00
parent 1fa1dbae11
commit 9adb786bec
7 changed files with 557 additions and 7 deletions

69
qwen/uqwen_update.ps1 Normal file
View File

@@ -0,0 +1,69 @@
# Qwen Code — Windows Updater
# Usage: powershell -ExecutionPolicy Bypass -File qwen\uqwen_update.ps1
$ErrorActionPreference = "Continue"
Write-Host ""
Write-Host " +--------------------------------------+" -ForegroundColor Cyan
Write-Host " | Qwen Code -- Windows Updater |" -ForegroundColor Cyan
Write-Host " +--------------------------------------+" -ForegroundColor Cyan
Write-Host ""
function Refresh-Path {
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" +
[System.Environment]::GetEnvironmentVariable("Path", "User")
}
# ---- Check current version ----
$qwenBin = $null
foreach ($candidate in @("qwen", "qwen-code")) {
if (Get-Command $candidate -ErrorAction SilentlyContinue) { $qwenBin = $candidate; break }
}
$oldVer = if ($qwenBin) { & $qwenBin --version 2>$null } else { "not installed" }
Write-Host " Current: $oldVer" -ForegroundColor Cyan
# ---- Configure registry ----
Write-Host " Configuring npm registry..." -ForegroundColor Cyan
npm config set "@qwen-code:registry" "https://npm.sensey24.ru/" 2>$null
# ---- Update package ----
Write-Host " Installing latest @qwen-code/qwen-code..." -ForegroundColor Cyan
npm install -g @qwen-code/qwen-code 2>&1
if ($LASTEXITCODE -ne 0) {
Write-Host " npm install failed." -ForegroundColor Red
exit 1
}
Refresh-Path
foreach ($candidate in @("qwen", "qwen-code")) {
if (Get-Command $candidate -ErrorAction SilentlyContinue) { $qwenBin = $candidate; break }
}
$newVer = if ($qwenBin) { & $qwenBin --version 2>$null } else { "unknown" }
Write-Host " Updated: $oldVer -> $newVer" -ForegroundColor Green
# ---- Download and apply patches ----
$pyCmd = if (Get-Command python3 -ErrorAction SilentlyContinue) { "python3" } else { "python" }
$tempDir = Join-Path $env:TEMP "qwen-update-$(Get-Random)"
New-Item -ItemType Directory -Force -Path $tempDir | Out-Null
$repoRaw = "https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/qwen"
Write-Host " Downloading patcher..." -ForegroundColor Cyan
Invoke-WebRequest -Uri "$repoRaw/qwen_patcher.py" -OutFile "$tempDir\qwen_patcher.py" -UseBasicParsing
Invoke-WebRequest -Uri "$repoRaw/qwen_config.json" -OutFile "$tempDir\qwen_config.json" -UseBasicParsing
Write-Host " Applying patches..." -ForegroundColor Cyan
& $pyCmd "$tempDir\qwen_patcher.py" --settings-only --config "$tempDir\qwen_config.json"
if ($LASTEXITCODE -ne 0) {
Write-Host " Trying full patch..." -ForegroundColor Yellow
& $pyCmd "$tempDir\qwen_patcher.py" --apply --config "$tempDir\qwen_config.json"
}
Remove-Item -Recurse -Force $tempDir -ErrorAction SilentlyContinue
Write-Host ""
Write-Host " Update complete!" -ForegroundColor Green
Write-Host ""

95
qwen/uqwen_update.sh Normal file
View File

@@ -0,0 +1,95 @@
#!/usr/bin/env bash
# Qwen Code — Updater
# Re-installs latest version from registry + re-applies patches.
#
# Usage: sudo bash uqwen_update.sh
set -euo pipefail
REGISTRY_URL="https://npm.sensey24.ru/"
NPM_SCOPE="@qwen-code"
NPM_PACKAGE="@qwen-code/qwen-code"
REPO_RAW="https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/qwen"
GREEN="\033[92m"
CYAN="\033[96m"
YELLOW="\033[93m"
RED="\033[91m"
BOLD="\033[1m"
RESET="\033[0m"
log() { echo -e "${GREEN}[+]${RESET} $*"; }
info() { echo -e "${CYAN}[i]${RESET} $*"; }
warn() { echo -e "${YELLOW}[~]${RESET} $*"; }
err() { echo -e "${RED}[!]${RESET} $*" >&2; }
echo -e "${BOLD}"
echo " +--------------------------------------+"
echo " | Qwen Code — Updater |"
echo " +--------------------------------------+"
echo -e "${RESET}"
# ---- Check current version ----
OLD_VER=""
QWEN_BIN=""
for candidate in qwen qwen-code; do
if command -v "$candidate" &>/dev/null; then
QWEN_BIN="$candidate"
break
fi
done
if [ -n "$QWEN_BIN" ]; then
OLD_VER=$($QWEN_BIN --version 2>/dev/null || echo "unknown")
info "Current: $QWEN_BIN $OLD_VER"
else
warn "Qwen Code not found. Will install fresh."
fi
# ---- Configure npm registry ----
info "Configuring npm registry: ${REGISTRY_URL}"
npm config set "${NPM_SCOPE}:registry" "${REGISTRY_URL}" 2>/dev/null || true
# ---- Update package ----
info "Installing latest ${NPM_PACKAGE}..."
if npm install -g "${NPM_PACKAGE}" 2>&1; then
log "Package updated"
else
err "npm install failed. Try: npm config set ${NPM_SCOPE}:registry http://npm.sensey24.ru/"
exit 1
fi
# Find binary after update
for candidate in qwen qwen-code; do
if command -v "$candidate" &>/dev/null; then
QWEN_BIN="$candidate"
break
fi
done
NEW_VER=$($QWEN_BIN --version 2>/dev/null || echo "unknown")
log "Version: $OLD_VER$NEW_VER"
# ---- Download and apply patches ----
TEMP_DIR=$(mktemp -d)
cleanup() { rm -rf "$TEMP_DIR" 2>/dev/null || true; }
trap cleanup EXIT
info "Downloading patcher..."
curl -fsSL "$REPO_RAW/qwen_patcher.py" -o "$TEMP_DIR/qwen_patcher.py"
curl -fsSL "$REPO_RAW/qwen_config.json" -o "$TEMP_DIR/qwen_config.json"
info "Applying patches..."
python3 "$TEMP_DIR/qwen_patcher.py" --settings-only --config "$TEMP_DIR/qwen_config.json"
PATCH_EXIT=$?
if [ $PATCH_EXIT -ne 0 ]; then
warn "Settings-only patch returned $PATCH_EXIT, trying full patch..."
python3 "$TEMP_DIR/qwen_patcher.py" --apply --config "$TEMP_DIR/qwen_config.json"
fi
log "Update complete!"
echo ""