feat(opencode): native opencode addon — bottom-row project indicator + in-TUI switcher
Some checks failed
CI/CD / lint (pull_request) Successful in 1m10s
CI/CD / test (pull_request) Successful in 1m23s
CI/CD / typecheck (pull_request) Successful in 2m58s
CI/CD / smoke (pull_request) Failing after 1m55s
CI/CD / build (pull_request) Successful in 4m56s
CI/CD / publish (pull_request) Has been skipped
Some checks failed
CI/CD / lint (pull_request) Successful in 1m10s
CI/CD / test (pull_request) Successful in 1m23s
CI/CD / typecheck (pull_request) Successful in 2m58s
CI/CD / smoke (pull_request) Failing after 1m55s
CI/CD / build (pull_request) Successful in 4m56s
CI/CD / publish (pull_request) Has been skipped
Adds an opencode integration mirroring the existing pi and prime-agent addons.
The addon is a TUI plugin (`src/opencode-ext/open-mcpctl.tsx`) that:
- renders the active mcpctl project into opencode's `app_bottom` slot — the
status row that also carries the token counter / model info,
- registers a `mcpctl.switch_project` command bound to `<leader>m` that opens a
searchable `DialogSelect` project picker,
- switches live by re-pointing opencode's `mcpctl` MCP server at the new
project's mcplocal endpoint via the SDK client (native MCP, no JSON-RPC code),
- persists state in `~/.mcpctl/opencode-state.json` (+ `.mcpctl-project` marker).
Pure helpers (`filterProjects`, `toolChangeAnnouncement`) live in
`projects.ts` so they are unit-tested.
`mcpctl config opencode --project X` provisions it: writes the plugin into
`~/.config/opencode/plugin/`, registers the `.tsx` in opencode.json's plugin
array (auto-discovery only matches {ts,js}), best-effort installs the TUI peer
deps (`@opentui/*`), and syncs skills into `~/.config/opencode/skill`.
`mcpctl skills sync --agent opencode` is added as a fourth shared-tree target.
Closes typecheck gap with `typecheck:opencode-ext` against the real
`@opencode-ai/plugin` + `@opentui/solid` types.
Tests: embed freshness, opencode-settings, projects helpers, skills agent
root. Full `pnpm run typecheck` + cli tests pass; completions regenerated.
This commit is contained in:
25
README.md
25
README.md
@@ -195,6 +195,31 @@ Inside pi:
|
||||
|
||||
See [docs/pi-extension.md](docs/pi-extension.md) for full details.
|
||||
|
||||
### Connect opencode
|
||||
|
||||
[opencode](https://opencode.ai) supports MCP natively, so unlike pi it doesn't
|
||||
need a reimplemented client. The mcpctl opencode addon is a **TUI plugin** that
|
||||
shows the active mcpctl project in opencode's bottom status row (the same row as
|
||||
the token counter) and lets you **switch projects from inside the interface**
|
||||
with a searchable picker.
|
||||
|
||||
```bash
|
||||
mcpctl config opencode --project monitoring
|
||||
```
|
||||
|
||||
This writes the plugin into `~/.config/opencode/plugin/`, registers it in
|
||||
`opencode.json`, provisions the plugin deps, persists the active project in
|
||||
`~/.mcpctl/opencode-state.json`, and runs an initial skills sync into
|
||||
`~/.config/opencode/skill`. Restart opencode and:
|
||||
|
||||
- the active project appears in the bottom status row (beside the token counter),
|
||||
- `<leader>m` (or the `mcpctl.switch_project` command) opens a project picker —
|
||||
picking one re-points opencode's `mcpctl` MCP server at the new project, so
|
||||
its tools live-switch.
|
||||
- re-sync with `mcpctl skills sync --agent opencode --project monitoring`
|
||||
|
||||
See [docs/opencode-extension.md](docs/opencode-extension.md) for full details.
|
||||
|
||||
## Declarative Configuration
|
||||
|
||||
Everything can be defined in YAML and applied with `mcpctl apply`:
|
||||
|
||||
Reference in New Issue
Block a user