opencode-docker-panel 0.4.8 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -1
- package/README.md +86 -194
- package/README.ru.md +76 -194
- package/dist/commands.js +9 -7
- package/dist/compose.js +36 -14
- package/dist/docker.js +26 -6
- package/dist/logs.js +3 -5
- package/dist/panel.js +232 -116
- package/dist/poll.js +68 -8
- package/dist/runtime.js +67 -0
- package/dist/tui.js +2 -2
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,38 @@
|
|
|
3
3
|
All notable changes to this plugin, by version and date. The version is the one in `package.json` at
|
|
4
4
|
that commit.
|
|
5
5
|
|
|
6
|
+
## 0.5.1 - 2026-10-08
|
|
7
|
+
|
|
8
|
+
- The repository is formatted with prettier, with a config that matches the existing style: no semicolons,
|
|
9
|
+
a 120 column width, trailing commas everywhere
|
|
10
|
+
- `npm run format` writes, `npm run format:check` only reports
|
|
11
|
+
- Version is bumped because the formatting changes every module and the rebuilt `dist` differs from 0.5.0
|
|
12
|
+
|
|
13
|
+
## 0.5.0 - 2026-10-07
|
|
14
|
+
|
|
15
|
+
- The panel can start and stop Docker Desktop: `Start Docker Desktop` is a clickable line in the
|
|
16
|
+
sidebar, `Stop Docker Desktop` is the last entry of the container list and is available even with no
|
|
17
|
+
containers at all
|
|
18
|
+
- `Stop` confirms first and names the running containers it can see, because an app-level stop ends
|
|
19
|
+
every container of every project
|
|
20
|
+
- Engine state comes from a `docker desktop status` probe rather than from `docker ps`, which reports a
|
|
21
|
+
stopped engine as an unavailable socket and cannot tell it apart from a missing CLI
|
|
22
|
+
- The probe waits up to nine seconds: measured, the CLI plugin takes 3.5 to 4.5 seconds to answer when
|
|
23
|
+
Docker is stopped, and a shorter timeout turned a provable `stopped` into an unknown state with no
|
|
24
|
+
buttons at all
|
|
25
|
+
- Log polling stops while the engine is down instead of spawning a doomed `docker logs` every two
|
|
26
|
+
seconds; the window keeps its last lines and does not resume by itself
|
|
27
|
+
- Readme trimmed to install and verification, with the behaviour, the demos and the limits moved to
|
|
28
|
+
`docs/features.md` and `docs/features.ru.md`
|
|
29
|
+
- Compose project names derived from a directory are normalized the way compose normalizes them, so an
|
|
30
|
+
uppercase directory like `CarManufacturersMVC` starts as `carmanufacturersmvc` instead of being
|
|
31
|
+
rejected as an invalid project name
|
|
32
|
+
- A compose project name that compose would reject, or one that normalizes to nothing, no longer
|
|
33
|
+
offers a button at all
|
|
34
|
+
- A stopped engine is read from `docker ps` failing on a missing `dockerDesktopLinuxEngine` pipe, which
|
|
35
|
+
takes a quarter of a second instead of the four seconds `docker desktop status` needs, so the
|
|
36
|
+
`Start Docker Desktop` line shows up right away
|
|
37
|
+
|
|
6
38
|
## 0.4.8 - 2026-10-04
|
|
7
39
|
|
|
8
40
|
- The package now ships precompiled ESM: `npm run build` transpiles the sources with the same
|
|
@@ -42,4 +74,4 @@ that commit.
|
|
|
42
74
|
|
|
43
75
|
## 0.1.0 — 2026-09-29
|
|
44
76
|
|
|
45
|
-
- First version: Docker containers in the `sidebar.content` slot, polled from `docker ps`
|
|
77
|
+
- First version: Docker containers in the `sidebar.content` slot, polled from `docker ps`
|
package/README.md
CHANGED
|
@@ -1,194 +1,86 @@
|
|
|
1
|
-
# opencode-docker-panel
|
|
2
|
-
|
|
3
|
-
[](https://github.com/victor-ochenin/opencodeDockerPlugin/actions/workflows/ci.yml)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
##
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
`Pin` in a container's menu keeps that container visible whatever its state, and it spends the five row budget when it happens to run, so pinning everything shows everything. A pin is stored by the host, so it survives a TUI restart and applies to every session; `Unpin` in the same menu drops it. Pinned rows are marked `pinned` next to their ports and project.
|
|
88
|
-
|
|
89
|
-
| State | Panel output |
|
|
90
|
-
|---|---|
|
|
91
|
-
| Docker up with containers | `Docker (N)` plus one row per container |
|
|
92
|
-
| Docker up, nothing created | `no containers` |
|
|
93
|
-
| Docker Desktop not running | `docker desktop not running` |
|
|
94
|
-
| Docker not installed | `docker not installed` |
|
|
95
|
-
| `docker ps` timed out | last known rows with a `stale` marker |
|
|
96
|
-
| No permission on the Docker socket | `no permission to talk to docker` |
|
|
97
|
-
|
|
98
|
-
A missing or stopped Docker is a normal state, not a plugin failure, so it is reported as a muted line rather than an error. Any failed poll, whether a timeout or a dead daemon, keeps the last known rows with a `stale` marker instead of blanking the panel; a successful poll that reports no containers clears the list.
|
|
99
|
-
|
|
100
|
-
## Requirements
|
|
101
|
-
|
|
102
|
-
- OpenCode 2 runtime with plugin slots (`opencode2`)
|
|
103
|
-
- `docker` on `PATH`: Docker Desktop on Windows, Docker Engine on Linux and macOS
|
|
104
|
-
|
|
105
|
-
The panel's own strings are English only; the documentation is bilingual.
|
|
106
|
-
|
|
107
|
-
## Install
|
|
108
|
-
|
|
109
|
-
### Option A: let an LLM do it
|
|
110
|
-
|
|
111
|
-
Paste this into any agent (Claude Code, OpenCode, Cursor, and so on):
|
|
112
|
-
|
|
113
|
-
```text
|
|
114
|
-
Install the opencode-docker-panel Docker sidebar plugin by following
|
|
115
|
-
https://github.com/victor-ochenin/opencodeDockerPlugin#installation
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
### Option B: manual setup
|
|
119
|
-
|
|
120
|
-
Add the plugin to `~/.config/opencode/cli.json`. Create the file if it does not exist and keep whatever is already in it.
|
|
121
|
-
|
|
122
|
-
```jsonc
|
|
123
|
-
{
|
|
124
|
-
"$schema": "https://opencode.ai/v2/cli.json",
|
|
125
|
-
"plugins": [{ "package": "opencode-docker-panel", "options": { "intervalMs": 3000 } }]
|
|
126
|
-
}
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
Two things trip people up here, so they are worth stating plainly:
|
|
130
|
-
|
|
131
|
-
- **It goes in `cli.json`, not `opencode.json`.** This is a terminal-only plugin: it draws in the sidebar, and `cli.json` is the file the terminal client reads.
|
|
132
|
-
- **There is no login step and no provider to configure.** It talks to the local `docker` CLI and nothing else.
|
|
133
|
-
|
|
134
|
-
Restart the TUI afterwards. The host installs the package on the next start; nothing to copy and nothing to build.
|
|
135
|
-
|
|
136
|
-
Pin a version when you want a known state: `{ "package": "opencode-docker-panel@0.4.1" }`.
|
|
137
|
-
|
|
138
|
-
### From a local checkout
|
|
139
|
-
|
|
140
|
-
To run the plugin straight from a clone instead, copy the files into the OpenCode config directory. On Windows that is `%USERPROFILE%\.config\opencode\plugins\docker-panel\`.
|
|
141
|
-
|
|
142
|
-
```powershell
|
|
143
|
-
$src = "path\to\opencodeDockerPlugin"
|
|
144
|
-
$dst = "$HOME\.config\opencode\plugins\docker-panel"
|
|
145
|
-
New-Item -ItemType Directory -Force -Path $dst | Out-Null
|
|
146
|
-
Copy-Item "$src\*.ts","$src\*.tsx","$src\package.json" -Destination $dst -Force
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
```jsonc
|
|
150
|
-
{
|
|
151
|
-
"$schema": "https://opencode.ai/v2/cli.json",
|
|
152
|
-
"plugins": [{ "package": "./plugins/docker-panel", "options": { "intervalMs": 3000 } }]
|
|
153
|
-
}
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
The package ships TypeScript sources and OpenCode resolves them at runtime, so there is no build step. `solid-js`, the OpenTUI packages and the OpenCode SDK are peer dependencies rather than hard dependencies, so a second copy of the SDK cannot shadow the one the host is running.
|
|
157
|
-
|
|
158
|
-
### Verification
|
|
159
|
-
|
|
160
|
-
There is no CLI check for this one: the plugin draws in the terminal UI, so `opencode run` will never show it. Verify in the TUI.
|
|
161
|
-
|
|
162
|
-
1. `docker ps` returns at least one container. If it fails, the panel has nothing to draw and says so.
|
|
163
|
-
2. Restart the TUI and open a session.
|
|
164
|
-
3. The sidebar gets a `Docker` header with a container count. Running containers appear as rows, at most five of them, with a `N more, click for all` line under them when something is still hidden.
|
|
165
|
-
4. Collapse the list with a click on `Docker`, then click it again to open the full list. Pick a container to get its actions menu.
|
|
166
|
-
|
|
167
|
-
If the header never appears, the plugin did not load: check that the entry is in `cli.json` under `plugins`, and check `~/.local/share/opencode/log/opencode.log` for a load error.
|
|
168
|
-
|
|
169
|
-
## Options
|
|
170
|
-
|
|
171
|
-
| Option | Default | Notes |
|
|
172
|
-
|---|---|---|
|
|
173
|
-
| `intervalMs` | `3000` | Poll interval, clamped to 1000..60000 |
|
|
174
|
-
|
|
175
|
-
## Known limits
|
|
176
|
-
|
|
177
|
-
- The sidebar draws containers that are `running` and nothing else. A `paused` or `restarting` container gets no row even though docker still counts it as alive; pin it to see it.
|
|
178
|
-
- OpenCode 2 is in beta, so slot names and theme tokens may change.
|
|
179
|
-
- A repaint workaround resets the collapsed state and closes an open log view when the container list really changes.
|
|
180
|
-
- The poll spawns `docker ps` on an interval. On a host with hundreds of containers, raise `intervalMs` to 5000 or higher.
|
|
181
|
-
- At most five running containers get a row, and the five is a constant rather than an option: a host with thirty containers shows five and leaves the rest to the dialog. Pinning is the only way to promote a sixth.
|
|
182
|
-
- The sidebar itself cannot scroll, so the containers past the five live in the dialog rather than in the panel.
|
|
183
|
-
- No exec, no volume or image actions, no restart history. `Down` is offered per container but acts on the whole compose project. The log view is a fixed window over the last 200 lines with no history beyond that.
|
|
184
|
-
- `Up stack` only ever starts a stack whose compose file sits in the agent directory. A project that was created somewhere else can still be torn down with `Down`, but it can only be started with `Start` on a single container.
|
|
185
|
-
- `Up stack` may stay hidden when the compose file declares its project in a form the panel cannot read, such as an indented `name:` or a quoted value. That is a refusal rather than a wrong stack.
|
|
186
|
-
- Actions are mouse-only; the plugin registers no keymap layer.
|
|
187
|
-
|
|
188
|
-
## Changelog
|
|
189
|
-
|
|
190
|
-
Versions and dates are in [CHANGELOG.md](CHANGELOG.md).
|
|
191
|
-
|
|
192
|
-
## License
|
|
193
|
-
|
|
194
|
-
MIT
|
|
1
|
+
# opencode-docker-panel
|
|
2
|
+
|
|
3
|
+
[](https://github.com/victor-ochenin/opencodeDockerPlugin/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/opencode-docker-panel)
|
|
5
|
+
|
|
6
|
+
A Docker container panel for the OpenCode 2 TUI sidebar, with Docker Desktop control.
|
|
7
|
+
|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
What it does, with demos: [docs/features.md](docs/features.md). Русская версия этого файла:
|
|
11
|
+
[README.ru.md](README.ru.md), демонстрации на русском — [docs/features.ru.md](docs/features.ru.md).
|
|
12
|
+
|
|
13
|
+
## Requirements
|
|
14
|
+
|
|
15
|
+
- OpenCode 2 runtime with plugin slots (`opencode2`)
|
|
16
|
+
- `docker` on `PATH`. Starting and stopping Docker Desktop needs its `docker desktop` CLI plugin
|
|
17
|
+
and works on Windows only
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
|
|
21
|
+
### Option A: let an LLM do it
|
|
22
|
+
|
|
23
|
+
Paste this into any agent (Claude Code, OpenCode, Cursor, and so on):
|
|
24
|
+
|
|
25
|
+
```text
|
|
26
|
+
Install the opencode-docker-panel Docker sidebar plugin by following
|
|
27
|
+
https://github.com/victor-ochenin/opencodeDockerPlugin#installation
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Option B: manual setup
|
|
31
|
+
|
|
32
|
+
Add the plugin to `~/.config/opencode/cli.json`. Create the file if it does not exist and keep
|
|
33
|
+
whatever is already in it.
|
|
34
|
+
|
|
35
|
+
```jsonc
|
|
36
|
+
{
|
|
37
|
+
"$schema": "https://opencode.ai/v2/cli.json",
|
|
38
|
+
"plugins": [{ "package": "opencode-docker-panel", "options": { "intervalMs": 3000 } }],
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Two things trip people up here, so they are worth stating plainly:
|
|
43
|
+
|
|
44
|
+
- **It goes in `cli.json`, not `opencode.json`.** This is a terminal-only plugin: it draws in the
|
|
45
|
+
sidebar, and `cli.json` is the file the terminal client reads.
|
|
46
|
+
- **There is no login step and no provider to configure.** It talks to the local `docker` CLI and
|
|
47
|
+
nothing else.
|
|
48
|
+
|
|
49
|
+
Restart the TUI afterwards. The host installs the package on the next start; nothing to copy and
|
|
50
|
+
nothing to build.
|
|
51
|
+
|
|
52
|
+
Pin a version when you want a known state: `{ "package": "opencode-docker-panel@0.5.0" }`.
|
|
53
|
+
|
|
54
|
+
### Verification
|
|
55
|
+
|
|
56
|
+
There is no CLI check for this one: the plugin draws in the terminal UI, so `opencode run` will
|
|
57
|
+
never show it. Verify in the TUI.
|
|
58
|
+
|
|
59
|
+
1. `docker ps` returns at least one container. If it fails, the panel has nothing to draw and says
|
|
60
|
+
so.
|
|
61
|
+
2. Restart the TUI and open a session.
|
|
62
|
+
3. The sidebar gets a `Docker` header with a container count. Running containers appear as rows, at
|
|
63
|
+
most five of them, with a `N more, click for all` line under them when something is still hidden.
|
|
64
|
+
4. Click `Docker` to collapse the list, then click it again to open the full list. Pick a container
|
|
65
|
+
to get its actions menu, and the last entry there is `Stop Docker Desktop`.
|
|
66
|
+
|
|
67
|
+
Stop Docker Desktop and the sidebar gets a clickable `Start Docker Desktop` line instead of a line of text.
|
|
68
|
+
|
|
69
|
+
If the header never appears, the plugin did not load: check that the entry is in `cli.json` under
|
|
70
|
+
`plugins`, and check `~/.local/share/opencode/log/opencode.log` for a load error.
|
|
71
|
+
|
|
72
|
+
## Options
|
|
73
|
+
|
|
74
|
+
| Option | Default | Notes |
|
|
75
|
+
| ------------ | ------- | ------------------------------------- |
|
|
76
|
+
| `intervalMs` | `3000` | Poll interval, clamped to 1000..60000 |
|
|
77
|
+
|
|
78
|
+
Everything else lives in [docs/features.md](docs/features.md).
|
|
79
|
+
|
|
80
|
+
## Changelog
|
|
81
|
+
|
|
82
|
+
Versions and dates are in [CHANGELOG.md](CHANGELOG.md).
|
|
83
|
+
|
|
84
|
+
## License
|
|
85
|
+
|
|
86
|
+
MIT
|
package/README.ru.md
CHANGED
|
@@ -1,194 +1,76 @@
|
|
|
1
|
-
# opencode-docker-panel
|
|
2
|
-
|
|
3
|
-
[](https://github.com/victor-ochenin/opencodeDockerPlugin/actions/workflows/ci.yml)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
##
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
|
65
|
-
|
|
|
66
|
-
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
`Up stack` поднимает весь compose-проект, а не один контейнер, и берёт compose-файл из каталога агента. Такой файл — исполняемое содержимое: в нём бывают `build`, `command` и `entrypoint`, поэтому диалог сначала показывает точную команду и подтверждения, в отличие от `down`, не требует.
|
|
79
|
-
|
|
80
|
-
Пункт появляется только когда файл доказуемно принадлежит проекту контейнера, по которому кликнули. Имя проекта читается так же, как это делает compose v2: явное `name:` верхнего уровня, если оно есть, иначе имя каталога, где лежит файл. Оно должно совпасть с лейблом `com.docker.compose.project` контейнера, а сам контейнер не должен быть уже запущен. Во всех остальных случаях пункта просто нет, потому что не тот стек хуже, чем отсутствие кнопки.
|
|
81
|
-
|
|
82
|
-
Проект передаётся дважды, как `-f <файл>` и `-p <проект>`. Имя внутри файла может быть шаблонным или перебитым окружением, а `-p` гарантирует, что поднимется тот самый проект, который панель уже показывает, а не его вторая копия.
|
|
83
|
-
|
|
84
|
-
Стек, у которого нет ни одного контейнера, — обычное состояние того, что никогда не запускали, и для него сделана отдельная входная точка. Когда в каталоге агента лежит compose-файл и на машине нет ни одного контейнера с таким лейблом проекта, под строками появляется строка:
|
|
85
|
-
|
|
86
|
-
```text
|
|
87
|
-
Up stack · storefront is not running here
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
Клик по ней один раз спрашивает, показывая точную команду до запуска: compose-файл это исполняемое содержимое, а у стека нет контейнера, которым можно назвать действие. Как только появится хоть один контейнер этого проекта, строка исчезает: дальше входом служит `Up stack` у самого контейнера. Один Dockerfile без compose-файла ничего не предлагает: запускать нечего без имени образа, и панель догадывалась бы.
|
|
91
|
-
|
|
92
|
-
Кандидаты проверяются в том же порядке, что и у compose: `compose.yaml`, `compose.yml`, `docker-compose.yaml`, `docker-compose.yml`. Первый существующий файл побеждает, даже если объявляет другой проект, потому что именно его использовал бы сам compose: если продолжить поиск, кнопка предложила бы стек, который CLI игнорирует.
|
|
93
|
-
|
|
94
|
-
## Логи
|
|
95
|
-
|
|
96
|
-
Пункт `Logs` в том же меню перезаписывает содержимое окна логами контейнера, то есть логи и действия делят одно окно. Закрывается через `esc` или кликом по нижней строке.
|
|
97
|
-
|
|
98
|
-
Просмотр — это `docker logs --timestamps --tail 200 -- <имя>`, обновление раз в две секунды, пока окно открыто. Docker пишет потоки контейнера вперемешку, поэтому буферы разбираются отдельно и снова сливаются по времени: без этого лог читался бы сначала целиком из stdout. ANSI-последовательности и одиночные `CR` вырезаются, иначе терминал выполнил бы их как управляющие коды. Окно фиксированной высоты в пятнадцать строк прокручивается колесом мыши.
|
|
99
|
-
|
|
100
|
-
## Требования
|
|
101
|
-
|
|
102
|
-
- Рантайм OpenCode 2 со слотами плагинов (`opencode2`)
|
|
103
|
-
- `docker` в `PATH`: Docker Desktop на Windows, Docker Engine на Linux и macOS
|
|
104
|
-
|
|
105
|
-
Строки панели только английские, документация двуязычная.
|
|
106
|
-
|
|
107
|
-
## Установка
|
|
108
|
-
|
|
109
|
-
### Вариант A: пусть сделает LLM
|
|
110
|
-
|
|
111
|
-
Вставь это в любого агента (Claude Code, OpenCode, Cursor и так далее):
|
|
112
|
-
|
|
113
|
-
```text
|
|
114
|
-
Установи плагин панели Docker opencode-docker-panel по инструкции
|
|
115
|
-
https://github.com/victor-ochenin/opencodeDockerPlugin#installation
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
### Вариант B: вручную
|
|
119
|
-
|
|
120
|
-
Добавь плагин в `~/.config/opencode/cli.json`. Если файла нет, создай его, и всё, что в нём уже есть, сохрани.
|
|
121
|
-
|
|
122
|
-
```jsonc
|
|
123
|
-
{
|
|
124
|
-
"$schema": "https://opencode.ai/v2/cli.json",
|
|
125
|
-
"plugins": [{ "package": "opencode-docker-panel", "options": { "intervalMs": 3000 } }]
|
|
126
|
-
}
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
Два места, на которых обычно спотыкаются, поэтому скажу прямо:
|
|
130
|
-
|
|
131
|
-
- **Запись идёт в `cli.json`, а не в `opencode.json`.** Плагин только терминальный: он рисуется в сайдбаре, а `cli.json` читает терминальный клиент.
|
|
132
|
-
- **Логиниться не нужно, провайдера настраивать не нужно.** Плагин говорит только с локальным `docker` и больше ни с чем.
|
|
133
|
-
|
|
134
|
-
После этого перезапусти TUI: хост сам поставит пакет при следующем старте, копировать и собирать ничего не нужно.
|
|
135
|
-
|
|
136
|
-
Если нужна зафиксированная версия, укажи её явно: `{ "package": "opencode-docker-panel@0.4.1" }`.
|
|
137
|
-
|
|
138
|
-
### Из локального клона
|
|
139
|
-
|
|
140
|
-
Чтобы запускать плагин прямо из клона, скопируй файлы в конфиг-каталог OpenCode. На Windows это `%USERPROFILE%\.config\opencode\plugins\docker-panel\`.
|
|
141
|
-
|
|
142
|
-
```powershell
|
|
143
|
-
$src = "path\to\opencodeDockerPlugin"
|
|
144
|
-
$dst = "$HOME\.config\opencode\plugins\docker-panel"
|
|
145
|
-
New-Item -ItemType Directory -Force -Path $dst | Out-Null
|
|
146
|
-
Copy-Item "$src\*.ts","$src\*.tsx","$src\package.json" -Destination $dst -Force
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
```jsonc
|
|
150
|
-
{
|
|
151
|
-
"$schema": "https://opencode.ai/v2/cli.json",
|
|
152
|
-
"plugins": [{ "package": "./plugins/docker-panel", "options": { "intervalMs": 3000 } }]
|
|
153
|
-
}
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
Пакет уходит исходниками на TypeScript, их резолвит сам OpenCode, поэтому собирать нечего. `solid-js`, пакеты OpenTUI и SDK OpenCode объявлены пирами, а не жёсткими зависимостями, поэтому вторая копия SDK не перекроет ту, которой работает хост.
|
|
157
|
-
|
|
158
|
-
### Проверка
|
|
159
|
-
|
|
160
|
-
CLI-проверки у этого плагина нет: он рисуется в терминальном интерфейсе, поэтому `opencode run` его не покажет никогда. Проверяй в TUI.
|
|
161
|
-
|
|
162
|
-
1. `docker ps` возвращает хотя бы один контейнер. Если команда падает, панели нечего рисовать, и она так и скажет.
|
|
163
|
-
2. Перезапусти TUI и открой сессию.
|
|
164
|
-
3. В сайдбаре появится заголовок `Docker` со счётчиком контейнеров. Запущенные контейнеры станут строками, не больше пяти, а под ними — строка `N more, click for all`, если что-то ещё скрыто.
|
|
165
|
-
4. Кликни по `Docker`, чтобы свернуть список, и ещё раз, чтобы открыть полный. Выбери контейнер — откроется меню его действий.
|
|
166
|
-
|
|
167
|
-
Если заголовок так и не появился, плагин не загрузился: проверь, что запись лежит в `cli.json` в секции `plugins`, и посмотри `~/.local/share/opencode/log/opencode.log` на предмет ошибки загрузки.
|
|
168
|
-
|
|
169
|
-
## Опции
|
|
170
|
-
|
|
171
|
-
| Опция | По умолчанию | Примечания |
|
|
172
|
-
|---|---|---|
|
|
173
|
-
| `intervalMs` | `3000` | Интервал опроса, ограничивается диапазоном 1000..60000 |
|
|
174
|
-
|
|
175
|
-
## Ограничения
|
|
176
|
-
|
|
177
|
-
- Сайдбар рисует только контейнеры в состоянии `running`. `paused` и `restarting` строки не получают, хотя docker считает их живыми, — чтобы увидеть такой контейнер, закрепи его.
|
|
178
|
-
- OpenCode 2 находится в бета-фазе, поэтому имена слотов и токены темы могут измениться.
|
|
179
|
-
- Обходное решение с перерисовкой сбрасывает свёрнутое состояние и закрывает открытое окно логов, когда список контейнеров действительно меняется.
|
|
180
|
-
- Опрос порождает `docker ps` с интервалом. На машине с сотнями контейнеров подними `intervalMs` до 5000 или выше.
|
|
181
|
-
- Строк не больше пяти, и пять — константа, а не опция: на машине с тридцатью контейнерами панель покажет пять, а остальные останутся в диалоге. Единственный способ вывести шестой — закрепить его.
|
|
182
|
-
- Сам сайдбар не прокручивается, поэтому контейнеры за пределами пяти живут в диалоге, а не в панели.
|
|
183
|
-
- Нет exec, работы с томами и образами, истории перезапусков. `Down` предлагается у контейнера, но действует на весь compose-проект. Окно логов — фиксированное окно поверх последних 200 строк, истории глубже нет.
|
|
184
|
-
- `Up stack` поднимает только стек, чей compose-файл лежит в каталоге агента. Проект, созданный в другом месте, всё равно можно снести через `Down`, но поднять его можно только `Start` на одном контейнере.
|
|
185
|
-
- `Up stack` может остаться скрытым, когда compose-файл объявляет проект в форме, которую панель прочитать не может: например, `name:` с отступом или в кавычках. Это отказ, а не неверный запуск.
|
|
186
|
-
- Действия только мышью; слой клавиш плагин не регистрирует.
|
|
187
|
-
|
|
188
|
-
## Изменения
|
|
189
|
-
|
|
190
|
-
Версии и даты в [CHANGELOG.md](CHANGELOG.md).
|
|
191
|
-
|
|
192
|
-
## Лицензия
|
|
193
|
-
|
|
194
|
-
MIT
|
|
1
|
+
# opencode-docker-panel
|
|
2
|
+
|
|
3
|
+
[](https://github.com/victor-ochenin/opencodeDockerPlugin/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/opencode-docker-panel)
|
|
5
|
+
|
|
6
|
+
Панель контейнеров Docker для бокового сайдбара OpenCode 2, с управлением Docker Desktop.
|
|
7
|
+
|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
Что она умеет, с демонстрациями: [docs/features.ru.md](docs/features.ru.md). English version of this file:
|
|
11
|
+
[README.md](README.md), demos in English — [docs/features.md](docs/features.md).
|
|
12
|
+
|
|
13
|
+
## Требования
|
|
14
|
+
|
|
15
|
+
- Рантайм OpenCode 2 со слотами плагинов (`opencode2`)
|
|
16
|
+
- `docker` в `PATH`. Запуск и остановка Docker Desktop требуют CLI-плагина `docker desktop` и работают только на Windows
|
|
17
|
+
|
|
18
|
+
## Установка
|
|
19
|
+
|
|
20
|
+
### Вариант A: пусть сделает LLM
|
|
21
|
+
|
|
22
|
+
Вставь это в любого агента (Claude Code, OpenCode, Cursor и так далее):
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
Установи плагин панели Docker opencode-docker-panel по инструкции
|
|
26
|
+
https://github.com/victor-ochenin/opencodeDockerPlugin#installation
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Вариант B: вручную
|
|
30
|
+
|
|
31
|
+
Добавь плагин в `~/.config/opencode/cli.json`. Если файла нет, создай его, и всё, что в нём уже есть, сохрани.
|
|
32
|
+
|
|
33
|
+
```jsonc
|
|
34
|
+
{
|
|
35
|
+
"$schema": "https://opencode.ai/v2/cli.json",
|
|
36
|
+
"plugins": [{ "package": "opencode-docker-panel", "options": { "intervalMs": 3000 } }],
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Два места, на которых обычно спотыкаются, поэтому скажу прямо:
|
|
41
|
+
|
|
42
|
+
- **Запись идёт в `cli.json`, а не в `opencode.json`.** Плагин только терминальный: он рисуется в сайдбаре, а `cli.json` читает терминальный клиент.
|
|
43
|
+
- **Логиниться не нужно, провайдера настраивать не нужно.** Плагин говорит только с локальным `docker` и больше ни с чем.
|
|
44
|
+
|
|
45
|
+
После этого перезапусти TUI: хост сам поставит пакет при следующем старте, копировать и собирать ничего не нужно.
|
|
46
|
+
|
|
47
|
+
Если нужна зафиксированная версия, укажи её явно: `{ "package": "opencode-docker-panel@0.5.0" }`.
|
|
48
|
+
|
|
49
|
+
### Проверка
|
|
50
|
+
|
|
51
|
+
CLI-проверки у этого плагина нет: он рисуется в терминальном интерфейсе, поэтому `opencode run` его не покажет никогда. Проверяй в TUI.
|
|
52
|
+
|
|
53
|
+
1. `docker ps` возвращает хотя бы один контейнер. Если команда падает, панели нечего рисовать, и она так и скажет.
|
|
54
|
+
2. Перезапусти TUI и открой сессию.
|
|
55
|
+
3. В сайдбаре появится заголовок `Docker` со счётчиком контейнеров. Запущенные контейнеры станут строками, не больше пяти, а под ними — строка `N more, click for all`, если что-то ещё скрыто. Если Docker остановлен, под заголовком будет кликабельная строка `Start Docker Desktop` вместо текста.
|
|
56
|
+
4. Кликни по `Docker`, чтобы свернуть список, и ещё раз, чтобы открыть полный. Выбери контейнер — откроется меню его действий, а последней позицией в том же списке будет `Stop Docker Desktop`.
|
|
57
|
+
|
|
58
|
+
Останови Docker Desktop — вместо текста в сайдбаре появится кликабельная строка `Start Docker Desktop`.
|
|
59
|
+
|
|
60
|
+
Если заголовок так и не появился, плагин не загрузился: проверь, что запись лежит в `cli.json` в секции `plugins`, и посмотри `~/.local/share/opencode/log/opencode.log` на предмет ошибки загрузки.
|
|
61
|
+
|
|
62
|
+
## Опции
|
|
63
|
+
|
|
64
|
+
| Опция | По умолчанию | Примечания |
|
|
65
|
+
| ------------ | ------------ | ------------------------------------------------------ |
|
|
66
|
+
| `intervalMs` | `3000` | Интервал опроса, ограничивается диапазоном 1000..60000 |
|
|
67
|
+
|
|
68
|
+
Всё остальное — в [docs/features.ru.md](docs/features.ru.md).
|
|
69
|
+
|
|
70
|
+
## Изменения
|
|
71
|
+
|
|
72
|
+
Версии и даты в [CHANGELOG.md](CHANGELOG.md).
|
|
73
|
+
|
|
74
|
+
## Лицензия
|
|
75
|
+
|
|
76
|
+
MIT
|