OpenCode plugin for Atomic Chat: auto-detection of the local OpenAI-compatible API (default http://127.0.0.1:1337/v1), dynamic model discovery via GET /v1/models.
npm install opencode-atomic-chat{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-atomic-chat@latest"],
"provider": {
"atomic-chat": {
"npm": "@ai-sdk/openai-compatible",
"name": "Atomic Chat (local)",
"options": {
"baseURL": "http://127.0.0.1:1337/v1"
}
}
}
}If the atomic-chat provider is omitted but Atomic Chat responds on port 1337 (or 1338), the plugin can create the provider block for you. Model ids must match those returned by GET /v1/models (see OpenCode docs — Atomic Chat).
Repository: github.com/yanalialiuk/opencode-atomic-chat.
git clone https://github.com/yanalialiuk/opencode-atomic-chat.git
cd opencode-atomic-chat
npm install
npm run buildIf Git reports that an untracked package-lock.json would be overwritten by merge, remove or move it, then pull and reinstall (the lockfile is tracked in this repo):
rm -f package-lock.json
git pull
npm install
npm run build- Install the OpenCode CLI if needed: Install (
curl -fsSL https://opencode.ai/install | bashorbrew install anomalyco/tap/opencode). - Start Atomic Chat so the API is up at
http://127.0.0.1:1337/v1and load a model. - From the root of this repository (where
package.jsonandopencode.jsonlive):
cd /path/to/opencode-atomic-chat
opencodeThis repo includes an opencode.json that loads the plugin via "plugin": ["./"] (path plugin: the current directory is the npm package). On startup you should see a log line like [opencode-atomic-chat] Atomic Chat plugin initialized.
Another project: in that project’s opencode.json use an absolute path, for example:
"plugin": ["file:///Users/you/dev/opencode-atomic-chat"](Relative paths like ./../opencode-atomic-chat also work if your shell’s current directory when launching OpenCode matches how the path resolves.)
Unscoped package opencode-atomic-chat is public by default on first npm publish. No publishConfig is required unless you later rename the package to a scoped name (@your-scope/...); then add "publishConfig": { "access": "public" }.
- Create an npm account and enable 2FA (recommended).
- Log in locally:
npm login(ornpm login --auth-type=web). - From the repo root, with a clean tree and tests passing:
npm install
npm publishprepublishOnly runs npm run build (typecheck + tests) automatically before publish.
- After the first release, bump version for updates:
npm version patch(orminor/major), thengit push --follow-tagsandnpm publish.
Package contents are controlled by the "files" field (src, README.md, LICENSE).
MIT