Skip to content

Commit 5b2fc7f

Browse files
RaghavSoodclaude
andcommitted
fix: correct OpenCode download URL and extraction
- Use anomalyco/opencode repo instead of opencodeai/opencode - Assets are tarballs (opencode-linux-x64.tar.gz), not plain binaries - Map x86_64 to x64 to match release naming convention - Use curl -fSL to fail on HTTP errors Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7ea386e commit 5b2fc7f

1 file changed

Lines changed: 18 additions & 12 deletions

File tree

install.sh

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,22 +98,28 @@ install_opencode() {
9898
log "OpenCode already installed"
9999
return 0
100100
fi
101-
101+
102102
log "Installing OpenCode..."
103-
local os_type
104-
os_type=$(detect_os)
105-
local arch
106-
arch=$(uname -m)
107-
case "$arch" in
108-
aarch64) arch="arm64";;
103+
local oc_os oc_arch
104+
case "$(uname -s)" in
105+
Linux*) oc_os="linux";;
106+
Darwin*) oc_os="darwin";;
107+
esac
108+
case "$(uname -m)" in
109+
x86_64) oc_arch="x64";;
110+
aarch64) oc_arch="arm64";;
111+
arm64) oc_arch="arm64";;
109112
esac
110113

111-
local opencode_url
112-
opencode_url="https://github.com/opencodeai/opencode/releases/latest/download/opencode-${os_type}-${arch}"
113-
114-
curl -sL "$opencode_url" -o "${INSTALL_DIR}/bin/opencode"
114+
local oc_archive="opencode-${oc_os}-${oc_arch}.tar.gz"
115+
local oc_url="https://github.com/anomalyco/opencode/releases/latest/download/${oc_archive}"
116+
117+
log "Downloading ${oc_archive}..."
118+
curl -fSL "$oc_url" -o "/tmp/${oc_archive}"
119+
tar -xzf "/tmp/${oc_archive}" -C "${INSTALL_DIR}/bin"
120+
rm "/tmp/${oc_archive}"
115121
chmod +x "${INSTALL_DIR}/bin/opencode"
116-
122+
117123
add_to_path
118124
log "OpenCode installed successfully"
119125
}

0 commit comments

Comments
 (0)