Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,42 @@ All notable changes to this project are documented here. The format follows

## [Unreleased]

### Added

- **Cockpit runs on OpenCode 2.** Every package now loads on OpenCode 1.18+ and 2.0.15+ from the
same entry: the panels, console, Review, statusline and updater in the interface, and the `shell_*`
and `review_*` tools, system guidance and exit notifications on the agent side. Each bay is written
once against a host (`@opencode-cockpit/client/host` and `/server`) that each version supplies. On
OpenCode 2, `/plugins-update` says to change the version in `opencode.json`: the updater edits
OpenCode 1's files only.

- **One log for everything Cockpit does inside OpenCode.** Both halves of every bay write JSON lines
to `~/.cache/opencode-cockpit/cockpit.log`, beside the daemon's `cockpitd.log`: which OpenCode
(v1 or v2, and its version) loaded which entry, every error with its stack — including ones that
used to be a toast and nothing else — and every tool that failed. `COCKPIT_DEBUG=1 opencode` adds
the detail (console actions, each tool call and how long it took) and turns the daemon's debug
lines on too. The file moves to `cockpit.log.1` past 5 MB.

- **`npx opencode-cockpit@latest doctor`.** Checks a setup and prints the fix for anything wrong,
for the OpenCode you have: its version; every Cockpit entry in `opencode.json`, `tui.json` and
`cli.json` in either OpenCode's spelling — a bay configured twice, a half missing on OpenCode 1, a
pin older than the newest release, a checkout OpenCode 2 cannot load; what the log says last ran,
and on which OpenCode; recent errors; the daemon; `git` and `ps`; settings files and statusline
modules. Runs under Node outside OpenCode, so it works when Cockpit will not load. `--json` for an
issue; exits 1 when something must be fixed.

### Changed

- `createShellServer` and `createReviewServer` return a feature for `dualServer` rather than a v1
plugin function.

### Fixed

- **Full-screen shell console and the Review pane were see-through on transparent themes.** A theme
that leaves its background transparent (OpenCode's "system" theme, which shows the terminal's own)
painted the full-window surface with nothing, and the conversation showed through it. They now use
the first opaque background the theme has, and a solid one when it has none.

## [0.5.2] - 2026-09-24

### Added
Expand Down
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,24 @@ installed — and shows every plugin you have, not just this one:
npx opencode-cockpit@latest update # or: bunx opencode-cockpit@latest update
```

Restart OpenCode. Requires OpenCode 1.18+ on macOS or Linux. Install a feature either through
Restart OpenCode. Requires OpenCode 1.18+ or 2.0.15+ on macOS or Linux. Install a feature either through
`opencode-cockpit` or on its own — if both are configured, the first one loaded is used and
OpenCode warns you which entry to remove.

**On OpenCode 2** the same packages load — one entry serves both versions. v2 reads `plugins` (not
`plugin`) from `opencode.json` for the agent side and from `cli.json` for the interface, and passes
options as an object:

```json
{
"plugins": [{ "package": "opencode-cockpit@0.5.2", "options": { "features": { "shell": true } } }]
}
```

An existing v1 `opencode.json` with `plugin` is read by OpenCode 2 as well. To update there, change
the version in that entry — `/plugins-update` and `npx opencode-cockpit update` edit OpenCode 1's
files only.

**Turn features off** (in both `opencode.json` and `tui.json`):

```json
Expand Down Expand Up @@ -219,6 +233,26 @@ your own commands, define watch rules, cap how long shells live, choose what may
agent, and trade context tokens for accuracy. Each feature's README documents its own settings:
[Shell](packages/shell#configuration).

## Troubleshooting

```sh
npx opencode-cockpit@latest doctor
```

checks OpenCode, its config, Cockpit's logs and the daemon, and prints the fix for anything wrong —
on OpenCode 1 and 2, and when Cockpit will not load at all ([what it checks](https://codestz.github.io/opencode-cockpit/help/doctor/)).

Everything Cockpit does inside OpenCode goes to one file — which OpenCode loaded which bay, and every
error with its stack:

```sh
tail -50 ~/.cache/opencode-cockpit/cockpit.log
```

`COCKPIT_DEBUG=1 opencode` adds the detail. [Troubleshooting](https://codestz.github.io/opencode-cockpit/help/troubleshooting/) covers
the failures people hit and what to attach to an issue; [OpenCode 1 and 2](https://codestz.github.io/opencode-cockpit/start/opencode-versions/)
covers what differs between the two.

## How it works

```
Expand Down
9 changes: 9 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions bunfig.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[test]
# Tests run real PTYs and a real daemon; shared CI runners can be slow to spawn processes.
timeout = 20000
preload = ["./scripts/test-env.ts"]
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"record": "bun scripts/record.ts",
"clean:daemons": "bun scripts/clean-daemons.ts",
"preview": "bun packages/status/src/cli/preview.ts",
"capture": "bun scripts/capture.ts"
"capture": "bun scripts/capture.ts",
"dev:install": "bun run build && bun scripts/dev-install.ts"
},
"devDependencies": {
"@babel/core": "7.28.0",
Expand Down
9 changes: 9 additions & 0 deletions packages/client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ claim.release()
| `claimFeature`, `duplicateFeatureMessage`, `FeatureClaim` | First-one-wins guard for duplicate loads |
| `SpawnOptions` | `entry`, `execPath`, `env` |

Subpaths, for bays:

| Import | What it is |
| --- | --- |
| `@opencode-cockpit/client/host` | `Host`, `dualTui` — the interface half of a bay, written once for OpenCode 1 and 2 |
| `@opencode-cockpit/client/server` | `ServerHost`, `dualServer`, `composeParts` — the agent half, the same way |
| `@opencode-cockpit/client/log` | `createLog`, `Log` — the shared `cockpit.log`; `COCKPIT_DEBUG=1` for detail |
| `@opencode-cockpit/client/feature` | the duplicate-load guard on its own |

## Requirements

Bun ≥ 1.3.5. macOS and Linux.
Expand Down
21 changes: 19 additions & 2 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@
"./feature": {
"types": "./types/feature.d.ts",
"default": "./dist/feature.js"
},
"./host": {
"types": "./types/host.d.ts",
"default": "./dist/host.js"
},
"./server": {
"types": "./types/server.d.ts",
"default": "./dist/server.js"
},
"./log": {
"types": "./types/log.d.ts",
"default": "./dist/log.js"
}
},
"files": [
Expand All @@ -39,10 +51,15 @@
"access": "public"
},
"dependencies": {
"@opencode-cockpit/protocol": "workspace:*"
"@opencode-cockpit/protocol": "workspace:*",
"@opencode-ai/plugin": "1.18.31"
},
"devDependencies": {
"@opencode-cockpit/daemon": "workspace:*"
"@opencode-cockpit/daemon": "workspace:*",
"@opentui/core": "0.4.5",
"@opentui/keymap": "0.4.5",
"@opentui/solid": "0.4.5",
"solid-js": "1.9.12"
},
"engines": {
"bun": ">=1.3.5"
Expand Down
Loading
Loading