Skip to content

About

Local OpenAI-compatible bridge for Arena Direct Chat models in the OpenCode desktop app, driven through your own logged-in browser session on Windows

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Opencode Arena

A local OpenAI-compatible bridge that lets the OpenCode desktop app use Arena Direct Chat models through your own logged-in browser session on Windows. It is personal software: nothing leaves your computer except what you send through Arena in your own browser.

Overview

The bridge runs a small HTTP server on localhost (127.0.0.1:47147) that speaks the OpenAI chat completions protocol. OpenCode sends requests to it, and the bridge drives the Arena website in a real installed browser (Microsoft Edge or Google Chrome, via Playwright) using your signed-in Arena session. Your Arena login is encrypted with Windows DPAPI and stays on this computer.

Two conversation channels are supported:

  • Arena Agent (AI agent mode), through the Arena agent page.
  • Arena Max Direct Chat, driven through the page's visible controls only, including named Direct Chat models such as arena-max:gemini-3-flash.

Local DeepSeek Harness text tools run on your computer. Arena's own cloud tools (web search, browser, cloud shell and code execution, file tool, connectors) run in Arena's cloud and may be used for work that does not need your files.

Features

  • OpenAI-compatible /v1/models and /v1/chat/completions (streaming and non-streaming) on localhost only
  • Local bearer-token authentication on every /v1 route
  • Real browser session with your own Arena account; no API keys or pasted tokens
  • Saved session encrypted with Windows DPAPI
  • Local tool protocol: fenced JSON tool calls executed locally by the DeepSeek Harness agent
  • Local control panel for login and Direct Chat model selection
  • Windows installers: Install.cmd, Arena Login.cmd, Check Arena.cmd, Start Arena Bridge.cmd, Stop Arena Bridge.cmd, Uninstall.cmd
  • Offline test suite and offline self-check

Prerequisites

  • Windows 10 or 11
  • Node.js 22.19.0 or newer
  • Microsoft Edge or Google Chrome installed
  • An Arena account
  • The OpenCode desktop app

Installation

  1. Download or clone this project.
  2. Double-click Install.cmd. It installs dependencies (npm ci), runs the offline self-check, and adds the arena provider to your OpenCode config (%USERPROFILE%\.config\opencode\opencode.json). The provider uses OpenCode's {file:...} token indirection, reading the bridge token from %USERPROFILE%\.opencode-arena\bridge-token, so the token itself is never written into the OpenCode config file.
  3. Double-click Arena Login.cmd and sign in to your Arena account in the browser window. Complete any verification yourself; the bridge never clicks sign-in boxes for you.
  4. Double-click Check Arena.cmd to confirm login, encrypted session storage, and model access.
  5. Restart OpenCode if it was running.

Configuration

The bridge serves requests on http://127.0.0.1:47147/v1. The port is stored in %USERPROFILE%\.opencode-arena\bridge.json.

Optional environment variables:

Variable Meaning
OPENCODE_ARENA_HOME State directory for token, saved session and logs (default %USERPROFILE%\.opencode-arena)
DSH_PROFILE_DIR Browser profile directory used by Playwright (default %OPENCODE_ARENA_HOME%\profiles\web)
ARENA_BROWSER_TESTS Set to 1 to run the browser test group
ARENA_BROWSER_CHANNEL Browser channel for browser tests, e.g. chrome or msedge

See .env.example for a copyable template. The .env file itself is gitignored.

Usage

  1. Double-click Start Arena Bridge.cmd. Leave the window open while using OpenCode.
  2. In OpenCode, start a chat with the Arena provider. The model selector shows Arena Agent (AI agent mode) and the Arena Max Direct Chat models.
  3. Send messages as usual. Local tool requests appear as fenced JSON blocks that the bridge validates and executes locally.
  4. To stop: close the bridge window or double-click Stop Arena Bridge.cmd.
  5. To remove the provider from OpenCode: double-click Uninstall.cmd. The saved login and token are kept unless you choose to wipe them.

Development commands

npm test                                       Run the offline test suite
node tools/self-check.mjs                      Offline module and configuration checks
npm run bridge                                 Start the bridge manually
npm run benchmark                              Run the local SSE / page benchmark

Tests use Node's built-in test runner. Browser tests are opt-in:

ARENA_BROWSER_TESTS=1 ARENA_BROWSER_CHANNEL=chrome node --test test/*.test.mjs

Security

  • The bridge binds to 127.0.0.1 only and rejects requests without the local bearer token.
  • Prompts, tokens and replies are not logged; the activity log carries sizes only.
  • The Arena session is encrypted with Windows DPAPI under the current Windows account and never displayed.
  • The bridge never completes verification, terms or sign-in boxes for you.
  • Do not share the bridge token, saved session, or your Arena login with anyone.

License

MIT

About

Local OpenAI-compatible bridge for Arena Direct Chat models in the OpenCode desktop app, driven through your own logged-in browser session on Windows

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages