跳到主要内容
    ↑↓ 选择↵ 打开esc 关闭
    中文English
    berget-ai

    Auth

    v1.0.24认证与凭证
    @bergetai/opencode-auth

    Berget AI auth plugin for OpenCode - authenticate with your Berget account

    GitHub 星标

    1

    月装机量

    169

    近 7 天 29

    综合评分SCORE

    35.6

    生态多维模型

    最近提交

    17 天前

    2026-08-03

    快速安装与配置

    opencode.json

    写入当前项目的 opencode.json,只对这个仓库生效。

    opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["@bergetai/opencode-auth@1.0.24"]
    }

    opencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。

    Authenticate OpenCode with your Berget AI account.

    Quick Start

    The recommended way to get started is with the Berget CLI:

    npm install -g berget
    berget code init
    opencode
    # Type /connect → choose your auth method
    

    Authentication Methods

    Berget Code (SSO)

    For team members with a Berget Code seat:

    1. Run /connect in OpenCode
    2. Select "Login with Berget"
    3. Authenticate in browser — token refresh is automatic

    API Key

    For API key users:

    1. Run /connect in OpenCode
    2. Select "Enter Berget API Key manually"
    3. Paste your key — persisted across sessions

    How It Works

    • PKCE Authorization Flow for SSO login
    • Automatic token refresh via custom fetch — sessions stay alive indefinitely
    • Models fetched dynamically from Berget API — no manual config needed

    License

    MIT