Skip to content

feat(clink): Add support for OpenCode CLI (sst/opencode) #373

@ramarivera

Description

@ramarivera

What problem is this feature trying to solve?

OpenCode is an open-source AI coding agent by SST that provides a terminal-based interface similar to Claude Code and Gemini CLI. Currently, clink supports Gemini CLI, Claude Code, and Codex, but not OpenCode.

Users who prefer OpenCode (or use it alongside other CLIs) cannot leverage it through PAL MCP's clink tool, missing out on:

  • OpenCode's multi-provider support (OpenAI, Anthropic, Google, etc.)
  • Its local-first architecture
  • Integration with their existing OpenCode workflows

Describe the solution you'd like

Add OpenCode as a supported CLI client in clink, similar to the existing Gemini and Claude integrations:

  1. Add opencode.yaml configuration in conf/cli_clients/
  2. Create an OpenCode agent runner in clink/agents/
  3. Add appropriate output parser for OpenCode's response format

Example configuration:

name: opencode
runner: opencode
command: opencode
args:
  - "-p"
  - "{prompt}"

Describe alternatives you've considered

  1. Use OpenCode directly - Works but loses the unified PAL MCP workflow and cross-tool continuation capabilities

  2. Use PAL's native tools with OpenCode's configured provider - Requires duplicating provider configuration and doesn't leverage OpenCode-specific features

  3. Config-only CLI support (issue feat(clink): Enable config-only custom CLI additions without code changes #357) - Could work as a stopgap, but a proper agent implementation would provide better output parsing and error handling

Additional context

  • OpenCode repo: https://github.com/sst/opencode
  • OpenCode uses a similar invocation pattern to other supported CLIs
  • Output format may require a custom parser or could potentially reuse existing parsers

Feature Category

Integration enhancement

Contribution

  • I am willing to submit a Pull Request to implement this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions