This repository was archived by the owner on Jun 23, 2026. It is now read-only.
Fix OpenCode install on macOS (.zip asset) + detect failed download - #69
Merged
Conversation
sst/opencode now ships .zip assets on macOS (.tar.gz only on Linux), so the
hardcoded opencode-$OS-$ARCH.tar.gz 404'd on macOS — yet the install still
reported "OpenCode installed" and launched a missing binary ("opencode: command
not found"). The trailing ;-separated PATH/export statements masked the failed
curl's exit code.
- Pick .zip + unzip on darwin, .tar.gz + tar on linux.
- Chain every step with && and end with `test -x .../opencode` so a failed
download/extract fails the install step (runLocal throws) instead of silently
succeeding.
Verified on macOS: opencode-darwin-arm64.zip downloads, unzips to a Mach-O arm64
`opencode` binary at root (so mv + test -x succeed).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reported live:
opencode localon macOS printedcurl: (56) ... 404, still said "OpenCode installed", thenopencode: command not foundat launch.Two bugs:
.zipon macOS (opencode-darwin-arm64.zip); Linux is still.tar.gz. The hardcoded…/opencode-$OS-$ARCH.tar.gz404s on macOS. (Linux/DO still worked, which is why it wasn't caught.);-separated PATH/exportstatements, so the overall exit code was0even whencurl404'd → agentsea proceeded to launch a missing binary.Fix
.zip+unzipon darwin,.tar.gz+taron linux.&&and end withtest -x "$HOME/.opencode/bin/opencode", so a failed download/extract fails the install step (runLocalthrows) instead of silently "succeeding".Verified on real macOS
opencode-darwin-arm64.zipdownloads (40 MB), unzips to a Mach-O arm64opencodebinary at root →mv+test -xsucceed.npm run typecheckclean; agent-config contract tests pass.