镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

About

Allow using Berget AI with OpenCode v2.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

opencode-berget-v2

Berget AI login for OpenCode v2.

Warning

Stopgap until Berget ships a v2 plugin. Not maintained long-term. Rely on it at your own risk.

Why

@bergetai/opencode-auth targets the v1 plugin API and fails to load on v2:

Plugin must export a default definition with an id and an effect or setup function.

OpenCode v2 has the berget provider, its models and API key login built in. OAuth login is missing.

Install

opencode plugin add github:varvet/opencode-berget-v2

Then /connect in OpenCode, or opencode auth login berget.

Append #<sha> to pin a commit.

How it works

index.ts calls the v1 plugin and registers its two OAuth methods (browser, device/QR) with v2. v1 does the login. The adapter converts the result to a v2 credential.

Token refresh is reimplemented because v1 doesn't export it. It is a single POST to /v1/auth/refresh, with none of v1's retries.

Development

Clone, bun install, and add the path to ~/.config/opencode/opencode.json:

{ "plugins": ["/path/to/opencode-berget-v2"] }

OpenCode hot-reloads when index.ts changes.

bun run typecheck

@opencode/plugin must match opencode --version.

About

Allow using Berget AI with OpenCode v2.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages