Подключение OpenCode к vibecode.moe

Установка и подключение Claude Code, Codex CLI, OpenCode или любого OpenAI/Anthropic-совместимого SDK.

Одна команда — ставит CLI + пишет ~/.config/opencode/opencode.json с тремя провайдерами (Claude, GPT и Gemini + Grok) на один ключ. Нужен Node.js 18+.

OpenCode

Open-source CLI-агент. Установка через npm.

Открой Windows PowerShell и вставь:

irm https://vibecode.moe/i/opencode.ps1?lang=ru | iex
curl -fsSL "https://vibecode.moe/i/opencode.sh?lang=ru" | bash
curl -fsSL "https://vibecode.moe/i/opencode.sh?lang=ru" | bash

Запуск: opencode

Три провайдера на один ключ — отдельные SDK-адаптеры под Claude, GPT и Gemini + Grok.

OpenCode

1

Уже установлен?

opencode --version

Версия — пропускай следующий шаг.

2

Установка CLI

npm install -g opencode-ai
3

opencode.json

Linux / macOS: ~/.config/opencode/opencode.json · Windows: %USERPROFILE%\.config\opencode\opencode.json

{
  "$schema": "https://opencode.ai/config.json",
  "model": "vibecode/gpt-6-astra",
  "small_model": "vibecode-claude/claude-haiku-4-5",
  "provider": {
    "vibecode": {
      "npm": "@ai-sdk/openai",
      "name": "vibecode.moe — GPT",
      "options": {
        "baseURL": "https://vibecode.moe/v1",
        "apiKey": "vk-YOUR-KEY"
      },
      "models": {
        "gpt-6-astra":           { "name": "GPT 6 Astra", "limit": { "context": 1000000, "output": 128000 }, "attachment": true, "modalities": { "input": ["text", "image"], "output": ["text"] } },
        "gpt-6-sol":             { "name": "GPT 6 Sol", "limit": { "context": 1000000, "output": 128000 }, "attachment": true, "modalities": { "input": ["text", "image"], "output": ["text"] } },
        "gpt-6.1-sol":           { "name": "GPT 6.1 Sol", "limit": { "context": 1000000, "output": 128000 }, "attachment": true, "modalities": { "input": ["text", "image"], "output": ["text"] } },
        "gpt-6-luna":            { "name": "GPT 6 Luna", "limit": { "context": 1000000, "output": 128000 }, "attachment": true, "modalities": { "input": ["text", "image"], "output": ["text"] } },
        "gpt-5.6-sol":           { "name": "GPT 5.6 Sol", "limit": { "context": 1000000, "output": 128000 }, "attachment": true, "modalities": { "input": ["text", "image"], "output": ["text"] } },
        "gpt-5.6-luna":          { "name": "GPT 5.6 Luna", "limit": { "context": 1000000, "output": 128000 }, "attachment": true, "modalities": { "input": ["text", "image"], "output": ["text"] } },
        "codex-auto-review":     { "name": "Codex Auto Review", "limit": { "context": 1000000, "output": 128000 }, "attachment": true, "modalities": { "input": ["text", "image"], "output": ["text"] } }
      }
    },
    "vibecode-gemini": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "vibecode.moe — Gemini + Grok + DeepSeek + GLM",
      "options": {
        "baseURL": "https://vibecode.moe/v1",
        "apiKey": "vk-YOUR-KEY"
      },
      "models": {
        "gemini-3-flash-preview":   { "name": "Gemini 3 Flash", "limit": { "context": 1000000, "output": 65536 }, "attachment": true, "modalities": { "input": ["text", "image"], "output": ["text"] } },
        "gemini-3.8-flash":         { "name": "Gemini 3.8 Flash", "limit": { "context": 1000000, "output": 65536 }, "attachment": true, "modalities": { "input": ["text", "image"], "output": ["text"] } },
        "gemini-3.1-pro-preview":   { "name": "Gemini 3.1 Pro", "limit": { "context": 1000000, "output": 65536 }, "attachment": true, "modalities": { "input": ["text", "image"], "output": ["text"] } },
        "gemini-4-argon":           { "name": "Gemini 4 Argon", "limit": { "context": 1000000, "output": 65536 }, "attachment": true, "modalities": { "input": ["text", "image"], "output": ["text"] } },
        "grok-4-5":                 { "name": "Grok 4.5", "limit": { "context": 256000, "output": 32000 }, "modalities": { "input": ["text"], "output": ["text"] } },
        "grok-4-6":                 { "name": "Grok 4.6", "limit": { "context": 256000, "output": 32000 }, "attachment": true, "modalities": { "input": ["text", "image"], "output": ["text"] } },
"grok-4-7":                 { "name": "Grok 4.7", "limit": { "context": 256000, "output": 32000 }, "attachment": true, "modalities": { "input": ["text", "image"], "output": ["text"] } },
        "deepseek-v4-pro":          { "name": "DeepSeek V4 Pro", "limit": { "context": 600000, "output": 32000 }, "modalities": { "input": ["text"], "output": ["text"] } },
        "deepseek-flash":           { "name": "DeepSeek Flash", "limit": { "context": 600000, "output": 32000 }, "attachment": true, "modalities": { "input": ["text", "image"], "output": ["text"] } },
        "glm-5.3-flash":            { "name": "GLM 5.3 Flash", "limit": { "context": 800000, "output": 32000 }, "modalities": { "input": ["text"], "output": ["text"] } },
        "glm-5.3-flashx":           { "name": "GLM 5.3 FlashX", "limit": { "context": 800000, "output": 32000 }, "modalities": { "input": ["text"], "output": ["text"] } }
      }
    },
    "vibecode-claude": {
      "npm": "@ai-sdk/anthropic",
      "name": "vibecode.moe — Claude",
      "options": {
        "baseURL": "https://vibecode.moe/v1",
        "apiKey": "vk-YOUR-KEY"
      },
      "models": {
        "claude-fable-5-1":   { "name": "Claude Fable 5.1", "limit": { "context": 1000000, "output": 64000 }, "attachment": true, "modalities": { "input": ["text", "image"], "output": ["text"] } },
        "claude-fable-5":     { "name": "Claude Fable 5", "limit": { "context": 1000000, "output": 64000 }, "attachment": true, "modalities": { "input": ["text", "image"], "output": ["text"] } },
        "claude-haiku-4-5":   { "name": "Claude Haiku 4.5", "limit": { "context": 200000, "output": 64000 }, "attachment": true, "modalities": { "input": ["text", "image"], "output": ["text"] } },
        "claude-haiku-5-5":   { "name": "Claude Haiku 5.5", "limit": { "context": 200000, "output": 64000 }, "attachment": true, "modalities": { "input": ["text", "image"], "output": ["text"] } },
        "claude-sonnet-4-6":  { "name": "Claude Sonnet 4.6", "limit": { "context": 1000000, "output": 64000 }, "attachment": true, "modalities": { "input": ["text", "image"], "output": ["text"] } },
        "claude-sonnet-5":    { "name": "Claude Sonnet 5", "limit": { "context": 1000000, "output": 64000 }, "attachment": true, "modalities": { "input": ["text", "image"], "output": ["text"] } },
        "claude-opus-4-7":    { "name": "Claude Opus 4.7", "limit": { "context": 1000000, "output": 64000 }, "attachment": true, "modalities": { "input": ["text", "image"], "output": ["text"] } },
        "claude-opus-4-8":    { "name": "Claude Opus 4.8", "limit": { "context": 1000000, "output": 64000 }, "attachment": true, "modalities": { "input": ["text", "image"], "output": ["text"] } },
        "claude-opus-5":      { "name": "Claude Opus 5", "limit": { "context": 1000000, "output": 64000 }, "attachment": true, "modalities": { "input": ["text", "image"], "output": ["text"] } },
        "claude-opus-5-5":    { "name": "Claude Opus 5.5", "limit": { "context": 1000000, "output": 64000 }, "attachment": true, "modalities": { "input": ["text", "image"], "output": ["text"] } }
      }
    }
  }
}

Три блока — три SDK-адаптера (Claude, GPT, Gemini + Grok + DeepSeek), ключ один на всех. Меняй в них только apiKey. limit не убирай: context — окно модели, output — потолок ответа; по ним OpenCode считает, сколько контекста осталось. Без limit он считает окно равным нулю и автосжатие истории просто не срабатывает.

4

Запуск

opencode

Выбирай модель: vibecode/gpt-6-astra или vibecode/gpt-6-sol — GPT; vibecode-gemini/gemini-3.8-flash — Gemini; vibecode-gemini/grok-4-7 — Grok; vibecode-claude/claude-fable-5-1, vibecode-claude/claude-sonnet-4-6 и т. д. — Claude. Лишние провайдеры можно убрать.