Skip to content

Latest commit

 

History

History
90 lines (66 loc) · 4.4 KB

File metadata and controls

90 lines (66 loc) · 4.4 KB

OpenCode++ Desktop MVP

OpenCode++ Desktop is a lightweight Electron UI for running the existing OpenCode++ harness from a desktop window. It does not embed the OpenCode TUI.

The main motivation is practical: OpenCode's terminal TUI can be awkward for copy/paste-heavy workflows, especially on Windows. Pasting multiline tasks, issue descriptions, code snippets, quoted JSON, or long command plans into a terminal can break formatting or interact badly with terminal shortcuts and focus. The desktop app gives OpenCode++ a normal text area, log panel, stop button, and report opener while keeping OpenCode as the actual executor.

Why Not Embed The OpenCode TUI

OpenCode is already a terminal-native coding agent runtime. Embedding its TUI inside Electron would add a second terminal layer, which makes the exact copy/paste problem worse: clipboard handling, keyboard shortcuts, shell behavior, focus, and platform-specific terminal emulation all become harder to make reliable.

The Desktop MVP avoids that problem:

Desktop UI
  -> child_process
  -> local dist CLI or OPENCODE_PLUSPLUS_BIN
  -> opencode-plusplus oc run --repo "<repo>" --max-loops 2 --stream-executor -- "<task>"
  -> stdout/stderr stream
  -> generated report

OpenCode++ remains the harness. The desktop app only gives users a visual control surface for selecting a repository, entering a task, starting or stopping the run, watching output, and opening the generated report.

What It Does

  • Select a local repository directory.
  • Enter a task in a desktop form.
  • Run the local built CLI when available, or OPENCODE_PLUSPLUS_BIN when explicitly configured.
  • Pass oc run --repo "<repo>" --max-loops 2 --stream-executor -- "<task>" to the CLI.
  • Use a Desktop-specific OpenCode executor command with --pure --print-logs --log-level INFO --format json so OpenCode logs are visible in the desktop output panel.
  • Stream stdout and stderr in real time.
  • Show a running heartbeat when the harness or OpenCode is still alive but has not emitted output yet.
  • Stop stalled executor runs when OpenCode produces no real output for the configured idle timeout.
  • Stop the current task.
  • Open the latest .agent-context/orchestrator/<task-id>/orchestrator.md report.

What It Does Not Do

  • It does not embed OpenCode's TUI.
  • It does not replace OpenCode.
  • It does not modify guard, policy, trace, impact, or orchestrator logic.
  • It does not implement a separate agent runtime.

Project Layout

apps/desktop/
  package.json
  src/main/main.ts        Electron main process and child_process runner
  src/main/preload.ts     Safe IPC bridge
  src/renderer/src/       React UI

Development

Mode Status Commands / notes
Development mode Supported From the repo root, run npm run build && npm link first so the Desktop app can use the current CLI. Then run cd apps/desktop, npm install, npm run build, and npm run start.
Packaged installer mode Not provided yet Planned for a later electron-builder or electron-forge setup.
CLI dependency Required for development mode Development mode depends on the root CLI build/link step before starting the Electron shell.

Install the desktop app dependencies:

cd apps/desktop
npm install

Build the desktop app:

npm run build

Run the built shell:

npm run start

During source development, build the root CLI before starting the desktop app:

npm run build && npm link
cd apps/desktop
npm run build
npm run start

The desktop app first looks for the repository root from its compiled main process and runs the local dist/cli/index.js with Node. Set OPENCODE_PLUSPLUS_BIN only when you intentionally want Desktop to use a different installed CLI.