Skip to content

Add opencode as a provider #115

@stgreenb

Description

@stgreenb

Problem

Opencode has already been added as a target (thank you), but not as an LLM provider, and it would be convenient if it was. I did not submit the fork below as a formal PR (but could) as it was low effort coded, but it is is a working example of using the opencode cli as the LLM provider similar to other sources already included in caliber.

Proposed solution

https://github.com/stgreenb/ai-setup

Changes

  • New provider: src/llm/opencode.ts - CLI-based LLM provider using opencode run --format json
  • Types: Added 'opencode' to ProviderType in src/llm/types.ts
  • Registration: Provider registered in src/llm/index.ts
  • Config: Default model + CALIBER_USE_OPENCODE env var support in src/llm/config.ts
  • Model recovery: Added opencode to known models in src/llm/model-recovery.ts
  • Interactive setup: Added OpenCode option to src/commands/interactive-provider-setup.ts
  • Tests: Unit tests in src/llm/__tests__/opencode.test.ts (4 tests)

Alternatives considered

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions