Skip to content

Commit 4ffe3d3

Browse files
authored
docs: publish from GitHub, document plugins-directory auto-discovery (v1.0.1) (#2)
- Installation now leads with the github: plugin specifier, the same distribution path as opencode-antigravity-auth. Verified end to end in an isolated HOME: OpenCode cloned the repository into its cache, loaded index.ts, and completed a model turn (loading plugin id=github:JoshRob297/opencode-commandcode, 0 failures). No npm publish, no build. - README/docs (EN and ES) document the three install paths: GitHub specifier, local clone, plugins directory. - New troubleshooting entry for the auto-discovery asymmetry: removing the config entry or renaming a directory inside ~/.config/opencode/plugins does not unload a plugin; the directory must leave plugins/, and then the watcher drops it live without a restart. Includes a verification command and the note that a duplicated commandcode_quota is harmless because the sanitizer is idempotent. - Version bumped to 1.0.1.
1 parent 27dc026 commit 4ffe3d3

8 files changed

Lines changed: 141 additions & 7 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) - SemVer.
55

66
## [Unreleased]
77

8+
## [1.0.1] - 2026-10-19
9+
10+
### Added
11+
12+
- Installation straight from GitHub with the `github:` plugin specifier, verified end to
13+
end (clone, cache, load, inference) with no npm publication and no build step.
14+
- Troubleshooting section for the plugins-directory auto-discovery asymmetry: a plugin
15+
removed from `opencode.json`, or renamed inside `~/.config/opencode/plugins/`, keeps
16+
loading until the directory leaves `plugins/` (then the watcher drops it live).
17+
18+
### Changed
19+
20+
- README and configuration docs document three installation paths: GitHub specifier
21+
(recommended), local clone, and the auto-discovered plugins directory.
22+
823
## [1.0.0] - 2026-10-18
924

1025
First modular release. Migrates the single-file `commandcode-quota` plugin into a

‎README.es.md‎

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,21 +112,40 @@ un request):
112112

113113
## Instalacion
114114

115-
Clona el repositorio y apunta OpenCode al directorio:
115+
### Opcion A: Directo desde GitHub (recomendada)
116+
117+
```jsonc
118+
// ~/.config/opencode/opencode.json
119+
{
120+
"plugins": ["github:JoshRob297/opencode-commandcode"]
121+
}
122+
```
123+
124+
OpenCode clona, cachea y ejecuta el plugin desde el repositorio. Sin publicacion en npm y
125+
sin build: el codigo fuente es TypeScript ejecutado por Bun.
126+
127+
### Opcion B: Clon local
116128

117129
```bash
118130
git clone git@github.com:JoshRob297/opencode-commandcode.git
119131
```
120132

121133
```jsonc
122-
// opencode.json
123134
{
124135
"plugins": [
125136
"/ruta/absoluta/a/opencode-commandcode"
126137
]
127138
}
128139
```
129140

141+
### Opcion C: directorio de plugins
142+
143+
OpenCode tambien auto-descubre todo directorio dentro de `~/.config/opencode/plugins/`,
144+
asi que un clon ahi se carga sin tocar `opencode.json`. La remocion no es simetrica:
145+
borrar la entrada del config o renombrar el directorio **no** lo descarga; el directorio
146+
tiene que salir de `plugins/` por completo. Ver
147+
[TROUBLESHOOTING](docs/es/troubleshooting.md#plugin-cargado-dos-veces-o-un-plugin-eliminado-sigue-corriendo).
148+
130149
Reinicia OpenCode. En el siguiente arranque se descubre el catalogo de modelos, se
131150
registran la herramienta y el comando de barra, y se enganchan los hooks.
132151

‎README.md‎

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,21 +107,40 @@ request):
107107

108108
## Installation
109109

110-
Clone the repository and point OpenCode at the directory:
110+
### Option A: Direct from GitHub (recommended)
111+
112+
```jsonc
113+
// ~/.config/opencode/opencode.json
114+
{
115+
"plugins": ["github:JoshRob297/opencode-commandcode"]
116+
}
117+
```
118+
119+
OpenCode clones, caches and runs the plugin straight from the repository. No npm
120+
publication and no build step: the source is TypeScript executed by Bun.
121+
122+
### Option B: Local clone
111123

112124
```bash
113125
git clone git@github.com:JoshRob297/opencode-commandcode.git
114126
```
115127

116128
```jsonc
117-
// opencode.json
118129
{
119130
"plugins": [
120131
"/absolute/path/to/opencode-commandcode"
121132
]
122133
}
123134
```
124135

