Skip to content

[Feature]: Add --user parameter to install.sh for user-local installation (to ~/.local/bin) #585

@leganck

Description

@leganck

1. Your usage scenarios?

I use the install.sh script in Coder workspaces, where only the current user's home directory (~) is persisted across workspace restarts.

System-wide directories (e.g., /usr/local/bin) are ephemeral and get reset after a workspace restart—this means tools installed to these paths are lost, forcing me to re-run the install script every time the workspace restarts.

Installing to ~/.local/bin (a standard user-local binary directory in the persisted home directory) would ensure the tool remains available after workspace restarts, but the current script only supports system-wide installation (requiring sudo/root and installing to non-persistent paths).

2. What is your expected outcome?

  • Add a --user flag to install.sh. When used (e.g., ./install.sh --user):
    • The script installs the binary to ~/.local/bin (automatically create the directory if it does not exist).
    • Bypass sudo/root permission checks (since ~/.local/bin is within the user's writable home directory).
    • Ensure ~/.local/bin is added to the user's $PATH (if not already present) to make the tool accessible immediately.
  • Keep the default behavior (install to system-wide paths like /usr/local/bin) when --user is not specified (preserve backward compatibility).

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions