@bergetai/opencode-authBerget AI auth plugin for OpenCode - authenticate with your Berget account
1
169
29 in 7 days
35.6
Multi-signal model
17 days ago
2026-08-03
Install and configure
opencode.jsonWrites to this project's opencode.json — applies to this repository only.
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@bergetai/opencode-auth@1.0.24"]
}Writes to ~/.config/opencode/opencode.json — applies to every project.
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@bergetai/opencode-auth@1.0.24"]
}If you want to modify the plugin locally, install it into the project and reference the local path.
shell
pnpm add -D @bergetai/opencode-authopencode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.
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