Skip to content

Commit 5d90fe3

Browse files
committed
Lead the README with install and the problem it solves
1 parent c860747 commit 5d90fe3

1 file changed

Lines changed: 23 additions & 13 deletions

File tree

‎README.md‎

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,40 @@
11
# opencode-plugin-toggle
22

3-
A button in the OpenCode desktop session header that shows what is installed and lets you turn plugins on and off. Skills are listed too — clicking one inserts `@skill-id` into the prompt.
3+
[![npm](https://img.shields.io/npm/v/opencode-plugin-toggle)](https://www.npmjs.com/package/opencode-plugin-toggle)
4+
[![license](https://img.shields.io/npm/l/opencode-plugin-toggle)](LICENSE)
45

5-
![The plugin and skill switcher](docs/popover.jpg)
6+
**Turn plugins on and off from the conversation, without editing `opencode.jsonc`.** Click the puzzle icon in the session header and every plugin gets a switch.
67

7-
## What it does
8+
The app's own switch only manages a plugin's desktop UI. Server-side plugins — sandboxes, memory, notification hooks — have no UI, so they get no switch at all, and the only way to disable one is to add a `"-name"` entry to the config by hand. This gives them all a real switch, applied globally and hot-reloaded in about two seconds.
89

9-
- **Plugins** — one row per plugin in your global config, with a one-line description taken from the OpenDock catalog, and a switch. Turning one off appends `"-<plugin-id>"` to the `plugins` array; turning it back on removes that line. No restart: the server reloads in about a second.
10-
- Off plugins stay in the list, greyed out, so you can turn them back on without hunting for the package name.
11-
- A plugin that failed to load shows its error rather than disappearing.
12-
- **Skills** — click a row to insert `@<skill-id>` into the prompt. Skills are loaded by the agent, so the insert is a mention, not a call.
10+
![The plugin and skill switcher](docs/popover.jpg)
1311

1412
## Install
1513

1614
```sh
1715
opencode plugin add opencode-plugin-toggle
1816
```
1917

20-
Then click the puzzle icon at the right end of the session header.
18+
Click the puzzle icon at the right end of the session header.
19+
20+
## What you can do
2121

22-
## How the toggling works
22+
- **Enable / disable any plugin**, including ones with no UI of their own. Disabled plugins stay in the list, greyed out, ready to switch back on.
23+
- **See why a plugin failed** — the runtime error is shown under the name instead of a bare "failed" badge.
24+
- **Insert a skill** into the prompt box: click a skill and `@skill-id` is appended and focused, so you never mistype an id.
25+
- Each plugin shows its one-line description, taken from the OpenDock catalog.
2326

24-
OpenCode disables a package plugin when the global `plugins` array contains `"-<plugin-id>"` **after** the package entry. This plugin appends the line at the end for that reason, and removes it cleanly when re-enabled. The config file is parsed before and after every write and the change is rejected unless it matches exactly, with the previous file kept as `opencode.json*.toggle-backup`.
27+
## Requirements
2528

26-
## Limitations
29+
- OpenCode desktop 2.2 or newer.
2730

28-
- Global config only. The desktop app has no per-project plugin toggle.
29-
- Plugin-contributed skills cannot be switched off one by one; turn off the whole plugin instead.
31+
## How it works
32+
33+
- Disabling writes `"-<plugin-id>"` to the `plugins` array in your **global** config, at the end of the array — the order matters, a disabled entry placed before the package entry does not take effect. Re-enabling removes that line, leaving the rest of the file untouched, formatting and comments included.
34+
- **The switch is global, not per-session.** Plugins load once per server process, and one process serves every session, so there is no per-conversation isolation to toggle.
35+
- Disabling a plugin does not rewind what it already did in the current conversation; it stops participating from that moment. Start a new session for a clean slate.
36+
- Skills are not toggled. Clicking one inserts its id into the message; the model loads the skill when it sees `@skill-id`.
37+
- Config writes are validated before they land: the file is re-parsed and compared, and nothing is written if the result is not exactly the intended change.
3038

3139
## Development
3240

@@ -35,6 +43,8 @@ npm install
3543
npm run build # bundles the GUI into dist/gui-experimental.cjs
3644
```
3745

46+
Point `plugins` in `~/.config/opencode/opencode.jsonc` at this directory to load it from source.
47+
3848
## License
3949

4050
MIT

0 commit comments

Comments
 (0)