You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Smart auto-upgrade based on installation method #23435
When OpenCode is installed via local npm install (e.g., npm install opencode-ai without -g flag, common on shared servers where users lack sudo access), the auto-upgrade mechanism fails:
TUI shows upgrade prompt: "A new version is available"
User clicks "Update" button
Upgrade fails with permission error (tries to write to /usr/local/lib)
No fallback or guidance for local install scenarios
Current Behavior
The opencode upgrade command assumes global installation:
Attempts npm install -g → requires sudo
Or attempts curl download to /usr/local/bin → requires sudo
Fails silently without detecting local install context
Proposed Enhancement
Smart upgrade detection: Automatically detect the installation method and use the appropriate upgrade strategy:
Install Method
Upgrade Strategy
npm install opencode-ai (local in node_modules)
npm install opencode-ai@latest in install directory
npm install -g opencode-ai
npm install -g opencode-ai@latest
curl script (/usr/local/bin)
curl script reinstall
Homebrew
brew upgrade opencode
Implementation Suggestions
Detect install location by checking:
process.execPath or __dirname of the running binary
If path contains node_modules/opencode-ai, it's a local npm install
Activity
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.