feat: implement local/opencode script (#1481)

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 <noreply@anthropic.com>
This commit is contained in:
A 2026-02-19 13:49:50 -08:00 committed by GitHub
parent 57d7d2b014
commit 87d6fdd240
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 29 additions and 1 deletions

28
local/opencode.sh Normal file
View file

@ -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"

View file

@ -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",