Skip to content
Weaveweave / docs
Get started ↗
Docs/Getting Started/Install for OpenCode 2

Install for OpenCode 2

Install Weave for OpenCode 2

This page is for OpenCode 2: the @opencode/cli package, run as opencode2. On OpenCode 1.x, follow Install for OpenCode instead: the two hosts load different plugin packages.

Add the Weave adapter to the plugins list (plural) in your opencode.jsonc or opencode.json. Use the file in your project root to enable Weave for one repository, or ~/.config/opencode/opencode.jsonc to enable it everywhere:

{
"plugins": ["@weaveio/weave-adapter-opencode2@0.2.0"]
}

Then start opencode2. That’s the whole installation.

  • OpenCode 2 downloads the plugin itself. You don’t need Bun, npm install, or the Weave CLI.
  • You don’t need a .weave config either. Without one, Weave registers its builtin agents: loom, tapestry, shuttle, pattern, thread, spindle, weft, and warp.
  • On the first start the agents can take up to a minute to appear while OpenCode 2 installs the plugin.

OpenCode 1.x and OpenCode 2 can share one opencode.json: OpenCode 1.x reads plugin, and OpenCode 2 reads plugins.

Start opencode2 in your project. New sessions start on Loom, and the agent list includes loom, tapestry, shuttle, and the other Weave agents. Type /weave:start to begin work from a plan.

Agents whose declared models your host doesn’t offer still register and use your OpenCode 2 model. See Model Resolution.

To add agents or categories, or to change a builtin’s prompt or models, create a .weave/config.weave in your project. The Weave CLI scaffolds and validates one. It runs on Bun:

Terminal window
bunx @weaveio/weave-cli@0.2.0 init --scope local --yes --harness opencode2
bunx @weaveio/weave-cli@0.2.0 validate

With --harness opencode2, weave init also adds the pinned plugins entry to the project’s opencode.jsonc, so it can replace the manual step above.

See the DSL Configuration guide for the syntax.

The adapter is published on two npm channels:

  • latest: Stable releases (recommended)
  • next: Pre-releases for trying upcoming changes
{
"plugins": ["@weaveio/weave-adapter-opencode2@next"]
}

Channel tags are mutable: OpenCode 2 can pick up a newer version from the channel when it restarts.

If the agents don’t appear, see Adapter not loading (OpenCode 2).