Thanks for your interest! This project is small, scoped, and aims to stay that way — so please read this short guide before opening a PR.
- Tiny surface area. The plugin does one thing: discover LiteLLM models and feed them to OpenCode. Features that drift from that focus belong in a sibling plugin, not in this one.
- Small runtime surface. The package supports both
@opencode-ai/plugin(V1) and@opencode/plugin(V2). Adding other runtime dependencies requires a strong justification. - Strict TypeScript. No
anyin public APIs. Internalanyis acceptable only when the OpenCodeconfigtype is genuinely opaque to us. - Non-blocking by default. Anything that talks to the network must be wrapped in a timeout and must never throw out of the plugin lifecycle.
Requires Node.js ≥ 20 (or Bun ≥ 1.0).
git clone https://github.com/yuseferi/opencode-litellm.git
cd opencode-litellm
npm install
npm run typecheck
npm test# In the plugin repo
npm link
# In your OpenCode workspace
npm link opencode-plugin-litellm
# add it to opencode.json's `plugins` list, then:
opencodePlugin logs are prefixed with [opencode-litellm]. V1 logs appear under ~/.local/share/opencode/log/; V2 logs use the plugin host's console logging.
-
npm run typecheckpasses locally -
npm testpasses locally; behavior changes come with test updates - No new runtime dependencies (or strong justification in the PR description)
- Public API changes are reflected in the README
- User-visible changes are added to
CHANGELOG.mdunder## [Unreleased] - Commit messages follow Conventional Commits (
feat:,fix:,docs:,chore:, etc.)
Please use the bug-report issue template and include:
- LiteLLM version (
litellm --version) - OpenCode version
- Node.js / Bun version & OS
- Relevant
[opencode-litellm]log lines - A minimal
opencode.json/litellm config.yamlthat reproduces the issue
Releases are fully automated using semantic-release on every push/merge to the main branch.
- Ensure your commits follow Conventional Commits.
- When a PR is merged to
main, thePublish to npmworkflow (release.yml) will:- Analyze your commit messages to determine the next version bump (major/minor/patch).
- Generate release notes and prepend them to
CHANGELOG.md. - Bump the version in
package.jsonandpackage-lock.json. - Push the updated files back to the repository.
- Create a corresponding git tag and GitHub Release.
- Publish the package to npm using OIDC Trusted Publishing (no secrets required!).
Be kind. Assume good intent. We follow the Contributor Covenant.