Skip to content

Add portable wrapper scripts and usage guide#15786

Closed
jek-bao-choo wants to merge 2 commits intoanomalyco:devfrom
jek-bao-choo:dev
Closed

Add portable wrapper scripts and usage guide#15786
jek-bao-choo wants to merge 2 commits intoanomalyco:devfrom
jek-bao-choo:dev

Conversation

@jek-bao-choo
Copy link
Copy Markdown

@jek-bao-choo jek-bao-choo commented Mar 3, 2026

Issue for this PR

Closes #15789

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

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/ directory
next 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-version file), 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?

  • Ran opencode-portable.sh on macOS (Apple Silicon) — confirmed it downloads the correct darwin-arm64 binary, creates the .opencode_portable/ directory structure, and launches OpenCode successfully.
  • Tested --portable-update, --portable-version, and --portable-help flags.
  • Tested version pinning via OPENCODE_PORTABLE_VERSION env var and .opencode-version file.
  • Reviewed PORTABLE-GUIDE.md renders correctly in GitHub Markdown preview.

Screenshots / recordings

Screenshot 2026-03-03 at 11 13 37

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 3, 2026

Hey! Your PR title Add portable wrapper scripts and usage guide doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Mar 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 3, 2026

The following comment was made by an LLM, it may be inaccurate:

Potentially Related PRs Found:

  1. PR feat: add directory override env vars and OPENCODE_APPNAME for portable mode and profile isolation #8963: feat: add env vars for complete portable mode and isolation support

  2. PR feat(opencode): added portable static builds #9430: feat(opencode): added portable static builds

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.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Mar 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 3, 2026

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Portable wrapper scripts for running OpenCode without global installation

1 participant