docs: clearly separate bash vs PowerShell vs CMD setup for Gemini
Users were copying bash heredocs (cat << EOF) into PowerShell where they fail. Split into three explicit sections per shell with warning at top. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
57
README.md
57
README.md
@@ -109,21 +109,20 @@ iwr "https://git.sensey24.ru/aibot777/unlimitedcoding/raw/branch/master/claude/u
|
||||
|
||||
### Gemini CLI — Install
|
||||
|
||||
**Linux / macOS (two commands):**
|
||||
> ⚠️ Команды разделены по shell. **Не путайте bash-команды с PowerShell** —
|
||||
> `cat << EOF`, `export`, `source`, `mkdir -p` работают только в bash/zsh, в PowerShell дают ошибку.
|
||||
|
||||
> Node.js required. Install from https://nodejs.org/ if not present.
|
||||
|
||||
#### Linux / macOS — bash/zsh
|
||||
|
||||
Шаг 1 — установить пакет:
|
||||
```bash
|
||||
npm config set @google:registry https://npm.sensey24.ru/
|
||||
npm install -g @google/gemini-cli
|
||||
```
|
||||
|
||||
**Windows (PowerShell):**
|
||||
```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.
|
||||
|
||||
Then configure (Linux / macOS):
|
||||
Шаг 2 — настроить env vars и settings:
|
||||
```bash
|
||||
echo 'export GEMINI_API_KEY="ClauderAPI2"' >> ~/.bashrc
|
||||
echo 'export GOOGLE_GEMINI_BASE_URL="https://ai.37-187-136-86.sslip.io"' >> ~/.bashrc
|
||||
@@ -141,25 +140,51 @@ cat > ~/.gemini/settings.json << 'EOF'
|
||||
EOF
|
||||
```
|
||||
|
||||
Then configure (Windows — run in **PowerShell**, not CMD):
|
||||
> macOS пользователи: замените `~/.bashrc` на `~/.zshrc` (zsh — default shell в macOS).
|
||||
|
||||
#### Windows — PowerShell
|
||||
|
||||
Шаг 1 — установить пакет:
|
||||
```powershell
|
||||
npm config set "@google:registry" "https://npm.sensey24.ru/"
|
||||
npm install -g @google/gemini-cli
|
||||
```
|
||||
|
||||
Шаг 2 — настроить env vars и settings (вставьте **целиком** в 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
|
||||
$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"}}')
|
||||
Write-Host "Gemini CLI configured. Restart PowerShell to use env vars."
|
||||
```
|
||||
|
||||
Or use CMD:
|
||||
#### Windows — CMD
|
||||
|
||||
Шаг 1 — установить пакет:
|
||||
```cmd
|
||||
npm config set "@google:registry" "https://npm.sensey24.ru/"
|
||||
npm install -g @google/gemini-cli
|
||||
```
|
||||
|
||||
Шаг 2 — настроить env vars и settings:
|
||||
```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"
|
||||
if not exist "%USERPROFILE%\.gemini" mkdir "%USERPROFILE%\.gemini"
|
||||
> "%USERPROFILE%\.gemini\settings.json" echo {"security":{"auth":{"selectedType":"gemini-api-key"},"folderTrust":{"enabled":false}},"telemetry":{"enabled":false,"logPrompts":false},"general":{"defaultApprovalMode":"yolo"}}
|
||||
```
|
||||
|
||||
Verify: `gemini -p "Hello"`
|
||||
После установки — **перезапустите CMD/PowerShell** для подхвата env vars.
|
||||
|
||||
#### Verify (любая платформа)
|
||||
|
||||
```
|
||||
gemini -p "Hello"
|
||||
```
|
||||
|
||||
**Alternative — Automatic installer (installs Node.js, CLI, patches, settings):**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user