Skip to content

Wrong installation path #3097

Closed
Closed

Description

@einarpersson

The README says

Installation Directory

The install script respects the following priority order for the installation path:

    $OPENCODE_INSTALL_DIR - Custom installation directory
    $XDG_BIN_DIR - XDG Base Directory Specification compliant path
    $HOME/bin - Standard user binary directory (if exists or can be created)
    $HOME/.opencode/bin - Default fallback

But when I run

❯ XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/install | bash
Downloading opencode version: 0.14.7 ...
######################################################################## 100.0%
Successfully added opencode to $PATH in /home/einar/.zshenv
❯ cat .zshenv
***REDACTED***
# opencode
export PATH=/home/einar/.opencode/bin:$PATH

❯ which opencode
~/.opencode/bin/opencode

Activity

  1. github-actions commented on Oct 11, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    The fact that your XDG_BIN_DIR setting is being ignored suggests this might be a regression or the implementation may not be working as expected. Feel free to ignore if #1124 doesn't address your specific case.

  2. rekram1-node commented on Oct 11, 2025

    @rekram1-node
    Contributor

    I think if you do that the env var isnt being passed to the script invocation that only passes it to curl which would have no effect

  3. einarpersson commented on Oct 11, 2025

    @einarpersson
    Author

    Well, the snippet is from the README.md

  4. einarpersson commented on Oct 11, 2025

    @einarpersson
    Author

    Maybe a sidenote, but is $XDG_BIN_DIR from the spec even? can't find much info about it online when searching. I have seen $XDG_BIN_HOME also but not sure if that is official either? I was also a bit surprised that $HOME/bin is a default but not $HOME/.local/bin, but I'm not an expert in these matters.

    User-specific executable files may be stored in $HOME/.local/bin. Distributions should ensure this directory shows up in the UNIX $PATH environment variable, at an appropriate place.

    https://specifications.freedesktop.org/basedir-spec/latest/

  5. rekram1-node commented on Oct 11, 2025

    @rekram1-node
    Contributor

    Well, the snippet is from the README.md

    facepalm oops okay ill fix, I think the script has a bug in it for this anyways, thx for raising

  6. rekram1-node commented on Oct 12, 2025

    @rekram1-node
    Contributor

    Hmm i think u are right about XDG_BIN_DIR that doesn't look liek its real, someone linked the spec and mentioned it but ig they were mistaken:

    #1124

  7. banksean commented on Oct 20, 2025

    @banksean

    The installer script doesn't appear to refer to the OPENCODE_INSTALL_DIR env var anywhere at the moment, though it does unconditionally set INSTALL_DIR=$HOME/.opencode/bin: https://github.com/sst/opencode/blob/6995dab1dcef179d5b38cd114f148da9e8617ade/install#L44

  8. rimmer commented on Nov 11, 2025

    @rimmer

    @rekram1-node it was rolled back here c87a746, without any note

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions