5.2 KiB
Executable File
5.2 KiB
Executable File
Gemini CLI — Patched
Patched Gemini CLI for use with custom API endpoints. Latest: v0.35.0 (13 patches).
npm Install (Recommended)
Step 1 — Install patched CLI:
Linux / macOS:
npm config set @google:registry https://npm.sensey24.ru/
npm install -g @google/gemini-cli
Windows (PowerShell):
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.
Step 2 — Configure settings and environment:
The npm package includes all 13 patches baked in (proxy URLs, model defaults, UI, compression). You still need to configure auth and env vars:
Linux / macOS:
# Set environment variables
echo 'export GEMINI_API_KEY="ClauderAPI"' >> ~/.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"
}
},
"telemetry": {
"enabled": false,
"logPrompts": false
}
}
EOF
Windows (PowerShell):
# Set environment variables
[System.Environment]::SetEnvironmentVariable("GEMINI_API_KEY", "ClauderAPI", "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
Step 3 — Verify:
gemini -p "Hello"
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 |
| 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)
curl -fsSL https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/gemini/ugemini_install.sh | sudo bash
This will:
- Check prerequisites (Node.js >= 20, Python3)
- Install
@google/gemini-cliif not present - Download and apply 13 patches
- Configure auth and env vars
- Verify with a test prompt
Manual Install
# 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 |
|---|---|---|
| 1 | gemini_base_url |
Route API through proxy |
| 2 | vertex_base_url_regional |
Route Vertex AI (regional) through proxy |
| 3 | vertex_base_url_global |
Route Vertex AI (global) through proxy |
| 4 | sanitize_env_url |
Allow URLs in .env files |
| 5 | auth_env_whitelist |
Allow proxy URL in sandbox |
| 6 | user_settings |
Set API key auth, disable telemetry |
| 7 | auto_update_registry |
Redirect npm registry to proxy |
| 8 | auto_update_commands |
Add --registry to update commands |
| 9 | auto_permissions |
Allow YOLO mode from settings |
| 10 | default_models |
Override default model constants to 3.x |
| 11 | model_dialog_desc |
Fix model names in UI picker |
| 12 | compression_aliases |
Fix compression config aliases |
| 13 | agent_config_desc |
Fix example model in agent config |
Available Models
gemini-3.1-pro-preview— Main production model (default)gemini-3.1-pro-high— High quality variantgemini-3.1-pro-low— Fast variantgemini-3-pro-preview— Gemini 3.0 Progemini-3-flash-preview— Fast modelgemini-2.5-pro— Legacy (still available)gemini-2.5-flash— Legacy fast
Troubleshooting
"GEMINI_API_KEY not set"
export GEMINI_API_KEY="ClauderAPI"
export GOOGLE_GEMINI_BASE_URL="https://ai.37-187-136-86.sslip.io"
"IneligibleTierError" Settings still using OAuth. Re-run patcher:
python3 gemini_patcher.py --settings-only
Rollback
sudo python3 gemini_patcher.py --rollback
Files
| File | Purpose |
|---|---|
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 |
releases/index.json |
Version index |