Skip to content

Latest commit

 

History

History
174 lines (116 loc) · 4.34 KB

README-template.md

File metadata and controls

174 lines (116 loc) · 4.34 KB

opencode-

One-liner describing the plugin

npm version npm downloads opencode license


Why?

[Why this plugin exists and what it achieves...]

Philosophy: Extending OpenCode

OpenCode is designed to be highly extensible. This plugin [...].

Architecture

[KEEP DIAGRAM SIMPLE]
Loading

[Brief elaboration...]

Features

  • [Feature 1]: ...
  • [Feature 2]: ...
  • [Feature 3]: ...

Install

Some plugins will be special cases where one component (Server / TUI) is not required and only adds/enables specific features. As such, they may not strictly adhere to the cases below.

OpenCode V2

Requires OpenCode <2.x.y> or later. [Use the lowest version the package's @opencode/plugin peer range allows.]

<server|TUI> This plugin has only a [Server|TUI] component.

Add it under the "plugins" key in [opencode.json(c)|cli.json]:

{
  "plugins": ["@capybearista/opencode-<plugin-name>@latest"]
}

Important

This plugin is [TUI|Server]-only, so it belongs in [cli.json|opencode.json(c)]. </server|TUI>

<server+TUI> This plugin has a Server component + TUI component.

Add one entry under the "plugins" key in opencode.json(c):

{
  "plugins": ["@capybearista/opencode-<plugin-name>@latest"]
}

The TUI half loads automatically, so cli.json needs no entry. </server+TUI>

OpenCode V1

<server|TUI> This plugin has only a [Server|TUI] component.

Add it under the "plugin" key in [opencode.json(c)|tui.json(c)]:

{
  "plugin": ["@capybearista/opencode-<plugin-name>@1.x.x"]
}

[TUI|Server] entry only, so [tui.json(c)|opencode.json(c)] needs no entry. </server|TUI>

<server+TUI> This plugin has a Server component + TUI component.

Add it under the "plugin" key in opencode.json(c):

{
  "plugin": ["@capybearista/opencode-<plugin-name>@1.x.x"]
}

AND

Add it under the "plugin" key in tui.json(c):

{
  "plugin": ["@capybearista/opencode-<plugin-name>@1.x.x"]
}

</server+TUI>

See the V1 plugin guide for details.

Uninstall

Remove the plugin from "plugin(s)" from the respective config files they were added to. [extra instructions if the plugin creates other artifacts on disk]

Usage

[...]

Configuration

[...]

Pass options in the plugin's entry, using the object form:
{
  "plugins": [
    {
      "package": "@capybearista/opencode-<plugin-name>@latest",
      "options": { "<option>": "<value>" }
    }
  ]
}

Warning

Use the object form above. The V1 tuple form (["@capybearista/opencode-<plugin-name>", { ... }]) is not valid in V2, and in cli.json one invalid entry makes OpenCode ignore the whole file, including your theme, keybinds, and every other plugin.

Option Type Default Description
<option> <type> <default> [...]
</V2 options>

Category 1

...

Category 2

...

Troubleshooting

  • [...]

[Keep the README for users. Internals, verification notes and test details go in the package's AGENTS.md or docs/<plugin-name>/.]

Contributing

This package lives in the opencode-plugins monorepo. See the contribution guidelines for setup, the full check suite, and releases, and open or find an issue before a pull request.

From this directory, bun test runs the package tests[ and bun run smoke checks the built package]. To try a change in your own OpenCode, see Testing in OpenCode.

License

MPL-2.0