Skip to content

yanalialiuk/opencode-atomic-chat

Repository files navigation

opencode-atomic-chat

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.

Install

npm install opencode-atomic-chat

opencode.json

{
  "$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).

Development

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 build

git pull fails: untracked package-lock.json

If 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

Run OpenCode with this plugin (local smoke test)

  1. Install the OpenCode CLI if needed: Install (curl -fsSL https://opencode.ai/install | bash or brew install anomalyco/tap/opencode).
  2. Start Atomic Chat so the API is up at http://127.0.0.1:1337/v1 and load a model.
  3. From the root of this repository (where package.json and opencode.json live):
cd /path/to/opencode-atomic-chat
opencode

This 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.)

Publish to npm (public)

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" }.

  1. Create an npm account and enable 2FA (recommended).
  2. Log in locally: npm login (or npm login --auth-type=web).
  3. From the repo root, with a clean tree and tests passing:
npm install
npm publish

prepublishOnly runs npm run build (typecheck + tests) automatically before publish.

  1. After the first release, bump version for updates: npm version patch (or minor / major), then git push --follow-tags and npm publish.

Package contents are controlled by the "files" field (src, README.md, LICENSE).

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors