feat(opencode): native opencode addon — bottom-row project indicator + in-TUI switcher #98

Open
michal wants to merge 1 commits from feat/opencode-extension-abhishek into main
Owner

Implements mcpctl as an addon for opencode, mirroring the existing pi and prime-agent integrations.

What it does

  • TUI plugin (src/opencode-ext/open-mcpctl.tsx) shows the active mcpctl project in opencode's app_bottom slot — the status row that also carries the token counter / model / mode info.
  • <leader>m (or the mcpctl.switch_project command palette entry) opens a searchable DialogSelect project picker.
  • Switching live re-points opencode's mcpctl MCP server at the new project's mcplocal endpoint via the SDK client — native MCP, no reimplemented JSON-RPC client (unlike pi, which had none).
  • State persisted in ~/.mcpctl/opencode-state.json (+ .mcpctl-project marker walk-up).

CLI wiring

  • mcpctl config opencode --project X: installs the plugin into ~/.config/opencode/plugin/, registers the .tsx in opencode.json's plugin array, best-effort provisions the @opentui/* TUI peer deps, writes active-project state, syncs skills into ~/.config/opencode/skill.
  • mcpctl skills sync --agent opencode added as a fourth shared-tree target.

Quality

  • typecheck:opencode-ext checks the plugin against the real @opencode-ai/plugin + @opentui/solid types (closes the "source-only plugin never checked" gap — same rationale as typecheck:pi-ext).
  • New tests: embed freshness, opencode-settings util, filterProjects/toolChangeAnnouncement helpers, skills agent root.
  • pnpm run typecheck (full) and the full CLI test suite pass; shell completions regenerated for the new subcommand.
  • Docs: docs/opencode-extension.md + README section.

Note: ESLint's strict-boolean-expressions reports on the same !opts.project / !opts.skipSkills && skillsClient patterns already present in the merged pi/prime-agent commands (baseline non-green); my changes mirror that established style.

Implements mcpctl as an addon for **opencode**, mirroring the existing pi and prime-agent integrations. ## What it does - **TUI plugin** (`src/opencode-ext/open-mcpctl.tsx`) shows the active mcpctl project in opencode's `app_bottom` slot — the status row that also carries the token counter / model / mode info. - **`<leader>m`** (or the `mcpctl.switch_project` command palette entry) opens a searchable `DialogSelect` project picker. - Switching **live re-points** opencode's `mcpctl` MCP server at the new project's mcplocal endpoint via the SDK client — native MCP, no reimplemented JSON-RPC client (unlike pi, which had none). - State persisted in `~/.mcpctl/opencode-state.json` (+ `.mcpctl-project` marker walk-up). ## CLI wiring - `mcpctl config opencode --project X`: installs the plugin into `~/.config/opencode/plugin/`, registers the `.tsx` in `opencode.json`'s `plugin` array, best-effort provisions the `@opentui/*` TUI peer deps, writes active-project state, syncs skills into `~/.config/opencode/skill`. - `mcpctl skills sync --agent opencode` added as a fourth shared-tree target. ## Quality - `typecheck:opencode-ext` checks the plugin against the **real** `@opencode-ai/plugin` + `@opentui/solid` types (closes the "source-only plugin never checked" gap — same rationale as `typecheck:pi-ext`). - New tests: embed freshness, opencode-settings util, `filterProjects`/`toolChangeAnnouncement` helpers, skills agent root. - `pnpm run typecheck` (full) and the full CLI test suite pass; shell completions regenerated for the new subcommand. - Docs: `docs/opencode-extension.md` + README section. Note: ESLint's `strict-boolean-expressions` reports on the same `!opts.project` / `!opts.skipSkills && skillsClient` patterns already present in the merged pi/prime-agent commands (baseline non-green); my changes mirror that established style.
michal added 1 commit 2026-08-08 20:48:42 +00:00
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
9aea1189bd
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.
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
This pull request has changes conflicting with the target branch.
  • README.md
  • completions/mcpctl.bash
  • completions/mcpctl.fish
  • docs/opencode-extension.md
  • eslint.config.js
  • package.json
  • pnpm-lock.yaml
  • scripts/generate-opencode-extension.ts
  • src/cli/src/commands/config.ts
  • src/cli/src/commands/skills.ts
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/opencode-extension-abhishek:feat/opencode-extension-abhishek
git checkout feat/opencode-extension-abhishek
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: michal/mcpctl#98