From 87d6fdd240a200c9e9b412bdd2cbba2dd49e5a43 Mon Sep 17 00:00:00 2001 From: A <258483684+la14-1@users.noreply.github.com> Date: Thu, 19 Feb 2026 13:49:50 -0800 Subject: [PATCH] feat: implement local/opencode script (#1481) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why: local/opencode was listed as 'missing' in manifest.json — users could not run OpenCode on their local machine via spawn. - Add local/opencode.sh following the same pattern as other local scripts (sources lib/common.sh, uses opencode_install_cmd from shared/common.sh, injects OPENROUTER_API_KEY via generate_env_config) - Update manifest.json matrix entry from 'missing' to 'implemented' Agent: team-lead Co-authored-by: B <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 --- local/opencode.sh | 28 ++++++++++++++++++++++++++++ manifest.json | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 local/opencode.sh diff --git a/local/opencode.sh b/local/opencode.sh new file mode 100644 index 00000000..cfee66e6 --- /dev/null +++ b/local/opencode.sh @@ -0,0 +1,28 @@ +#!/bin/bash +set -eo pipefail + +# Source common functions - try local file first, fall back to remote +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)" +if [[ -f "${SCRIPT_DIR}/lib/common.sh" ]]; then + source "${SCRIPT_DIR}/lib/common.sh" +else + eval "$(curl -fsSL https://raw.githubusercontent.com/OpenRouterTeam/spawn/main/local/lib/common.sh)" +fi + +log_info "OpenCode on local machine" +echo "" + +agent_install() { + install_agent "OpenCode" "$(opencode_install_cmd)" cloud_run +} + +agent_env_vars() { + generate_env_config \ + "OPENROUTER_API_KEY=${OPENROUTER_API_KEY}" +} + +agent_launch_cmd() { + echo 'source ~/.zshrc 2>/dev/null; opencode' +} + +spawn_agent "OpenCode" diff --git a/manifest.json b/manifest.json index c62f0b8e..03d97fda 100644 --- a/manifest.json +++ b/manifest.json @@ -232,7 +232,7 @@ "local/openclaw": "implemented", "local/zeroclaw": "implemented", "local/codex": "implemented", - "local/opencode": "missing", + "local/opencode": "implemented", "local/kilocode": "implemented", "hetzner/claude": "implemented", "hetzner/openclaw": "implemented",