Add portable wrapper scripts and usage guide#15786
Add portable wrapper scripts and usage guide#15786jek-bao-choo wants to merge 2 commits intoanomalyco:devfrom
Conversation
Add self-contained portable wrapper scripts for running OpenCode without global installation. Scripts handle binary download, XDG environment isolation, version pinning, and platform detection (macOS/Linux/Windows). - opencode-portable.sh: Bash wrapper for macOS and Linux - opencode-portable.ps1: PowerShell wrapper for Windows - PORTABLE-GUIDE.md: Usage guide covering prerequisites, download instructions, quick start, version pinning, skill installation, and troubleshooting
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: Potentially Related PRs Found:
These PRs appear to be building blocks or related work in the portable/self-contained installation space, though PR #15786 is the primary implementation of the user-facing wrapper scripts and guide. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR. |
Issue for this PR
Closes #15789
Type of change
What does this PR do?
Adds self-contained portable wrapper scripts that let users run OpenCode without a global install, PATH changes, or files written to their home directory. Everything lives inside a
.opencode_portable/directorynext to the script.
What's included:
opencode-portable.sh— Bash wrapper for macOS and Linux. Handles architecture detection (ARM64/x64, Rosetta), musl vs glibc, AVX2 baseline fallback, and auto-downloads the correct binary from GitHub Releases.opencode-portable.ps1— PowerShell wrapper for Windows. Same download/version logic adapted for PowerShell 5.1+.PORTABLE-GUIDE.md— Usage guide covering prerequisites, how to download the wrapper scripts, quick start per platform, version pinning (env var or.opencode-versionfile), installing external skill plugins,and troubleshooting common issues.
Both scripts isolate all state via XDG environment variables (
XDG_CONFIG_HOME,XDG_DATA_HOME, etc.) pointed at the portable directory, and disable auto-update so the wrapper controls versioning.How did you verify your code works?
opencode-portable.shon macOS (Apple Silicon) — confirmed it downloads the correctdarwin-arm64binary, creates the.opencode_portable/directory structure, and launches OpenCode successfully.--portable-update,--portable-version, and--portable-helpflags.OPENCODE_PORTABLE_VERSIONenv var and.opencode-versionfile.PORTABLE-GUIDE.mdrenders correctly in GitHub Markdown preview.Screenshots / recordings
Checklist