Summary
The install script (curl -fsSL https://opencode.ai/install | bash) currently lacks standard CLI flags that users expect from modern install scripts. This proposal adds basic flags following conventions established by widely-used installers.
Problem
- No
--help - Users can't discover available options without reading the source code
- No
--version flag - The VERSION env var works, but flags are more discoverable and ergonomic
- No
--no-modify-path - The script modifies shell config files (.zshrc, .bashrc, etc.) without an opt-out, which causes issues on:
- NixOS with home-manager (config files are read-only symlinks to
/nix/store/...)
- Immutable distros (Fedora Silverblue, etc.)
- Declarative dotfile managers (chezmoi, yadm, GNU Stow)
- Unknown flags are silently ignored - Typos like
--no-modify instead of --no-modify-path fail silently
Proposed Flags
| Flag |
Description |
-h, --help |
Display usage information |
-v, --version <ver> |
Install a specific version |
--no-modify-path |
Don't modify shell config files |
Additionally, unknown arguments should produce a warning so users are aware of typos.
Example Usage
# Show available options
curl -fsSL https://opencode.ai/install | bash -s -- --help
# Install a specific version
curl -fsSL https://opencode.ai/install | bash -s -- --version 1.0.180
# Install without modifying shell configs (for Nix users, etc.)
curl -fsSL https://opencode.ai/install | bash -s -- --no-modify-path
Research: How other installers handle this
I surveyed several popular and battle-tested install scripts to understand common conventions:
Rustup (Rust toolchain installer)
The gold standard for install scripts. Provides comprehensive flags:
Options:
-v, --verbose Enable verbose output
-q, --quiet Disable progress output
-y Disable confirmation prompt
--no-modify-path Don't configure the PATH environment variable
-h, --help Print help
-V, --version Print version
Notable: --no-modify-path is exactly what we need for NixOS/immutable systems.
A modern installer that downloads a binary and passes args through. Supports:
--no-confirm Accept defaults, non-interactive mode
The script itself is minimal - it downloads the real installer binary which has extensive options.
Simple and focused:
Usage: [NONINTERACTIVE=1] [CI=1] install.sh [options]
-h, --help Display this message.
Also supports NONINTERACTIVE and CI environment variables for automated installs.
Feature-rich installer with good UX:
Options:
-V, --verbose Enable verbose output
-f, -y, --force, --yes Skip the confirmation prompt
-p, --platform Override the platform
-b, --bin-dir Override the bin installation directory
-v, --version Install a specific version
-h, --help Display this help message
Notable: Uses -v, --version to specify which version to install (not print version).
ghcup (Haskell toolchain)
Uses environment variables for configuration:
BOOTSTRAP_HASKELL_NONINTERACTIVE - noninteractive installation
BOOTSTRAP_HASKELL_VERBOSE - more verbose installation
BOOTSTRAP_HASKELL_GHC_VERSION - specific GHC version to install
BOOTSTRAP_HASKELL_ADJUST_BASHRC - whether to adjust PATH in bashrc
Summary
| Feature |
Rustup |
Homebrew |
Starship |
Determinate |
ghcup |
--help |
✅ |
✅ |
✅ |
✅ |
❌ (env vars) |
--version (install specific) |
❌ |
❌ |
✅ |
❌ |
✅ (env var) |
--no-modify-path |
✅ |
❌ |
❌ |
❌ |
✅ (env var) |
--quiet |
✅ |
❌ |
❌ |
❌ |
❌ |
| Non-interactive mode |
✅ (-y) |
✅ (env var) |
✅ (-y) |
✅ |
✅ (env var) |
Additional Notes
- All changes are backward compatible - existing usage continues to work
- Currently "no config file found" exits with an error - this could be changed to a warning, allowing the install to succeed regardless
- The
VERSION environment variable can remain as an alternative to --version
Summary
The install script (
curl -fsSL https://opencode.ai/install | bash) currently lacks standard CLI flags that users expect from modern install scripts. This proposal adds basic flags following conventions established by widely-used installers.Problem
--help- Users can't discover available options without reading the source code--versionflag - TheVERSIONenv var works, but flags are more discoverable and ergonomic--no-modify-path- The script modifies shell config files (.zshrc,.bashrc, etc.) without an opt-out, which causes issues on:/nix/store/...)--no-modifyinstead of--no-modify-pathfail silentlyProposed Flags
-h,--help-v,--version <ver>--no-modify-pathAdditionally, unknown arguments should produce a warning so users are aware of typos.
Example Usage
Research: How other installers handle this
I surveyed several popular and battle-tested install scripts to understand common conventions:
Rustup (Rust toolchain installer)
The gold standard for install scripts. Provides comprehensive flags:
Notable:
--no-modify-pathis exactly what we need for NixOS/immutable systems.Determinate Nix Installer
A modern installer that downloads a binary and passes args through. Supports:
The script itself is minimal - it downloads the real installer binary which has extensive options.
Homebrew
Simple and focused:
Also supports
NONINTERACTIVEandCIenvironment variables for automated installs.Starship (shell prompt)
Feature-rich installer with good UX:
Notable: Uses
-v, --versionto specify which version to install (not print version).ghcup (Haskell toolchain)
Uses environment variables for configuration:
Summary
--help--version(install specific)--no-modify-path--quiet-y)-y)Additional Notes
VERSIONenvironment variable can remain as an alternative to--version