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:
delta-cloud-208e
2026-04-21 09:30:16 +00:00
parent 1320f13f5c
commit f7cf0b79fd
8 changed files with 953 additions and 433 deletions

121
README.md
View File

@@ -8,10 +8,10 @@ Patched AI coding tools for use with custom API endpoints.
| Folder | Tool | Status | | Folder | Tool | Status |
|--------|------|--------| |--------|------|--------|
| [claude/](claude/) | Claude Code | Active (v2.1.71) | | [claude/](claude/) | Claude Code | Active (v2.1.112) |
| [codex/](codex/) | OpenAI Codex CLI | **Active (v0.111.0)** | | [codex/](codex/) | OpenAI Codex CLI | **Active (v0.116.0)** |
| [gemini/](gemini/) | Gemini CLI | **Active (v0.32.1)** | | [gemini/](gemini/) | Gemini CLI | **Active (v0.32.1)** |
| [qwen/](qwen/) | Qwen Code | **Active (v0.11.1)** | | [qwen/](qwen/) | Qwen Code | **Active (v0.14.5)** |
| antigravity/ | Antigravity | Planned | | antigravity/ | Antigravity | Planned |
## Quick Start ## Quick Start
@@ -163,14 +163,21 @@ Verify: `gemini -p "Hello"`
**Alternative — Automatic installer (installs Node.js, CLI, patches, settings):** **Alternative — Automatic installer (installs Node.js, CLI, patches, settings):**
Linux / macOS: **Linux (Debian/Ubuntu/RHEL/Fedora):**
```bash ```bash
curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \ curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \
https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/gemini/ugemini_install.sh \ https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/gemini/ugemini_install.sh \
-o /tmp/ugemini.sh && sudo bash /tmp/ugemini.sh -o /tmp/ugemini.sh && sudo bash /tmp/ugemini.sh
``` ```
Windows (PowerShell as Administrator): **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.sh && sudo bash /tmp/ugemini.sh
```
**Windows (PowerShell as Administrator):**
```powershell ```powershell
$h=@{Authorization="token cadffcb0a6a3be728ac1ff619bb40c86588f6837"} $h=@{Authorization="token cadffcb0a6a3be728ac1ff619bb40c86588f6837"}
Set-ExecutionPolicy Bypass -Scope Process -Force Set-ExecutionPolicy Bypass -Scope Process -Force
@@ -178,19 +185,35 @@ iwr "https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/gemini/u
. "$env:TEMP\ugemini_install.ps1" . "$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\""
```
See [gemini/README.md](gemini/README.md) for details. See [gemini/README.md](gemini/README.md) for details.
### Codex CLI — Install ### Codex CLI — Install
> Codex CLI is a compiled Rust binary (not npm). Install via GitHub releases. > Codex CLI is a compiled Rust binary (not npm). Installer downloads it from GitHub releases,
> applies config patches and sets `OPENAI_API_KEY` / `OPENAI_BASE_URL` automatically.
**Linux / macOS:** **Linux (Debian/Ubuntu/RHEL/Fedora):**
```bash ```bash
curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \ curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \
https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/codex/ucodex_install.sh \ https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/codex/ucodex_install.sh \
-o /tmp/ucodex_install.sh && sudo bash /tmp/ucodex_install.sh -o /tmp/ucodex_install.sh && sudo bash /tmp/ucodex_install.sh
``` ```
**macOS (Intel & Apple Silicon):**
```bash
curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \
https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/codex/ucodex_install.sh \
-o /tmp/ucodex_install.sh && sudo bash /tmp/ucodex_install.sh
```
> macOS установит Mach-O бинарь под ваш ARCH (x86_64 / arm64), env-переменные через
> `launchctl setenv` + `~/.zshrc`. Если запросит — введите пароль для `sudo`.
**Windows (PowerShell as Administrator):** **Windows (PowerShell as Administrator):**
```powershell ```powershell
$h=@{Authorization="token cadffcb0a6a3be728ac1ff619bb40c86588f6837"} $h=@{Authorization="token cadffcb0a6a3be728ac1ff619bb40c86588f6837"}
@@ -199,45 +222,37 @@ iwr "https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/codex/uc
. "$env:TEMP\ucodex_install.ps1" . "$env:TEMP\ucodex_install.ps1"
``` ```
Verify: `codex exec "Hello"` **Windows (CMD as Administrator):**
```cmd
powershell -NoProfile -ExecutionPolicy Bypass -Command "$h=@{Authorization='token cadffcb0a6a3be728ac1ff619bb40c86588f6837'}; iwr 'https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/codex/ucodex_install.ps1' -OutFile \"$env:TEMP\ucodex_install.ps1\" -Headers $h; & \"$env:TEMP\ucodex_install.ps1\""
```
> Windows: бинарь ставится в `%LOCALAPPDATA%\Programs\codex\codex.exe` и добавляется в PATH
> пользователя. После установки **перезапустите CMD/PowerShell** для подхвата env vars.
Verify (any platform): `codex exec "Hello"`
See [codex/README.md](codex/README.md) for details, troubleshooting, and configuration. See [codex/README.md](codex/README.md) for details, troubleshooting, and configuration.
### Qwen Code — Install ### Qwen Code — Install
**Linux / macOS (two commands):** > Установщик подтянет Node.js если его нет, поставит npm-пакет и применит settings.
```bash
npm config set @qwen-code:registry https://npm.sensey24.ru/
npm install -g @qwen-code/qwen-code
```
**Windows (PowerShell):** **Linux (Debian/Ubuntu/RHEL/Fedora):**
```powershell
npm config set "@qwen-code:registry" "https://npm.sensey24.ru/"
npm install -g @qwen-code/qwen-code
```
> Node.js required. Install from https://nodejs.org/ if not present.
Then configure (downloads patcher automatically):
```bash
curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \
https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/qwen/uqwen_install.sh \
-o /tmp/uqwen_install.sh && sudo bash /tmp/uqwen_install.sh
```
Verify: `qwen -p "Hello"`
**Alternative — Automatic installer:**
Linux / macOS:
```bash ```bash
curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \ curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \
https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/qwen/uqwen_install.sh \ https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/qwen/uqwen_install.sh \
-o /tmp/uqwen.sh && sudo bash /tmp/uqwen.sh -o /tmp/uqwen.sh && sudo bash /tmp/uqwen.sh
``` ```
Windows (PowerShell as Administrator): **macOS (Intel & Apple Silicon):**
```bash
curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \
https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/qwen/uqwen_install.sh \
-o /tmp/uqwen.sh && sudo bash /tmp/uqwen.sh
```
**Windows (PowerShell as Administrator):**
```powershell ```powershell
$h=@{Authorization="token cadffcb0a6a3be728ac1ff619bb40c86588f6837"} $h=@{Authorization="token cadffcb0a6a3be728ac1ff619bb40c86588f6837"}
Set-ExecutionPolicy Bypass -Scope Process -Force Set-ExecutionPolicy Bypass -Scope Process -Force
@@ -245,6 +260,29 @@ iwr "https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/qwen/uqw
. "$env:TEMP\uqwen_install.ps1" . "$env:TEMP\uqwen_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/qwen/uqwen_install.ps1' -OutFile \"$env:TEMP\uqwen_install.ps1\" -Headers $h; & \"$env:TEMP\uqwen_install.ps1\""
```
Verify: `qwen -p "Hello"`
**Alternative — npm install (manual):**
Linux / macOS:
```bash
npm config set @qwen-code:registry https://npm.sensey24.ru/
npm install -g @qwen-code/qwen-code
python3 qwen_patcher.py --settings-only
```
Windows (PowerShell):
```powershell
npm config set "@qwen-code:registry" "https://npm.sensey24.ru/"
npm install -g @qwen-code/qwen-code
python qwen_patcher.py --settings-only
```
See [qwen/README.md](qwen/README.md) for details, models, and troubleshooting. See [qwen/README.md](qwen/README.md) for details, models, and troubleshooting.
### Manual install from release ### Manual install from release
@@ -302,6 +340,11 @@ Set-ExecutionPolicy Bypass -Scope Process -Force
. "$env:TEMP\ugemini_update.ps1" . "$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\""
```
### Codex CLI — Update ### Codex CLI — Update
**Linux / macOS:** **Linux / macOS:**
@@ -319,6 +362,11 @@ Set-ExecutionPolicy Bypass -Scope Process -Force
. "$env:TEMP\ucodex_update.ps1" . "$env:TEMP\ucodex_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/codex/ucodex_update.ps1' -OutFile \"$env:TEMP\ucodex_update.ps1\" -Headers $h; & \"$env:TEMP\ucodex_update.ps1\""
```
### Qwen Code — Update ### Qwen Code — Update
**Linux / macOS:** **Linux / macOS:**
@@ -336,6 +384,11 @@ Set-ExecutionPolicy Bypass -Scope Process -Force
. "$env:TEMP\uqwen_update.ps1" . "$env:TEMP\uqwen_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/qwen/uqwen_update.ps1' -OutFile \"$env:TEMP\uqwen_update.ps1\" -Headers $h; & \"$env:TEMP\uqwen_update.ps1\""
```
## Uninstall ## Uninstall
**Linux / macOS:** **Linux / macOS:**

