opencode-kambacoder
v0.5.0
Published
OpenCode plugin: login with email/password to Kambacoder and route AI chat through the Kambacoder proxy
Readme
opencode-kambacoder
OpenCode plugin that enables login with email and password on the Kambacoder server
(kambacoder_admin) and routes all chat requests through that server's AI proxy,
instead of going directly to the AI provider.
Does not modify OpenCode's code — it's an external plugin package, compatible with any official OpenCode installation.
Installation
One-liner (recommended)
Windows (PowerShell):
irm https://kambacoder.com/install.ps1 | iexLinux and macOS:
curl -fsSL https://kambacoder.com/install.sh | shInstalls OpenCode itself (if it isn't already installed) plus this plugin, without admin rights. Running it again updates the plugin. The options below are the manual equivalents, and don't install OpenCode for you.
OpenCode's config paths vary by operating system:
| | Config | Cache |
|---|---|---|
| Linux | ~/.config/opencode/ | ~/.cache/opencode/ |
| macOS | ~/.config/opencode/ | ~/.cache/opencode/ |
| Windows | %USERPROFILE%\.config\opencode\ | %USERPROFILE%\.cache\opencode\ |
(In PowerShell, $HOME is equivalent to %USERPROFILE%.)
Option A — via npm (opencode.json)
In opencode.json (project-level or global — ~/.config/opencode/opencode.json on
Linux/macOS, %USERPROFILE%\.config\opencode\opencode.json on Windows):
{
"$schema": "https://opencode.ai/config.json",
"plugin": [["opencode-kambacoder", { "serverUrl": "https://kambacoder.com" }]]
}OpenCode installs the package itself on startup (cached in ~/.cache/opencode/node_modules/
on Linux/macOS, %USERPROFILE%\.cache\opencode\node_modules\ on Windows).
Updates just require publishing a new version to npm — no need to touch OpenCode again.
If serverUrl is not set in the plugin options, it's read from KAMBACODER_SERVER_URL,
falling back to https://kambacoder.com. Set KAMBACODER_SERVER_URL to point to
another server (e.g. local development).
Option B — copy the file (without editing opencode.json)
OpenCode automatically discovers plugins placed in:
~/.config/opencode/plugin/on Linux/macOS, or%USERPROFILE%\.config\opencode\plugin\on Windows (global, all projects).opencode/plugin/(single project only, any operating system)
The compiled dist/index.js has no runtime dependencies, so it can be copied
directly into one of those folders.
Linux / macOS (bash, zsh):
mkdir -p ~/.config/opencode/plugin
curl -fsSL https://kambacoder.com/downloads/opencode-plugin/kambacoder.js \
-o ~/.config/opencode/plugin/kambacoder.jsWindows (PowerShell — curl.exe is included in Windows 10+):
mkdir -Force $HOME\.config\opencode\plugin
curl.exe -fsSL https://kambacoder.com/downloads/opencode-plugin/kambacoder.js `
-o $HOME\.config\opencode\plugin\kambacoder.jsWith this option serverUrl doesn't come from opencode.json (no options are passed), but the
plugin already has https://kambacoder.com as a built-in default — you only need to set
KAMBACODER_SERVER_URL to point to another server (e.g. local development).
Login
opencode auth loginChoose the kambacoder provider → Login com email e senha.
To avoid entering the password in plain text on the terminal at every login, you can
set the KAMBACODER_EMAIL and KAMBACODER_PASSWORD environment variables — the
corresponding prompts are skipped when they're already set.
Linux / macOS (e.g. in ~/.bashrc or ~/.zshrc):
export KAMBACODER_EMAIL="[email protected]"
export KAMBACODER_PASSWORD="..."Windows (PowerShell — $env: only applies to the current session; setx makes it
permanent for future sessions):
$env:KAMBACODER_EMAIL = "[email protected]"
$env:KAMBACODER_PASSWORD = "..."
# or, permanently:
setx KAMBACODER_EMAIL "[email protected]"
setx KAMBACODER_PASSWORD "..."Development
bun install
bun run typecheck
bun run buildTo test without publishing, place src/index.ts (or the compiled dist/index.js) in
.opencode/plugin/kambacoder.ts of a test project, or globally in
~/.config/opencode/plugin/kambacoder.ts (Linux/macOS) /
%USERPROFILE%\.config\opencode\plugin\kambacoder.ts (Windows).
Publishing to npm
npm login
npm publish --access publicRequires an npm account with permission to publish under the name opencode-kambacoder (run
manually by whoever holds the credentials — not done automatically).