136+
### Option C: plugins directory
137+
138+
OpenCode also auto-discovers every directory under `~/.config/opencode/plugins/`, so a
139+
clone placed there loads without touching `opencode.json`. Removal is not symmetric:
140+
deleting the config entry or renaming the directory **does not** unload it - the
141+
directory has to leave `plugins/` entirely. See
142+
[TROUBLESHOOTING](docs/TROUBLESHOOTING.md#plugin-loaded-twice-or-a-removed-plugin-still-runs).
143+
125144
Restart OpenCode. On the next start the model catalog is discovered, the toolbar
126145
tool and the slash command are registered, and the hooks are attached.
127146

‎docs/CONFIGURATION.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,13 @@ Logs are append-only and never rotated by the plugin. At the observed event rate
8888
## OpenCode integration
8989

9090
The plugin registers itself; only the provider block belongs in `opencode.json`.
91+
Install it with the GitHub specifier (no npm, no build), a local clone, or by dropping it
92+
into the auto-discovered plugins directory - see the readme for the three options.
9193

9294
```jsonc
9395
{
9496
"plugins": [
95-
"/absolute/path/to/opencode-commandcode"
97+
"github:JoshRob297/opencode-commandcode"
9698
],
9799
"providers": {
98100
"commandcode": {

‎docs/TROUBLESHOOTING.md‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,3 +177,41 @@ mkdir -p "${COMMANDCODE_STATE_DIR:-$HOME/.local/state/opencode}" && touch "$_/pr
177177

178178
An empty sanitizer log is the normal state: it only gets an entry when a payload
179179
actually needed repair.
180+
181+
## Plugin loaded twice, or a removed plugin still runs
182+
183+
OpenCode loads plugins from two places: the `plugins` array in `opencode.json` **and**
184+
every directory under `~/.config/opencode/plugins/` (auto-discovery). That asymmetry
185+
explains the two confusing cases:
186+
187+
| Symptom | Cause |
188+
| --- | --- |
189+
| A plugin removed from `plugins` is still listed by `opencode plugin list` | It lives in `~/.config/opencode/plugins/` and is picked up by the directory scan |
190+
| A plugin renamed to `.disabled` inside that directory still loads | The scan takes any subdirectory, not only `.ts` files or the old name |
191+
192+
What works and what does not:
193+
194+
```bash
195+
# does NOT unload it
196+
# - removing the entry from opencode.json
197+
# - renaming the directory inside plugins/
198+
# - rewriting opencode.json to force a reload
199+
200+
# DOES unload it (the watcher drops it live)
201+
mv ~/.config/opencode/plugins/your-plugin ~/somewhere-outside/your-plugin
202+
```
203+
204+
Verify with:
205+
206+
```bash
207+
opencode plugin list
208+
```
209+
210+
If the plugin is still listed after moving it out, the running service kept it in
211+
memory: restart the background server (`opencode service stop`) and start OpenCode
212+
again. Note that `opencode service restart` alone also works, but it drops the current
213+
TUI connection.
214+
215+
Two plugins registering `commandcode_quota` is not fatal - the sanitizer is idempotent,
216+
so a second pass returns `modified: false`, and the tool is exposed once - but it doubles
217+
the hook work and makes the telemetry confusing, so keep a single copy installed.

‎docs/es/configuration.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,13 @@ lineas por semana) no es un problema; si querés rotacion, apunta
8888
## Integracion con OpenCode
8989

9090
El plugin se registra solo; en `opencode.json` unicamente va el bloque del provider.
91+
Se instala con el especificador de GitHub (sin npm, sin build), con un clon local, o
92+
dejandolo en el directorio de plugins auto-descubierto (ver el readme para las tres opciones).
9193

9294
```jsonc
9395
{
9496
"plugins": [
95-
"/ruta/absoluta/a/opencode-commandcode"
97+
"github:JoshRob297/opencode-commandcode"
9698
],
9799
"providers": {
98100
"commandcode": {

‎docs/es/troubleshooting.md‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,42 @@ mkdir -p "${COMMANDCODE_STATE_DIR:-$HOME/.local/state/opencode}" && touch "$_/pr
179179

180180
Un log de sanitizador vacio es el estado normal: solo recibe una entrada cuando un
181181
payload realmente necesito reparacion.
182+
183+
## Plugin cargado dos veces, o un plugin eliminado sigue corriendo
184+
185+
OpenCode carga plugins desde dos lugares: el array `plugins` de `opencode.json` **y**
186+
todo directorio dentro de `~/.config/opencode/plugins/` (auto-descubrimiento). Esa
187+
asimetria explica los dos casos confusos:
188+
189+
| Sintoma | Causa |
190+
| --- | --- |
191+
| Un plugin que quitaste de `plugins` sigue apareciendo en `opencode plugin list` | Vive en `~/.config/opencode/plugins/` y lo toma el scan de directorio |
192+
| Un plugin renombrado a `.disabled` dentro de ese directorio igual se carga | El scan toma cualquier subdirectorio, no solo archivos `.ts` ni el nombre original |
193+
194+
Que funciona y que no:
195+
196+
```bash
197+
# NO lo descarga
198+
# - quitar la entrada de opencode.json
199+
# - renombrar el directorio dentro de plugins/
200+
# - reescribir opencode.json para forzar un reload
201+
202+
# SI lo descarga (el watcher lo suelta en vivo)
203+
mv ~/.config/opencode/plugins/tu-plugin ~/fuera-del-directorio/tu-plugin
204+
```
205+
206+
Verifica con:
207+
208+
```bash
209+
opencode plugin list
210+
```
211+
212+
Si el plugin sigue listado despues de moverlo, el servicio en ejecucion lo mantuvo en
213+
memoria: reinicia el servidor en background (`opencode service stop`) y volve a abrir
214+
OpenCode. Nota que `opencode service restart` por si solo tambien sirve, pero corta la
215+
conexion del TUI actual.
216+
217+
Dos plugins registrando `commandcode_quota` no es fatal - el sanitizador es idempotente,
218+
asi que la segunda pasada devuelve `modified: false`, y el tool se expone una sola vez -
219+
pero duplica el trabajo de los hooks y enturbia la telemetria, asi que mantene una sola
220+
copia instalada.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "opencode-commandcode",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Production-grade OpenCode plugin for Command Code: dynamic model discovery, stability hooks and quota telemetry",
55
"main": "index.ts",
66
"type": "module",

0 commit comments

Comments
 (0)