View File

@@ -1,7 +1,7 @@
# Codex CLI — Patched # Codex CLI — Patched
Patched OpenAI Codex CLI for use with custom API endpoints. Patched OpenAI Codex CLI for use with custom API endpoints.
Latest: **v0.111.0** (6 config patches). Latest: **v0.116.0** (6 config patches).
> Codex CLI — это compiled Rust binary. В отличие от Claude Code и Gemini CLI (JavaScript), > Codex CLI — это compiled Rust binary. В отличие от Claude Code и Gemini CLI (JavaScript),
> патчинг выполняется через `config.toml` + переменные окружения. > патчинг выполняется через `config.toml` + переменные окружения.
@@ -10,33 +10,73 @@ Latest: **v0.111.0** (6 config patches).
### Требования ### Требования
- **Python 3.11+** (для `tomllib`) - **Python 3.11+** (для `tomllib`) — на Windows опционально (есть PowerShell-fallback)
- **curl** (для скачивания бинарника) - **curl** (Linux/macOS) или **PowerShell 5+** (Windows 10+ — встроенный)
- **Linux x86_64 или aarch64** (macOS/Windows — вручную) - Поддерживаемые платформы: **Linux x86_64/aarch64**, **macOS x86_64/arm64**, **Windows x86_64**
### Быстрая установка (Linux) ### Установка одной командой
**Linux (Debian/Ubuntu/RHEL/Fedora):**
```bash
curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \
https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/codex/ucodex_install.sh \
-o /tmp/ucodex_install.sh && sudo bash /tmp/ucodex_install.sh
```
**macOS (Intel & Apple Silicon):**
```bash
curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \
https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/codex/ucodex_install.sh \
-o /tmp/ucodex_install.sh && sudo bash /tmp/ucodex_install.sh
```
> Бинарь устанавливается в `/usr/local/bin/.codex-bin`, wrapper — в `/usr/local/bin/codex`.
> Env vars (`OPENAI_API_KEY`, `OPENAI_BASE_URL`) пробрасываются через `launchctl setenv`
> и `~/.zshrc` / `~/.bashrc` (на Linux — `/etc/environment` + `/etc/profile.d/codex-env.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/codex/ucodex_install.ps1" -OutFile "$env:TEMP\ucodex_install.ps1" -Headers $h
. "$env:TEMP\ucodex_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/codex/ucodex_install.ps1' -OutFile \"$env:TEMP\ucodex_install.ps1\" -Headers $h; & \"$env:TEMP\ucodex_install.ps1\""
```
> Windows: бинарь ставится в `%LOCALAPPDATA%\Programs\codex\codex.exe` и автоматически
> добавляется в PATH пользователя. Env vars (`OPENAI_API_KEY`, `OPENAI_BASE_URL`) ставятся
> через `setx` + `[Environment]::SetEnvironmentVariable("...", "...", "User")`.
> **После установки перезапустите CMD/PowerShell** для подхвата env vars и PATH.
### Установка из репозитория (любая платформа)
```bash ```bash
# 1. Клонировать репо (или скачать файлы)
git clone https://git.sensey24.ru/aibot777/unlimitedcoding.git git clone https://git.sensey24.ru/aibot777/unlimitedcoding.git
cd unlimitedcoding/codex cd unlimitedcoding/codex
# 2. Настроить конфиг — указать свой API endpoint и ключ # 1) Настроить конфиг
cp codex_config.example.json codex_config.json cp codex_config.example.json codex_config.json
nano codex_config.json # Изменить base_url и api_key # Редактировать base_url и api_key в codex_config.json
# 3. Установить бинарник + применить патчи # 2a) Linux/macOS:
sudo bash ucodex_install.sh sudo bash ucodex_install.sh
# 2b) Windows PowerShell (Administrator):
powershell -ExecutionPolicy Bypass -File ucodex_install.ps1
``` ```
### Ручная установка (шаг за шагом) ### Ручная установка (шаг за шагом, Linux/macOS)
**Шаг 1 — Установить бинарник Codex CLI:** **Шаг 1 — Установить бинарник Codex CLI:**
```bash ```bash
# Скачать последнюю версию с GitHub # Скачать последнюю версию с GitHub
sudo bash update-codex.sh sudo bash update-codex.sh
codex --version # Должно показать: codex-cli 0.111.0 codex --version # Должно показать: codex-cli 0.116.0
``` ```
**Шаг 2 — Настроить конфиг:** **Шаг 2 — Настроить конфиг:**
@@ -89,7 +129,29 @@ codex exec "What is 2+2? Reply with just the number"
## Обновление ## Обновление
### Обновить бинарник Codex CLI ### Одной командой
**Linux / macOS:**
```bash
curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \
https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/codex/ucodex_update.sh \
-o /tmp/ucodex_update.sh && sudo bash /tmp/ucodex_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/codex/ucodex_update.ps1" -OutFile "$env:TEMP\ucodex_update.ps1" -Headers $h
. "$env:TEMP\ucodex_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/codex/ucodex_update.ps1' -OutFile \"$env:TEMP\ucodex_update.ps1\" -Headers $h; & \"$env:TEMP\ucodex_update.ps1\""
```
### Обновить бинарник Codex CLI вручную (Linux/macOS)
```bash ```bash
cd unlimitedcoding/codex cd unlimitedcoding/codex
@@ -158,6 +220,25 @@ env_key = "OPENAI_API_KEY"
wire_api = "responses" wire_api = "responses"
``` ```
## Удаление (Uninstall)
**Linux / macOS:**
```bash
curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \
https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/codex/ucodex_uninstall.sh \
-o /tmp/ucodex_uninstall.sh && sudo bash /tmp/ucodex_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/codex/ucodex_uninstall.ps1" -OutFile "$env:TEMP\ucodex_uninstall.ps1" -Headers $h
. "$env:TEMP\ucodex_uninstall.ps1"
```
Удаляются: бинарь, `~/.codex/`, env vars, wrapper, PATH-запись.
## Rollback ## Rollback
Восстановить оригинальный конфиг: Восстановить оригинальный конфиг:
@@ -171,29 +252,58 @@ python3 codex_patcher.py --rollback
### "Error loading configuration: missing field `name`" ### "Error loading configuration: missing field `name`"
Обновите патчер (`git pull`) и перезапустите: `python3 codex_patcher.py --apply` Обновите патчер (`git pull`) и перезапустите: `python3 codex_patcher.py --apply`
### codex не запускается (segfault / GLIBC) ### codex не запускается (segfault / GLIBC) — Linux
Скрипт `update-codex.sh` скачивает musl-версию для совместимости. Если проблема остаётся: Скрипт `update-codex.sh` скачивает musl-версию для совместимости. Если проблема остаётся:
```bash ```bash
# Проверить бинарник file /usr/local/bin/.codex-bin
file /usr/local/bin/codex ldd /usr/local/bin/.codex-bin # Должно быть "not a dynamic executable" (static)
ldd /usr/local/bin/codex # Должно быть "not a dynamic executable" (static) ```
### macOS: "codex" cannot be opened because the developer cannot be verified
```bash
xattr -d com.apple.quarantine /usr/local/bin/.codex-bin
```
### Windows: "codex is not recognized"
Перезапустите CMD/PowerShell. Либо вручную обновите PATH в текущей сессии:
```powershell
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
``` ```
### "OPENAI_API_KEY not set" ### "OPENAI_API_KEY not set"
```bash
# Вариант 1: Перезайти в shell (env vars из /etc/environment)
source /etc/environment
# Вариант 2: Установить вручную **Linux:**
```bash
source /etc/environment
# или
export OPENAI_BASE_URL="https://your-endpoint/v1" export OPENAI_BASE_URL="https://your-endpoint/v1"
export OPENAI_API_KEY="your-key" export OPENAI_API_KEY="your-key"
``` ```
**macOS:**
```bash
source /etc/codex-env.sh
# или перезайти в shell (zsh подхватит из ~/.zshrc)
```
**Windows (PowerShell):**
```powershell
[System.Environment]::SetEnvironmentVariable("OPENAI_API_KEY", "your-key", "User")
[System.Environment]::SetEnvironmentVariable("OPENAI_BASE_URL", "https://your-endpoint/v1", "User")
# Перезапустите PowerShell
```
**Windows (CMD):**
```cmd
setx OPENAI_API_KEY "your-key"
setx OPENAI_BASE_URL "https://your-endpoint/v1"
```
### Permissions промпты всё ещё появляются ### Permissions промпты всё ещё появляются
Убедитесь что config.toml содержит `approval_policy = "never"`: Убедитесь что config.toml содержит `approval_policy = "never"`:
```bash
cat ~/.codex/config.toml | grep approval Linux/macOS: `cat ~/.codex/config.toml | grep approval`
``` Windows: `type %USERPROFILE%\.codex\config.toml | findstr approval`
## Структура файлов ## Структура файлов
@@ -204,7 +314,12 @@ codex/
├── codex_config.example.json # Пример конфига ├── codex_config.example.json # Пример конфига
├── update_codex_patcher.py # Pipeline CLI ├── update_codex_patcher.py # Pipeline CLI
├── update-codex.sh # Бинарный updater с GitHub ├── update-codex.sh # Бинарный updater с GitHub
├── ucodex_install.sh # One-liner installer ├── ucodex_install.sh # One-liner installer (Linux/macOS)
├── ucodex_install.ps1 # One-liner installer (Windows)
├── ucodex_update.sh # Update script (Linux/macOS)
├── ucodex_update.ps1 # Update script (Windows)
├── ucodex_uninstall.sh # Uninstaller (Linux/macOS)
├── ucodex_uninstall.ps1 # Uninstaller (Windows)
└── updater/ └── updater/
├── __init__.py ├── __init__.py
└── config_validator.py # Валидация 6 targets └── config_validator.py # Валидация 6 targets

View File

@@ -5,9 +5,54 @@ Patched Gemini CLI for use with custom API endpoints.
Latest: **v0.35.3** (13 patches). Latest: **v0.35.3** (13 patches).
<!-- VERSION_BADGE:END --> <!-- 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:** **Linux / macOS:**
```bash ```bash
@@ -21,113 +66,132 @@ npm config set "@google:registry" "https://npm.sensey24.ru/"
npm install -g @google/gemini-cli 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). ### Manual configure (если устанавливали через npm)
You still need to configure auth and env vars:
npm-пакет содержит все 13 патчей (proxy URLs, model defaults, UI, compression).
Нужно лишь настроить auth и env vars.
**Linux / macOS:** **Linux / macOS:**
```bash ```bash
# Set environment variables
echo 'export GEMINI_API_KEY="ClauderAPI2"' >> ~/.bashrc echo 'export GEMINI_API_KEY="ClauderAPI2"' >> ~/.bashrc
echo 'export GOOGLE_GEMINI_BASE_URL="https://ai.37-187-136-86.sslip.io"' >> ~/.bashrc echo 'export GOOGLE_GEMINI_BASE_URL="https://ai.37-187-136-86.sslip.io"' >> ~/.bashrc
source ~/.bashrc source ~/.bashrc
# Configure auth (switch from OAuth to API key)
mkdir -p ~/.gemini mkdir -p ~/.gemini
cat > ~/.gemini/settings.json << 'EOF' cat > ~/.gemini/settings.json << 'EOF'
{ {
"security": { "security": {
"auth": { "auth": { "selectedType": "gemini-api-key" },
"selectedType": "gemini-api-key" "folderTrust": { "enabled": false }
}
}, },
"telemetry": { "telemetry": { "enabled": false, "logPrompts": false },
"enabled": false, "general": { "defaultApprovalMode": "yolo" }
"logPrompts": false
}
} }
EOF EOF
``` ```
**Windows (PowerShell):** **macOS (zsh — default):**
```powershell ```bash
# Set environment variables echo 'export GEMINI_API_KEY="ClauderAPI2"' >> ~/.zshrc
[System.Environment]::SetEnvironmentVariable("GEMINI_API_KEY", "ClauderAPI2", "User") echo 'export GOOGLE_GEMINI_BASE_URL="https://ai.37-187-136-86.sslip.io"' >> ~/.zshrc
[System.Environment]::SetEnvironmentVariable("GOOGLE_GEMINI_BASE_URL", "https://ai.37-187-136-86.sslip.io", "User") source ~/.zshrc
# 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
``` ```
**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 ```bash
gemini -p "Hello" 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? | | Patch | What | Included in npm? |
|-------|------|:-:| |-------|------|:-:|
| 1-3 | Proxy URLs (API + Vertex) | Yes | | 1-3 | Proxy URLs (API + Vertex) | Yes |
| 4-5 | Sandbox fixes (env vars + whitelist) | 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 | | 7-8 | Auto-update registry + commands | Yes |
| 9 | Auto-permissions (YOLO mode) | Yes | | 9 | Auto-permissions (YOLO mode) | Yes |
| 10 | Default model constants (3.x) | Yes | | 10 | Default model constants (3.x) | Yes |
| 11-13 | UI descriptions + compression aliases | 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 ## What Gets Patched
| # | Target | What | | # | Target | What |
@@ -158,19 +222,51 @@ gemini -p "Hello"
## Troubleshooting ## Troubleshooting
**"GEMINI_API_KEY not set"** ### "GEMINI_API_KEY not set"
**Linux / macOS:**
```bash ```bash
export GEMINI_API_KEY="ClauderAPI2" export GEMINI_API_KEY="ClauderAPI2"
export GOOGLE_GEMINI_BASE_URL="https://ai.37-187-136-86.sslip.io" export GOOGLE_GEMINI_BASE_URL="https://ai.37-187-136-86.sslip.io"
``` ```
**"IneligibleTierError"** **Windows (PowerShell):**
Settings still using OAuth. Re-run patcher: ```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 ```bash
python3 gemini_patcher.py --settings-only 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 ```bash
sudo python3 gemini_patcher.py --rollback 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_patcher.py` | Main patcher — detects Gemini CLI, applies 13 patches |
| `gemini_config.json` | Config — proxy URL, API key, models | | `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 | | `releases/index.json` | Version index |

View File

@@ -16,6 +16,24 @@ log() { echo -e "${GREEN}[+]${RESET} $*"; }
warn() { echo -e "${YELLOW}[~]${RESET} $*"; } warn() { echo -e "${YELLOW}[~]${RESET} $*"; }
info() { echo -e "${CYAN}[i]${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 -e "${BOLD}"
echo " +--------------------------------------+" echo " +--------------------------------------+"
echo " | Gemini CLI — Uninstaller |" echo " | Gemini CLI — Uninstaller |"
@@ -34,7 +52,7 @@ fi
# ---- Remove settings ---- # ---- Remove settings ----
for user_home in /root /home/*; do for user_home in /root $SCAN_DIRS/*; do
GEMINI_DIR="$user_home/.gemini" GEMINI_DIR="$user_home/.gemini"
if [ -d "$GEMINI_DIR" ]; then if [ -d "$GEMINI_DIR" ]; then
info "Removing $GEMINI_DIR..." info "Removing $GEMINI_DIR..."
@@ -45,32 +63,43 @@ done
# ---- Remove env vars from shell rc files ---- # ---- Remove env vars from shell rc files ----
for user_home in /root /home/*; do for user_home in /root $SCAN_DIRS/*; do
for rc_file in "$user_home/.bashrc" "$user_home/.zshrc"; 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 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..." info "Cleaning env vars from $rc_file..."
sed -i '/# Gemini CLI/d' "$rc_file" sedi '/# Gemini CLI/d' "$rc_file"
sed -i '/GEMINI_API_KEY/d' "$rc_file" sedi '/gemini-cli-env\.sh/d' "$rc_file"
sed -i '/GOOGLE_GEMINI_BASE_URL/d' "$rc_file" sedi '/GEMINI_API_KEY/d' "$rc_file"
sedi '/GOOGLE_GEMINI_BASE_URL/d' "$rc_file"
log "Cleaned $rc_file" log "Cleaned $rc_file"
fi fi
done done
done done
# ---- Remove /etc/profile.d script ---- # ---- Remove env files ----
if [ -f "/etc/profile.d/gemini-cli.sh" ]; then for env_file in "/etc/profile.d/gemini-cli.sh" "/etc/gemini-cli-env.sh"; do
info "Removing /etc/profile.d/gemini-cli.sh..." if [ -f "$env_file" ]; then
rm -f "/etc/profile.d/gemini-cli.sh" info "Removing $env_file..."
log "Removed /etc/profile.d/gemini-cli.sh" 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 fi
# ---- Remove env vars from /etc/environment ---- # ---- 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 if [ -f "/etc/environment" ] && grep -q 'GEMINI_API_KEY\|GOOGLE_GEMINI_BASE_URL' /etc/environment 2>/dev/null; then
info "Cleaning /etc/environment..." info "Cleaning /etc/environment..."
sed -i '/GEMINI_API_KEY/d' /etc/environment sedi '/GEMINI_API_KEY/d' /etc/environment
sed -i '/GOOGLE_GEMINI_BASE_URL/d' /etc/environment sedi '/GOOGLE_GEMINI_BASE_URL/d' /etc/environment
log "Cleaned /etc/environment" log "Cleaned /etc/environment"
fi fi

View File

@@ -4,37 +4,128 @@ Patches [QwenCode CLI](https://github.com/QwenLM/qwen-code) (`@qwen-code/qwen-co
**[RU]** Патчер для QwenCode CLI — перенаправляет API запросы через пользовательский AI прокси, отключает телеметрию, автоматически настраивает окружение. **[RU]** Патчер для QwenCode CLI — перенаправляет API запросы через пользовательский AI прокси, отключает телеметрию, автоматически настраивает окружение.
## Quick Start Latest target version: **v0.14.5** (12 patches).
## Install
> Node.js v20+ required. Установщик подтянет Node.js если его нет.
### One-liner — все платформы
**Linux (Debian/Ubuntu/RHEL/Fedora):**
```bash ```bash
# 1. Install from private registry curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \
npm config set @qwen-code:registry https://npm.sensey24.ru/ https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/qwen/uqwen_install.sh \
npm install -g @qwen-code/qwen-code -o /tmp/uqwen_install.sh && sudo bash /tmp/uqwen_install.sh
# 2. Apply settings (env vars + settings.json)
python3 qwen_patcher.py --settings-only
# 3. Verify
qwen -p "Say hello"
``` ```
## Windows **macOS (Intel & Apple Silicon):**
```bash
curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \
https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/qwen/uqwen_install.sh \
-o /tmp/uqwen_install.sh && sudo bash /tmp/uqwen_install.sh
```
> macOS: env vars (`OPENAI_API_KEY`, `OPENAI_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/qwen/uqwen_install.ps1" -OutFile "$env:TEMP\uqwen_install.ps1" -Headers $h
. "$env:TEMP\uqwen_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/qwen/uqwen_install.ps1' -OutFile \"$env:TEMP\uqwen_install.ps1\" -Headers $h; & \"$env:TEMP\uqwen_install.ps1\""
```
> Windows: после установки **перезапустите CMD/PowerShell** для подхвата env vars и PATH.
### Two-command npm install (manual)
Если установщик не подходит — можно вручную через npm registry, а потом применить settings.
**Linux / macOS:**
```bash
npm config set @qwen-code:registry https://npm.sensey24.ru/
npm install -g @qwen-code/qwen-code
python3 qwen_patcher.py --settings-only
```
**Windows (PowerShell):**
```powershell ```powershell
npm config set "@qwen-code:registry" "https://npm.sensey24.ru/" npm config set "@qwen-code:registry" "https://npm.sensey24.ru/"
npm install -g @qwen-code/qwen-code npm install -g @qwen-code/qwen-code
python3 qwen_patcher.py --settings-only python qwen_patcher.py --settings-only
```
**Windows (CMD):**
```cmd
npm config set "@qwen-code:registry" "https://npm.sensey24.ru/"
npm install -g @qwen-code/qwen-code
python qwen_patcher.py --settings-only
```
### Verify
```bash
qwen -p "Say hello"
``` ```
## Update ## Update
Same two commands — npm will pull the latest patched version: ### One-liner
**Linux / macOS:**
```bash
curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \
https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/qwen/uqwen_update.sh \
-o /tmp/uqwen_update.sh && sudo bash /tmp/uqwen_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/qwen/uqwen_update.ps1" -OutFile "$env:TEMP\uqwen_update.ps1" -Headers $h
. "$env:TEMP\uqwen_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/qwen/uqwen_update.ps1' -OutFile \"$env:TEMP\uqwen_update.ps1\" -Headers $h; & \"$env:TEMP\uqwen_update.ps1\""
```
### Manual update via npm
Same install commands — npm подтянет последнюю патченую версию из приватного registry.
```bash ```bash
npm config set @qwen-code:registry https://npm.sensey24.ru/
npm install -g @qwen-code/qwen-code npm install -g @qwen-code/qwen-code
``` ```
## Uninstall
**Linux / macOS:**
```bash
curl -fsSL -H "Authorization: token cadffcb0a6a3be728ac1ff619bb40c86588f6837" \
https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/qwen/uqwen_uninstall.sh \
-o /tmp/uqwen_uninstall.sh && sudo bash /tmp/uqwen_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/qwen/uqwen_uninstall.ps1" -OutFile "$env:TEMP\uqwen_uninstall.ps1" -Headers $h
. "$env:TEMP\uqwen_uninstall.ps1"
```
Удаляются: npm-пакет, `~/.qwen/`, env vars, npm registry config.
## What Gets Patched ## What Gets Patched
| # | Target | Description | | # | Target | Description |
@@ -59,7 +150,6 @@ Targets 1-9 are pre-patched in the npm package. Targets 10-12 require running `q
| Model | Description | | Model | Description |
|-------|-------------| |-------|-------------|
| `qwen3.5-plus` | Qwen 3.5 Plus — default | | `qwen3.5-plus` | Qwen 3.5 Plus — default |
| `coder-model` | Direct OAuth model name |
| `qwen3-coder-plus` | Qwen3 Coder Plus | | `qwen3-coder-plus` | Qwen3 Coder Plus |
| `qwen3-coder-flash` | Qwen3 Coder Flash (fast) | | `qwen3-coder-flash` | Qwen3 Coder Flash (fast) |
@@ -97,3 +187,17 @@ python3 qwen_patcher.py --rollback
npm install -g @qwen-code/qwen-code # Re-installs pre-patched version npm install -g @qwen-code/qwen-code # Re-installs pre-patched version
python3 qwen_patcher.py --settings-only python3 qwen_patcher.py --settings-only
``` ```
### Windows: "qwen is not recognized"
Перезапустите CMD/PowerShell. Либо вручную обновите PATH в текущей сессии:
```powershell
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
```
### macOS: env vars not picked up
Перезайдите в shell или загрузите вручную:
```bash
source ~/.zshrc
```

View File

@@ -14,7 +14,24 @@ REGISTRY_URL="https://npm.sensey24.ru/"
NPM_SCOPE="@qwen-code" NPM_SCOPE="@qwen-code"
NPM_PACKAGE="@qwen-code/qwen-code" NPM_PACKAGE="@qwen-code/qwen-code"
OS="$(uname -s)"
IS_MACOS=false
[ "$OS" = "Darwin" ] && IS_MACOS=true
if $IS_MACOS; then
ENV_FILE="/etc/qwen-code-env.sh"
else
ENV_FILE="/etc/profile.d/qwen-code.sh" ENV_FILE="/etc/profile.d/qwen-code.sh"
fi
# Cross-platform sed -i (macOS BSD sed requires -i '' while GNU sed uses -i)
sedi() {
if $IS_MACOS; then
sed -i '' "$@"
else
sed -i "$@"
fi
}
GREEN="\033[92m" GREEN="\033[92m"
RED="\033[91m" RED="\033[91m"
@@ -211,23 +228,55 @@ info "Setting environment variables..."
API_KEY=$(python3 -c "import json; print(json.load(open('$INSTALL_DIR/qwen_config.json'))['api_key'])") API_KEY=$(python3 -c "import json; print(json.load(open('$INSTALL_DIR/qwen_config.json'))['api_key'])")
BASE_URL=$(python3 -c "import json; print(json.load(open('$INSTALL_DIR/qwen_config.json'))['base_url'])") BASE_URL=$(python3 -c "import json; print(json.load(open('$INSTALL_DIR/qwen_config.json'))['base_url'])")
if $IS_MACOS; then
# macOS: no /etc/environment, no /etc/profile.d
launchctl setenv QWEN_API_KEY "$API_KEY" 2>/dev/null || true
launchctl setenv QWEN_BASE_URL "$BASE_URL" 2>/dev/null || true
log "Env vars set via launchctl"
cat > "$ENV_FILE" << ENVEOF
export QWEN_API_KEY="$API_KEY"
export QWEN_BASE_URL="$BASE_URL"
ENVEOF
chmod 644 "$ENV_FILE"
log "Env file: $ENV_FILE"
# Add source to user shell rc files
REAL_HOME="$HOME"
if [ -n "${SUDO_USER:-}" ] && [ "$SUDO_USER" != "root" ]; then
REAL_HOME=$(eval echo "~$SUDO_USER")
fi
for rc_file in "$REAL_HOME/.zshrc" "$REAL_HOME/.bashrc"; do
if [ -f "$rc_file" ] || [ "$rc_file" = "$REAL_HOME/.zshrc" ]; then
if [ -f "$rc_file" ]; then
sedi '/# Qwen env/d' "$rc_file"
sedi '/qwen-code-env\.sh/d' "$rc_file"
fi
echo "[ -f $ENV_FILE ] && . $ENV_FILE # Qwen env" >> "$rc_file"
log "Added source to $rc_file"
fi
done
else
# Linux: /etc/environment for all users
ETC_ENV="/etc/environment" ETC_ENV="/etc/environment"
for kv in "QWEN_API_KEY=\"$API_KEY\"" "QWEN_BASE_URL=\"$BASE_URL\""; do for kv in "QWEN_API_KEY=\"$API_KEY\"" "QWEN_BASE_URL=\"$BASE_URL\""; do
KEY="${kv%%=*}" KEY="${kv%%=*}"
if grep -q "^${KEY}=" "$ETC_ENV" 2>/dev/null; then if grep -q "^${KEY}=" "$ETC_ENV" 2>/dev/null; then
sed -i "s|^${KEY}=.*|${kv}|" "$ETC_ENV" sedi "s|^${KEY}=.*|${kv}|" "$ETC_ENV"
else else
echo "$kv" >> "$ETC_ENV" echo "$kv" >> "$ETC_ENV"
fi fi
done done
log "Env vars written to $ETC_ENV" log "Env vars written to $ETC_ENV"
mkdir -p /etc/profile.d
cat > "$ENV_FILE" << PROF_EOF cat > "$ENV_FILE" << PROF_EOF
export QWEN_API_KEY="$API_KEY" export QWEN_API_KEY="$API_KEY"
export QWEN_BASE_URL="$BASE_URL" export QWEN_BASE_URL="$BASE_URL"
PROF_EOF PROF_EOF
chmod 644 "$ENV_FILE" chmod 644 "$ENV_FILE"
log "Env file: $ENV_FILE" log "Env file: $ENV_FILE"
fi
# ---- Create wrapper (auto-loads env) ---- # ---- Create wrapper (auto-loads env) ----

View File

@@ -16,6 +16,24 @@ log() { echo -e "${GREEN}[+]${RESET} $*"; }
warn() { echo -e "${YELLOW}[~]${RESET} $*"; } warn() { echo -e "${YELLOW}[~]${RESET} $*"; }
info() { echo -e "${CYAN}[i]${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 -e "${BOLD}"
echo " +--------------------------------------+" echo " +--------------------------------------+"
echo " | Qwen Code — Uninstaller |" echo " | Qwen Code — Uninstaller |"
@@ -34,7 +52,7 @@ fi
# ---- Remove settings ---- # ---- Remove settings ----
for user_home in /root /home/*; do for user_home in /root $SCAN_DIRS/*; do
QWEN_DIR="$user_home/.qwen" QWEN_DIR="$user_home/.qwen"
if [ -d "$QWEN_DIR" ]; then if [ -d "$QWEN_DIR" ]; then
info "Removing $QWEN_DIR..." info "Removing $QWEN_DIR..."
@@ -45,32 +63,44 @@ done
# ---- Remove env vars from shell rc files ---- # ---- Remove env vars from shell rc files ----
for user_home in /root /home/*; do for user_home in /root $SCAN_DIRS/*; do
for rc_file in "$user_home/.bashrc" "$user_home/.zshrc"; do for rc_file in "$user_home/.bashrc" "$user_home/.zshrc"; do
if [ -f "$rc_file" ] && grep -q 'QWEN_API_KEY\|QWEN_BASE_URL\|Qwen Code' "$rc_file" 2>/dev/null; then if [ -f "$rc_file" ] && grep -q 'QWEN_API_KEY\|QWEN_BASE_URL\|Qwen Code\|Qwen env\|qwen-code-env' "$rc_file" 2>/dev/null; then
info "Cleaning env vars from $rc_file..." info "Cleaning env vars from $rc_file..."
sed -i '/# Qwen Code/d' "$rc_file" sedi '/# Qwen Code/d' "$rc_file"
sed -i '/QWEN_API_KEY/d' "$rc_file" sedi '/# Qwen env/d' "$rc_file"
sed -i '/QWEN_BASE_URL/d' "$rc_file" sedi '/qwen-code-env\.sh/d' "$rc_file"
sedi '/QWEN_API_KEY/d' "$rc_file"
sedi '/QWEN_BASE_URL/d' "$rc_file"
log "Cleaned $rc_file" log "Cleaned $rc_file"
fi fi
done done
done done
# ---- Remove /etc/profile.d script ---- # ---- Remove env files ----
if [ -f "/etc/profile.d/qwen-code.sh" ]; then for env_file in "/etc/profile.d/qwen-code.sh" "/etc/qwen-code-env.sh"; do
info "Removing /etc/profile.d/qwen-code.sh..." if [ -f "$env_file" ]; then
rm -f "/etc/profile.d/qwen-code.sh" info "Removing $env_file..."
log "Removed /etc/profile.d/qwen-code.sh" rm -f "$env_file"
log "Removed $env_file"
fi
done
# ---- Remove launchctl env vars (macOS) ----
if $IS_MACOS; then
launchctl unsetenv QWEN_API_KEY 2>/dev/null || true
launchctl unsetenv QWEN_BASE_URL 2>/dev/null || true
log "launchctl env vars cleared"
fi fi
# ---- Remove env vars from /etc/environment ---- # ---- Remove env vars from /etc/environment (Linux) ----
if [ -f "/etc/environment" ] && grep -q 'QWEN_API_KEY\|QWEN_BASE_URL' /etc/environment 2>/dev/null; then if [ -f "/etc/environment" ] && grep -q 'QWEN_API_KEY\|QWEN_BASE_URL' /etc/environment 2>/dev/null; then
info "Cleaning /etc/environment..." info "Cleaning /etc/environment..."
sed -i '/QWEN_API_KEY/d' /etc/environment sedi '/QWEN_API_KEY/d' /etc/environment
sed -i '/QWEN_BASE_URL/d' /etc/environment sedi '/QWEN_BASE_URL/d' /etc/environment
log "Cleaned /etc/environment" log "Cleaned /etc/environment"
fi fi

View File

@@ -12,7 +12,23 @@ NPM_SCOPE="@qwen-code"
NPM_PACKAGE="@qwen-code/qwen-code" NPM_PACKAGE="@qwen-code/qwen-code"
REPO_RAW="https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/qwen" REPO_RAW="https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/qwen"
OS="$(uname -s)"
IS_MACOS=false
[ "$OS" = "Darwin" ] && IS_MACOS=true
if $IS_MACOS; then
ENV_FILE="/etc/qwen-code-env.sh"
else
ENV_FILE="/etc/profile.d/qwen-code.sh" ENV_FILE="/etc/profile.d/qwen-code.sh"
fi
sedi() {
if $IS_MACOS; then
sed -i '' "$@"
else
sed -i "$@"
fi
}
GREEN="\033[92m" GREEN="\033[92m"
CYAN="\033[96m" CYAN="\033[96m"
@@ -133,21 +149,47 @@ fi
API_KEY=$(python3 -c "import json; print(json.load(open('$TEMP_DIR/qwen_config.json'))['api_key'])") API_KEY=$(python3 -c "import json; print(json.load(open('$TEMP_DIR/qwen_config.json'))['api_key'])")
BASE_URL=$(python3 -c "import json; print(json.load(open('$TEMP_DIR/qwen_config.json'))['base_url'])") BASE_URL=$(python3 -c "import json; print(json.load(open('$TEMP_DIR/qwen_config.json'))['base_url'])")
if $IS_MACOS; then
launchctl setenv QWEN_API_KEY "$API_KEY" 2>/dev/null || true
launchctl setenv QWEN_BASE_URL "$BASE_URL" 2>/dev/null || true
cat > "$ENV_FILE" << ENVEOF
export QWEN_API_KEY="$API_KEY"
export QWEN_BASE_URL="$BASE_URL"
ENVEOF
chmod 644 "$ENV_FILE"
REAL_HOME="$HOME"
if [ -n "${SUDO_USER:-}" ] && [ "$SUDO_USER" != "root" ]; then
REAL_HOME=$(eval echo "~$SUDO_USER")
fi
for rc_file in "$REAL_HOME/.zshrc" "$REAL_HOME/.bashrc"; do
if [ -f "$rc_file" ] || [ "$rc_file" = "$REAL_HOME/.zshrc" ]; then
if [ -f "$rc_file" ]; then
sedi '/# Qwen env/d' "$rc_file"
sedi '/qwen-code-env\.sh/d' "$rc_file"
fi
echo "[ -f $ENV_FILE ] && . $ENV_FILE # Qwen env" >> "$rc_file"
fi
done
else
ETC_ENV="/etc/environment" ETC_ENV="/etc/environment"
for kv in "QWEN_API_KEY=\"$API_KEY\"" "QWEN_BASE_URL=\"$BASE_URL\""; do for kv in "QWEN_API_KEY=\"$API_KEY\"" "QWEN_BASE_URL=\"$BASE_URL\""; do
KEY="${kv%%=*}" KEY="${kv%%=*}"
if grep -q "^${KEY}=" "$ETC_ENV" 2>/dev/null; then if grep -q "^${KEY}=" "$ETC_ENV" 2>/dev/null; then
sed -i "s|^${KEY}=.*|${kv}|" "$ETC_ENV" sedi "s|^${KEY}=.*|${kv}|" "$ETC_ENV"
else else
echo "$kv" >> "$ETC_ENV" echo "$kv" >> "$ETC_ENV"
fi fi
done done
mkdir -p /etc/profile.d
cat > "$ENV_FILE" << PROF_EOF cat > "$ENV_FILE" << PROF_EOF
export QWEN_API_KEY="$API_KEY" export QWEN_API_KEY="$API_KEY"
export QWEN_BASE_URL="$BASE_URL" export QWEN_BASE_URL="$BASE_URL"
PROF_EOF PROF_EOF
chmod 644 "$ENV_FILE" chmod 644 "$ENV_FILE"
fi
# ---- Create wrapper (auto-loads env) ---- # ---- Create wrapper (auto-loads env) ----