Authenticate OpenCode with your Berget AI account.
The recommended way to get started is with the Berget CLI:
npm install -g berget
berget code init
opencode
# Type /connect → choose your auth methodFor team members with a Berget Code seat, on machines with a browser:
- Run
/connectin OpenCode - Select "Berget Code Seat - Login using this device"
- The login page opens in your browser — token refresh is automatic
For headless environments (SSH, CI, containers) where the browser cannot open on the same machine:
- Run
/connectin OpenCode - Select "Berget Code Seat - QR or device code"
- Scan the QR code with your phone, or open the link shown in the dialog — the sign-in code is already included in it
- Approve the sign-in on the other device; OpenCode continues automatically
The sign-in is valid for 10 minutes. If it times out, just run /connect again.
For API key users:
- Run
/connectin OpenCode - Select "Berget API Key - Enter API key manually"
- Paste your key — persisted across sessions
- PKCE Authorization Flow for browser login (magic link)
- Device Authorization Grant (RFC 8628) for QR / device code login on headless machines
- Automatic token refresh via custom fetch — sessions stay alive indefinitely
- Models fetched dynamically from Berget API — no manual config needed
MIT