Fully isolated, zero-dependency, self-contained runtime environment OpenCode CLI setup.
██████╗ ██████╗ ███████╗███╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗
██╔═══██╗██╔══██╗██╔════╝████╗ ██║██╔════╝██╔═══██╗██╔══██╗██╔════╝
██║ ██║██████╔╝█████╗ ██╔██╗ ██║██║ ██║ ██║██║ ██║█████╗
██║ ██║██╔═══╝ ██╔══╝ ██║╚██╗██║██║ ██║ ██║██║ ██║██╔══╝
╚██████╔╝██║ ███████╗██║ ╚████║╚██████╗╚██████╔╝██████╔╝███████╗
╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝
██████╗ ██████╗ ██████╗ ████████╗ █████╗ ██████╗ ██╗ ███████╗
██╔══██╗██╔═══██╗██╔══██╗╚══██╔══╝██╔══██╗██╔══██╗██║ ██╔════╝
██████╔╝██║ ██║██████╔╝ ██║ ███████║██████╔╝██║ █████╗
██╔═══╝ ██║ ██║██╔══██╗ ██║ ██╔══██║██╔══██╗██║ ██╔══╝
██║ ╚██████╔╝██║ ██║ ██║ ██║ ██║██████╔╝███████╗███████╗
╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═════╝ ╚══════╝╚══════╝
A lightweight PowerShell script that builds a portable OpenCode package following the PortableApps.com directory structure, ready for use with PortableApps.com Launcher Generator. Built for a clean, self-contained OpenCode experience.
- Downloads the latest OpenCode CLI release via npm.
- Extracts the native Windows x64 executable.
- Generates the PortableApps-compatible directory structure and configuration files.
- Creates a multi-resolution application icon (ICO).
- Redirects XDG configuration, data, cache and state directories to the portable
Datafolder. - Disables OpenCode automatic updates.
- Verifies the generated package and removes temporary build files.
- Windows 10/11 (x64)
- Windows PowerShell 5.1 or later
- Node.js (includes npm)
- Internet connection
- Create an empty working directory (e.g.
OpenCodePortable). - Place
build.ps1inside the directory. - Run the script using Windows PowerShell.
- Wait for the build process to complete.
- The generated package will be available in the
OpenCodePortablesubdirectory. - Download and install PortableApps.com Launcher.
- Launch PortableApps.com Launcher Generator, select the generated
OpenCodePortabledirectory and follow the packaging instructions.
Note: The script only builds the application directory structure. PortableApps.com Launcher Generator is required to create the final portable launcher executable.
OpenCodePortable/
├── App/
│ ├── AppInfo/
│ │ └── Launcher/
│ └── OpenCode/
├── Data/
│ ├── cache/
│ ├── config/
│ ├── data/
│ └── state/
└── Other/
└── Source/
The generated package keeps OpenCode's configuration and runtime data inside its own directory, making it suitable for portable deployment.
Unofficial tool. Not affiliated with, endorsed, or sponsored by OpenCode or Anomaly.