anomalyco / anomalyco/opencode

install script ignores OPENCODE_INSTALL_DIR and XDG_BIN_DIR documented in README

Open
#42,974 2 comments 1 reaction 1 assignee View on GitHub

@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:

  1. $OPENCODE_INSTALL_DIR - Custom installation directory
  2. $XDG_BIN_DIR - XDG Base Directory Specification compliant path
  3. $HOME/bin
  4. $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
  1. Run OPENCODE_INSTALL_DIR=/tmp/foo curl -fsSL https://opencode.ai/install | bash (or run the repo's install script with the variable set)
  2. Observe the binary is installed to $HOME/.opencode/bin, not /tmp/foo
  3. Same with XDG_BIN_DIR=$HOME/.local/bin
Plugins

N/A

OpenCode version

Latest install script on dev branch

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.