[PR #67] [MERGED] feat(adapters): add OpenCode CLI backend support #116

Closed
opened 2026-02-27 10:22:17 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mikeyobrien/ralph-orchestrator/pull/67
Author: @mikeyobrien
Created: 1/18/2026
Status: Merged
Merged: 1/18/2026
Merged by: @mikeyobrien

Base: mainHead: feat/opencode-backend


📝 Commits (2)

  • 0df7ecc feat(adapters): add OpenCode CLI backend support
  • 6b06c2e docs: add OpenCode to supported backends in README

📊 Changes

4 files changed (+241 additions, -10 deletions)

View changed files

📝 README.md (+10 -3)
📝 crates/ralph-adapters/src/auto_detect.rs (+13 -7)
📝 crates/ralph-adapters/src/cli_backend.rs (+112 -0)
tasks/add-opencode-backend-adapter.code-task.md (+106 -0)

📄 Description

Summary

  • Add OpenCode as the 7th supported CLI backend adapter, enabling Ralph to orchestrate OpenCode sessions for AI-assisted coding
  • OpenCode is an open-source AI coding agent (https://opencode.ai) with multi-provider support
  • Follows the established adapter pattern from the recent Copilot CLI addition

Changes

Implementation (cli_backend.rs)

  • Add opencode() factory method with --dangerously-skip-permissions for autonomous mode
  • Add opencode_tui() factory method for interactive TUI mode
  • Add opencode_interactive() factory method without auto-approve flag
  • Update from_config(), from_name(), for_interactive_prompt() match statements
  • Add filter_args_for_interactive() support for stripping auto-approve flag

Auto-Detection (auto_detect.rs)

  • Register "opencode" in DEFAULT_PRIORITY array
  • Add OpenCode CLI to NoBackendError install suggestions

Documentation (README.md)

  • Add OpenCode to Features, Prerequisites, Configuration, and CLI Reference sections
  • Include install command: curl -fsSL https://opencode.ai/install | bash

Test Plan

  • All 91 existing tests pass
  • 5 new OpenCode-specific tests added:
    • test_opencode_backend - Headless mode verification
    • test_opencode_tui_backend - TUI mode verification
    • test_opencode_interactive_mode_omits_flag - Interactive filter test
    • test_from_name_opencode - Name resolution test
    • test_for_interactive_prompt_opencode - Interactive prompt mode test
  • cargo clippy passes with no new warnings
  • Pre-commit hooks pass (fmt + clippy)

Usage

# ralph.yml
cli:
  backend: opencode

Or with auto-detection (if OpenCode is installed):

cli:
  backend: auto

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mikeyobrien/ralph-orchestrator/pull/67 **Author:** [@mikeyobrien](https://github.com/mikeyobrien) **Created:** 1/18/2026 **Status:** ✅ Merged **Merged:** 1/18/2026 **Merged by:** [@mikeyobrien](https://github.com/mikeyobrien) **Base:** `main` ← **Head:** `feat/opencode-backend` --- ### 📝 Commits (2) - [`0df7ecc`](https://github.com/mikeyobrien/ralph-orchestrator/commit/0df7eccc7dd210477f763838b9ca6581f84a1783) feat(adapters): add OpenCode CLI backend support - [`6b06c2e`](https://github.com/mikeyobrien/ralph-orchestrator/commit/6b06c2ed83f37aec2d132f13ed1a29e9eaf5c22c) docs: add OpenCode to supported backends in README ### 📊 Changes **4 files changed** (+241 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+10 -3) 📝 `crates/ralph-adapters/src/auto_detect.rs` (+13 -7) 📝 `crates/ralph-adapters/src/cli_backend.rs` (+112 -0) ➕ `tasks/add-opencode-backend-adapter.code-task.md` (+106 -0) </details> ### 📄 Description ## Summary - Add OpenCode as the 7th supported CLI backend adapter, enabling Ralph to orchestrate OpenCode sessions for AI-assisted coding - OpenCode is an open-source AI coding agent (https://opencode.ai) with multi-provider support - Follows the established adapter pattern from the recent Copilot CLI addition ## Changes ### Implementation (`cli_backend.rs`) - Add `opencode()` factory method with `--dangerously-skip-permissions` for autonomous mode - Add `opencode_tui()` factory method for interactive TUI mode - Add `opencode_interactive()` factory method without auto-approve flag - Update `from_config()`, `from_name()`, `for_interactive_prompt()` match statements - Add `filter_args_for_interactive()` support for stripping auto-approve flag ### Auto-Detection (`auto_detect.rs`) - Register `"opencode"` in `DEFAULT_PRIORITY` array - Add OpenCode CLI to `NoBackendError` install suggestions ### Documentation (`README.md`) - Add OpenCode to Features, Prerequisites, Configuration, and CLI Reference sections - Include install command: `curl -fsSL https://opencode.ai/install | bash` ## Test Plan - [x] All 91 existing tests pass - [x] 5 new OpenCode-specific tests added: - `test_opencode_backend` - Headless mode verification - `test_opencode_tui_backend` - TUI mode verification - `test_opencode_interactive_mode_omits_flag` - Interactive filter test - `test_from_name_opencode` - Name resolution test - `test_for_interactive_prompt_opencode` - Interactive prompt mode test - [x] `cargo clippy` passes with no new warnings - [x] Pre-commit hooks pass (fmt + clippy) ## Usage ```yaml # ralph.yml cli: backend: opencode ``` Or with auto-detection (if OpenCode is installed): ```yaml cli: backend: auto ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 10:22:17 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ralph-orchestrator#116
No description provided.