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:
64
gemini/ugemini_update.ps1
Normal file
64
gemini/ugemini_update.ps1
Normal file
@@ -0,0 +1,64 @@
|
||||
# Gemini CLI — Windows Updater
|
||||
# Usage: powershell -ExecutionPolicy Bypass -File gemini\ugemini_update.ps1
|
||||
|
||||
$ErrorActionPreference = "Continue"
|
||||
|
||||
Write-Host ""
|
||||
Write-Host " +--------------------------------------+" -ForegroundColor Cyan
|
||||
Write-Host " | Gemini CLI -- 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 ----
|
||||
|
||||
$oldVer = "not installed"
|
||||
if (Get-Command gemini -ErrorAction SilentlyContinue) {
|
||||
$oldVer = (gemini --version 2>$null) -replace '[\r\n]', ''
|
||||
}
|
||||
Write-Host " Current: $oldVer" -ForegroundColor Cyan
|
||||
|
||||
# ---- Configure registry ----
|
||||
|
||||
Write-Host " Configuring npm registry..." -ForegroundColor Cyan
|
||||
npm config set "@google:registry" "https://npm.sensey24.ru/" 2>$null
|
||||
|
||||
# ---- Update package ----
|
||||
|
||||
Write-Host " Installing latest @google/gemini-cli..." -ForegroundColor Cyan
|
||||
npm install -g @google/gemini-cli 2>&1
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Host " npm install failed." -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
Refresh-Path
|
||||
|
||||
$newVer = "unknown"
|
||||
if (Get-Command gemini -ErrorAction SilentlyContinue) {
|
||||
$newVer = (gemini --version 2>$null) -replace '[\r\n]', ''
|
||||
}
|
||||
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 "gemini-update-$(Get-Random)"
|
||||
New-Item -ItemType Directory -Force -Path $tempDir | Out-Null
|
||||
|
||||
$repoRaw = "https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/gemini"
|
||||
Write-Host " Downloading patcher..." -ForegroundColor Cyan
|
||||
Invoke-WebRequest -Uri "$repoRaw/gemini_patcher.py" -OutFile "$tempDir\gemini_patcher.py" -UseBasicParsing
|
||||
Invoke-WebRequest -Uri "$repoRaw/gemini_config.json" -OutFile "$tempDir\gemini_config.json" -UseBasicParsing
|
||||
|
||||
Write-Host " Applying patches..." -ForegroundColor Cyan
|
||||
& $pyCmd "$tempDir\gemini_patcher.py" --apply --config "$tempDir\gemini_config.json"
|
||||
|
||||
Remove-Item -Recurse -Force $tempDir -ErrorAction SilentlyContinue
|
||||
|
||||
Write-Host ""
|
||||
Write-Host " Update complete!" -ForegroundColor Green
|
||||
Write-Host ""
|
||||
74
gemini/ugemini_update.sh
Normal file
74
gemini/ugemini_update.sh
Normal file
@@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env bash
|
||||
# Gemini CLI — Updater
|
||||
# Re-installs latest version from registry + re-applies patches.
|
||||
#
|
||||
# Usage: sudo bash ugemini_update.sh
|
||||
# Or: curl -fsSL URL -o /tmp/ugemini_update.sh && sudo bash /tmp/ugemini_update.sh
|
||||
set -euo pipefail
|
||||
|
||||
REGISTRY_URL="https://npm.sensey24.ru/"
|
||||
NPM_SCOPE="@google"
|
||||
NPM_PACKAGE="@google/gemini-cli"
|
||||
REPO_RAW="https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/gemini"
|
||||
|
||||
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 " | Gemini CLI — Updater |"
|
||||
echo " +--------------------------------------+"
|
||||
echo -e "${RESET}"
|
||||
|
||||
# ---- Check current version ----
|
||||
|
||||
OLD_VER=""
|
||||
if command -v gemini &>/dev/null; then
|
||||
OLD_VER=$(gemini --version 2>/dev/null || echo "unknown")
|
||||
info "Current version: $OLD_VER"
|
||||
else
|
||||
warn "Gemini CLI 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
|
||||
|
||||
NEW_VER=$(gemini --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/gemini_patcher.py" -o "$TEMP_DIR/gemini_patcher.py"
|
||||
curl -fsSL "$REPO_RAW/gemini_config.json" -o "$TEMP_DIR/gemini_config.json"
|
||||
|
||||
info "Applying patches..."
|
||||
python3 "$TEMP_DIR/gemini_patcher.py" --apply --config "$TEMP_DIR/gemini_config.json"
|
||||
|
||||
log "Update complete!"
|
||||
echo ""
|
||||
Reference in New Issue
Block a user