anomalyco / anomalyco/opencode
install script ignores OPENCODE_INSTALL_DIR and XDG_BIN_DIR documented in README
Open
@kitlangton is already working on this.
Since Aug 17, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
The install script (install in the repo root) hardcodes INSTALL_DIR=$HOME/.opencode/bin and never reads $OPENCODE_INSTALL_DIR or $XDG_BIN_DIR, but the README documents a priority order for the installation directory:
$OPENCODE_INSTALL_DIR- Custom installation directory$XDG_BIN_DIR- XDG Base Directory Specification compliant path$HOME/bin$HOME/.opencode/bin(default)
and even shows usage examples:
OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/install | bash
XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/install | bash
So the documented examples do not work: the binary is always installed to $HOME/.opencode/bin regardless of the variables.
Steps to reproduce
- Run
OPENCODE_INSTALL_DIR=/tmp/foo curl -fsSL https://opencode.ai/install | bash(or run the repo'sinstallscript with the variable set) - Observe the binary is installed to
$HOME/.opencode/bin, not/tmp/foo - Same with
XDG_BIN_DIR=$HOME/.local/bin
Plugins
N/A
OpenCode version
Latest install script on dev branch
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.