Part of sun-praise/opencode-actions — installs and caches the OpenCode CLI on Linux runners and exports the binary path for downstream steps. Linux runners only.
- name: Setup OpenCode
uses: sun-praise/opencode-actions/setup-opencode@v3
- name: Run OpenCode
run: opencode --version
shell: bashopencode is added to PATH automatically, so downstream run: steps and other actions can call it directly. If you need the absolute path, capture it from the opencode-path output.
- Installs OpenCode via the official installer (
https://opencode.ai/installby default; configurable viainstall-url) - Restores a dedicated cache backed by
actions/cache - Exports
opencodetoPATHfor the current job - Default behaviour ignores unrelated
opencodebinaries already onPATH; setallow-preinstalled: trueonly if you explicitly trust the runner image - Cache invalidation is controlled by
cache-key(the internal cache key also hashesinstall-url, so changing the installer source does not silently reuse an older cache entry)
| Input | Default | Description |
|---|---|---|
install-url |
https://opencode.ai/install |
Installer URL used to bootstrap OpenCode |
install-dir |
computed | Directory where opencode will be installed |
xdg-cache-home |
computed | Dedicated XDG cache directory |
cache |
true |
Enable actions/cache for install and cache directories |
cache-key |
v1 |
Cache key suffix used to invalidate installer caches |
install-attempts |
3 |
Total installer attempts |
allow-preinstalled |
false |
Reuse an existing trusted opencode already on PATH |
version |
empty | Optional minimum-version hint recorded in logs |
| Output | Description |
|---|---|
opencode-path |
Resolved absolute path to opencode |
install-dir |
Resolved install directory |
xdg-cache-home |
Resolved XDG cache directory |
cache-hit |
Whether actions/cache restored a hit |
version |
opencode --version output |
- Linux only
- Cache is best-effort and does not pin an exact OpenCode version
- The installer is external; use
cache-keyto force a fresh install when needed
run-opencode— genericopencoderunner with retry logicgithub-run-opencode— one-step wrapper foropencode github runreview— opinionated PR review wrappermulti-review— multi-agent parallel review with coordinator synthesisarchitect-review— architecture-focused reviewfeature-missing— PR scope audit vs linked issuespec-coverage— spec/task coverage audit
See the root README for the full list of inputs and examples.
Apache 2.0