@bergetai/opencode-authBerget 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"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@bergetai/opencode-auth@1.0.24"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D @bergetai/opencode-authopencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
README.md
查看原始文件→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:
- Run
/connectin OpenCode - Select "Login with Berget"
- Authenticate in browser — token refresh is automatic
API Key
For API key users:
- Run
/connectin OpenCode - Select "Enter Berget API Key manually"
- 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