Plexus icon indicating copy to clipboard operation
Plexus copied to clipboard

Support OpenCode

Open miniLV opened this issue 3 months ago • 1 comments

What

Add OpenCode (https://github.com/anomalyco/opencode) as a built-in agent in Plexus so it can be detected and synced like the other agents.

Paths

OpenCode keeps its global config at ~/.config/opencode/:

  • Skills: ~/.config/opencode/skills/<name>/SKILL.md (Anthropic SKILL.md; frontmatter only name/description/license/compatibility/metadata`)
  • Instruction file: ~/.config/opencode/AGENTS.md
  • MCP: ~/.config/opencode/opencode.json under the mcp key (NOT mcpServers), with a local/remote shape (command array, environment, url, headers)

Detection

Detect via the opencode command on PATH.

Notes

  • OpenCode's MCP shape differs from the other JSON agents (mcp key, local/remote type, command as an array, environment instead of env), so it needs a dedicated adapter for partial-write and a dedicated import reader.

miniLV avatar Aug 27 '26 12:08 miniLV

Implemented in d43e311.

  • Added opencode as a built-in agent with config root ~/.config/opencode:
    • Skills: ~/.config/opencode/skills/<name>
    • Instruction file: ~/.config/opencode/AGENTS.md
    • MCP: ~/.config/opencode/opencode.json under the mcp key
  • Dedicated adapter (packages/core/src/agents/adapters/opencode.ts) for the OpenCode MCP shape (local/remote, command array, environment), with partial-write that preserves other config keys.
  • Import reader handles the mcp key for native MCP discovery.
  • Unit tests in opencode.test.ts (partial-write + local/remote import) and detect.test.ts (CLI detection + paths).

miniLV avatar Aug 27 '26 12:08 miniLV