opencode-docker-panel 0.5.0 → 0.6.0
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 +96 -70
- package/README.md +90 -87
- package/README.ru.md +80 -77
- package/dist/commands.js +5 -5
- package/dist/compose.js +18 -18
- package/dist/events.js +103 -0
- package/dist/panel.js +78 -76
- package/dist/poll.js +92 -27
- package/dist/tui.js +0 -5
- package/package.json +79 -76
package/CHANGELOG.md
CHANGED
|
@@ -1,70 +1,96 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this plugin, by version and date. The version is the one in `package.json` at
|
|
4
|
-
that commit.
|
|
5
|
-
|
|
6
|
-
## 0.
|
|
7
|
-
|
|
8
|
-
- The panel
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
stopped
|
|
15
|
-
- The
|
|
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
|
-
## 0.1
|
|
69
|
-
|
|
70
|
-
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this plugin, by version and date. The version is the one in `package.json` at
|
|
4
|
+
that commit.
|
|
5
|
+
|
|
6
|
+
## 0.6.0 - 2026-10-10
|
|
7
|
+
|
|
8
|
+
- The panel follows `docker events` instead of asking on a timer, so a container appears or disappears
|
|
9
|
+
as soon as Docker reports it: 442 ms on a measured `compose stop`, against up to three seconds before
|
|
10
|
+
- Only `start`, `die`, `destroy`, `pause`, `unpause` and `rename` cause a repaint. `kill`, `stop` and
|
|
11
|
+
`create` would redraw a frame identical to the one already on screen, and `exec_` and `health_` events
|
|
12
|
+
are the container's own internals
|
|
13
|
+
- Polling stays as a safety net: `docker ps` every 30 seconds, and every 3 seconds while Docker is
|
|
14
|
+
stopped so that starting Docker Desktop from the tray shows up at once
|
|
15
|
+
- The event stream is reopened when its process exits, which it does loudly: about thirty seconds of
|
|
16
|
+
silence, then `unexpected EOF` and exit code 1. Reopening waits for `docker ps` to answer, so no
|
|
17
|
+
process is spawned for as long as Docker stays down
|
|
18
|
+
- `intervalMs` is gone. It controlled how often the panel ran `docker ps`, and events make that
|
|
19
|
+
meaningless; leaving it in a config is harmless
|
|
20
|
+
- Two container changes in quick succession no longer lose the second one, and simultaneous refreshes
|
|
21
|
+
can no longer apply out of order
|
|
22
|
+
- `Stop Docker Desktop` hides the `Up stack` line the moment it is pressed rather than after the
|
|
23
|
+
command finishes
|
|
24
|
+
|
|
25
|
+
## 0.5.1 - 2026-10-08
|
|
26
|
+
|
|
27
|
+
- The repository is formatted with prettier, with a config that matches the existing style: no semicolons,
|
|
28
|
+
a 120 column width, trailing commas everywhere
|
|
29
|
+
- `npm run format` writes, `npm run format:check` only reports
|
|
30
|
+
- Version is bumped because the formatting changes every module and the rebuilt `dist` differs from 0.5.0
|
|
31
|
+
|
|
32
|
+
## 0.5.0 - 2026-10-07
|
|
33
|
+
|
|
34
|
+
- The panel can start and stop Docker Desktop: `Start Docker Desktop` is a clickable line in the
|
|
35
|
+
sidebar, `Stop Docker Desktop` is the last entry of the container list and is available even with no
|
|
36
|
+
containers at all
|
|
37
|
+
- `Stop` confirms first and names the running containers it can see, because an app-level stop ends
|
|
38
|
+
every container of every project
|
|
39
|
+
- Engine state comes from a `docker desktop status` probe rather than from `docker ps`, which reports a
|
|
40
|
+
stopped engine as an unavailable socket and cannot tell it apart from a missing CLI
|
|
41
|
+
- The probe waits up to nine seconds: measured, the CLI plugin takes 3.5 to 4.5 seconds to answer when
|
|
42
|
+
Docker is stopped, and a shorter timeout turned a provable `stopped` into an unknown state with no
|
|
43
|
+
buttons at all
|
|
44
|
+
- Log polling stops while the engine is down instead of spawning a doomed `docker logs` every two
|
|
45
|
+
seconds; the window keeps its last lines and does not resume by itself
|
|
46
|
+
- Readme trimmed to install and verification, with the behaviour, the demos and the limits moved to
|
|
47
|
+
`docs/features.md` and `docs/features.ru.md`
|
|
48
|
+
- Compose project names derived from a directory are normalized the way compose normalizes them, so an
|
|
49
|
+
uppercase directory like `CarManufacturersMVC` starts as `carmanufacturersmvc` instead of being
|
|
50
|
+
rejected as an invalid project name
|
|
51
|
+
- A compose project name that compose would reject, or one that normalizes to nothing, no longer
|
|
52
|
+
offers a button at all
|
|
53
|
+
- A stopped engine is read from `docker ps` failing on a missing `dockerDesktopLinuxEngine` pipe, which
|
|
54
|
+
takes a quarter of a second instead of the four seconds `docker desktop status` needs, so the
|
|
55
|
+
`Start Docker Desktop` line shows up right away
|
|
56
|
+
|
|
57
|
+
## 0.4.8 - 2026-10-04
|
|
58
|
+
|
|
59
|
+
- The package now ships precompiled ESM: `npm run build` transpiles the sources with the same
|
|
60
|
+
Solid options OpenTUI's own transform uses, and `exports["./tui"]` points at `dist/tui.js`
|
|
61
|
+
- `react` dropped: the panel never imported it, and the host rewrites `@opentui/solid` and
|
|
62
|
+
`solid-js` to its own runtime when a package under `node_modules` ships JavaScript
|
|
63
|
+
- Peer dependencies stay optional, so npm never writes a second Solid or OpenTUI copy next to
|
|
64
|
+
the plugin
|
|
65
|
+
- `check-build` verifies the built entry imports, claims `sidebar.content`, and releases it on
|
|
66
|
+
cleanup
|
|
67
|
+
|
|
68
|
+
## 0.4.1 — 2026-10-04
|
|
69
|
+
|
|
70
|
+
- `react` added to peer dependencies, so the panel loads from npm
|
|
71
|
+
|
|
72
|
+
## 0.4.0 — 2026-10-04
|
|
73
|
+
|
|
74
|
+
- Sidebar draws running containers only, at most five, with the header opening the full list
|
|
75
|
+
- `Pin` and `Unpin` per container, stored by the host and surviving a TUI restart
|
|
76
|
+
- `Up stack` starts a compose project from the agent directory, only when the file provably declares
|
|
77
|
+
the clicked container's project
|
|
78
|
+
- An unstarted stack in the agent directory gets its own line under the rows
|
|
79
|
+
- Packaged for npm: `files` allowlist, peer dependencies, repository metadata, npm install docs
|
|
80
|
+
- Readme trimmed to what a user needs, with the working install path first
|
|
81
|
+
|
|
82
|
+
## 0.3.0 — 2026-09-30
|
|
83
|
+
|
|
84
|
+
- `Start`, `Restart`, `Stop` and `Down compose project` per container, with `Down` confirming first
|
|
85
|
+
- Log view in the same dialog, `docker logs --timestamps --tail 200`, streams merged by timestamp
|
|
86
|
+
- Terminal recording added to the readme
|
|
87
|
+
- CI running typecheck and parser checks on both Linux and Windows
|
|
88
|
+
|
|
89
|
+
## 0.2.0 — 2026-09-29
|
|
90
|
+
|
|
91
|
+
- Loads as a CLI-only plugin, no `@opencode/plugin` import at runtime
|
|
92
|
+
- A poll that reports no containers clears the panel instead of keeping stale rows
|
|
93
|
+
|
|
94
|
+
## 0.1.0 — 2026-09-29
|
|
95
|
+
|
|
96
|
+
- First version: Docker containers in the `sidebar.content` slot, polled from `docker ps`
|
package/README.md
CHANGED
|
@@ -1,87 +1,90 @@
|
|
|
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": [
|
|
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.
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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": ["opencode-docker-panel"],
|
|
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.6.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
|
+
There are none. The panel follows Docker's own event stream, so there is nothing to configure and
|
|
75
|
+
nothing to tune. It still polls as a safety net every 30 seconds, and every 3 seconds while Docker is
|
|
76
|
+
stopped so that starting Docker Desktop from the tray shows up right away.
|
|
77
|
+
|
|
78
|
+
Before `0.6.0` there was an `intervalMs` option. It controlled how often the panel ran `docker ps`,
|
|
79
|
+
and it no longer does anything: events carry the updates and the poll is only a net. Leaving it in
|
|
80
|
+
your config is harmless.
|
|
81
|
+
|
|
82
|
+
Everything else lives in [docs/features.md](docs/features.md).
|
|
83
|
+
|
|
84
|
+
## Changelog
|
|
85
|
+
|
|
86
|
+
Versions and dates are in [CHANGELOG.md](CHANGELOG.md).
|
|
87
|
+
|
|
88
|
+
## License
|
|
89
|
+
|
|
90
|
+
MIT
|
package/README.ru.md
CHANGED
|
@@ -1,77 +1,80 @@
|
|
|
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": [
|
|
37
|
-
}
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Два места, на которых обычно спотыкаются, поэтому скажу прямо:
|
|
41
|
-
|
|
42
|
-
- **Запись идёт в `cli.json`, а не в `opencode.json`.** Плагин только терминальный: он рисуется в сайдбаре, а `cli.json` читает терминальный клиент.
|
|
43
|
-
- **Логиниться не нужно, провайдера настраивать не нужно.** Плагин говорит только с локальным `docker` и больше ни с чем.
|
|
44
|
-
|
|
45
|
-
После этого перезапусти TUI: хост сам поставит пакет при следующем старте, копировать и собирать ничего не нужно.
|
|
46
|
-
|
|
47
|
-
Если нужна зафиксированная версия, укажи её явно: `{ "package": "opencode-docker-panel@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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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": ["opencode-docker-panel"],
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Два места, на которых обычно спотыкаются, поэтому скажу прямо:
|
|
41
|
+
|
|
42
|
+
- **Запись идёт в `cli.json`, а не в `opencode.json`.** Плагин только терминальный: он рисуется в сайдбаре, а `cli.json` читает терминальный клиент.
|
|
43
|
+
- **Логиниться не нужно, провайдера настраивать не нужно.** Плагин говорит только с локальным `docker` и больше ни с чем.
|
|
44
|
+
|
|
45
|
+
После этого перезапусти TUI: хост сам поставит пакет при следующем старте, копировать и собирать ничего не нужно.
|
|
46
|
+
|
|
47
|
+
Если нужна зафиксированная версия, укажи её явно: `{ "package": "opencode-docker-panel@0.6.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
|
+
Их нет. Панель следует за потоком событий самого Docker, поэтому настраивать и подкручивать нечего.
|
|
65
|
+
Опрос при этом остался как страховка: раз в 30 секунд и раз в 3 секунды, пока Docker выключен, чтобы
|
|
66
|
+
запуск Docker Desktop из трея был виден сразу.
|
|
67
|
+
|
|
68
|
+
До `0.6.0` была опция `intervalMs`. Она задавала, как часто панель запускает `docker ps`, и больше
|
|
69
|
+
ничего не делает: обновления приходят по событиям, а опрос только страхует. Если она осталась у тебя
|
|
70
|
+
в конфиге, это безвредно.
|
|
71
|
+
|
|
72
|
+
Всё остальное — в [docs/features.ru.md](docs/features.ru.md).
|
|
73
|
+
|
|
74
|
+
## Изменения
|
|
75
|
+
|
|
76
|
+
Версии и даты в [CHANGELOG.md](CHANGELOG.md).
|
|
77
|
+
|
|
78
|
+
## Лицензия
|
|
79
|
+
|
|
80
|
+
MIT
|
package/dist/commands.js
CHANGED
|
@@ -48,11 +48,11 @@ function firstLine(text) {
|
|
|
48
48
|
if (!line) return "";
|
|
49
49
|
return line.length > 80 ? `${line.slice(0, 77)}...` : line;
|
|
50
50
|
}
|
|
51
|
-
/**
|
|
52
|
-
* Runs an already-built argument list.
|
|
53
|
-
*
|
|
54
|
-
* `up` has no container behind it, so the boundary takes the argv rather than a container the caller
|
|
55
|
-
* would have to invent to satisfy the type.
|
|
51
|
+
/**
|
|
52
|
+
* Runs an already-built argument list.
|
|
53
|
+
*
|
|
54
|
+
* `up` has no container behind it, so the boundary takes the argv rather than a container the caller
|
|
55
|
+
* would have to invent to satisfy the type.
|
|
56
56
|
*/
|
|
57
57
|
export function runDockerArgs(args) {
|
|
58
58
|
return new Promise(resolve => {
|
package/dist/compose.js
CHANGED
|
@@ -4,14 +4,14 @@ import { basename, dirname, join } from "node:path";
|
|
|
4
4
|
/** compose v2's own search order, so the resolver sees the file the CLI would pick */
|
|
5
5
|
const CANDIDATES = ["compose.yaml", "compose.yml", "docker-compose.yaml", "docker-compose.yml"];
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* Compose derives a project name from the directory by lowercasing it, dropping everything outside
|
|
9
|
-
* `[a-z0-9_-]` and then dropping whatever is left before the first alphanumeric. Measured against
|
|
10
|
-
* compose v2: `My.Stack 2` becomes `mystack2`, `A+B` becomes `ab`, `--Lead` becomes `lead`,
|
|
11
|
-
* `Ünïcode` becomes `ncode`, and a directory named `---` fails with "project name must not be empty".
|
|
12
|
-
*
|
|
13
|
-
* The panel passes the name explicitly as `-p`, which replaces that derivation, so the same
|
|
14
|
-
* normalization has to happen here or compose rejects what it would have accepted on its own.
|
|
7
|
+
/**
|
|
8
|
+
* Compose derives a project name from the directory by lowercasing it, dropping everything outside
|
|
9
|
+
* `[a-z0-9_-]` and then dropping whatever is left before the first alphanumeric. Measured against
|
|
10
|
+
* compose v2: `My.Stack 2` becomes `mystack2`, `A+B` becomes `ab`, `--Lead` becomes `lead`,
|
|
11
|
+
* `Ünïcode` becomes `ncode`, and a directory named `---` fails with "project name must not be empty".
|
|
12
|
+
*
|
|
13
|
+
* The panel passes the name explicitly as `-p`, which replaces that derivation, so the same
|
|
14
|
+
* normalization has to happen here or compose rejects what it would have accepted on its own.
|
|
15
15
|
*/
|
|
16
16
|
export function normalizeProject(name) {
|
|
17
17
|
return name.toLowerCase().replace(/[^a-z0-9_-]/g, "").replace(/^[^a-z0-9]+/, "");
|
|
@@ -25,10 +25,10 @@ function declaredProject(body) {
|
|
|
25
25
|
return match?.[1]?.replace(/^["']|["']$/g, "") ?? "";
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
/**
|
|
29
|
-
* Finds the agent directory's compose file and reports the project it declares, if any.
|
|
30
|
-
*
|
|
31
|
-
* Read on every call because the caller opens a menu, not the poll loop.
|
|
28
|
+
/**
|
|
29
|
+
* Finds the agent directory's compose file and reports the project it declares, if any.
|
|
30
|
+
*
|
|
31
|
+
* Read on every call because the caller opens a menu, not the poll loop.
|
|
32
32
|
*/
|
|
33
33
|
export function findComposeFile(agentDir) {
|
|
34
34
|
if (!agentDir) return null;
|
|
@@ -56,12 +56,12 @@ export function findComposeFile(agentDir) {
|
|
|
56
56
|
return null;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
/**
|
|
60
|
-
* The compose target for a container already part of the project, or null when the agent directory's
|
|
61
|
-
* file belongs to somebody else.
|
|
62
|
-
*
|
|
63
|
-
* `up` runs build and command lines from that file, so an uncertain match has to hide the button
|
|
64
|
-
* rather than point it at the wrong stack.
|
|
59
|
+
/**
|
|
60
|
+
* The compose target for a container already part of the project, or null when the agent directory's
|
|
61
|
+
* file belongs to somebody else.
|
|
62
|
+
*
|
|
63
|
+
* `up` runs build and command lines from that file, so an uncertain match has to hide the button
|
|
64
|
+
* rather than point it at the wrong stack.
|
|
65
65
|
*/
|
|
66
66
|
export function resolveComposeTarget(agentDir, project) {
|
|
67
67
|
const target = findComposeFile(agentDir);
|