[Bug] 'update' command incorrectly attempts to use CWD instead of installation directory #9103

Closed
opened 2026-02-16 18:11:39 -05:00 by yindo · 2 comments
Owner

Originally created by @whichLain on GitHub (Feb 11, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

Describe the bug

The opencode update command seems to resolve the update directory relative to the Current Working Directory (CWD), rather than the actual installation path or a standard temporary directory (like /tmp or ~/.cache).

This causes the update to fail if the command is run from a directory where the update folder doesn't exist (or where the user lacks write permissions), and it attempts to create clutter in unrelated directories.

Steps to reproduce

  1. Open terminal.
  2. cd to an arbitrary directory, e.g., ~/Downloads.
  3. Run opencode update.

Actual behavior

The tool tries to access/create an update folder inside ~/Downloads and fails (or creates it unexpectedly).

cd Down

~/Downloads
❯ opencode update
Error: Failed to change directory to /Users/niconiconi/Downloads/update

### Plugins

_No response_

### OpenCode version

1.1.59

### Steps to reproduce

cd ~/Downloads
opencode update

### Screenshot and/or share link

_No response_

### Operating System

macOS 26.2 25C56

### Terminal

Ghostty
Originally created by @whichLain on GitHub (Feb 11, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description ### Describe the bug The `opencode update` command seems to resolve the update directory relative to the **Current Working Directory (CWD)**, rather than the actual installation path or a standard temporary directory (like `/tmp` or `~/.cache`). This causes the update to fail if the command is run from a directory where the `update` folder doesn't exist (or where the user lacks write permissions), and it attempts to create clutter in unrelated directories. ### Steps to reproduce 1. Open terminal. 2. `cd` to an arbitrary directory, e.g., `~/Downloads`. 3. Run `opencode update`. ### Actual behavior The tool tries to access/create an `update` folder inside `~/Downloads` and fails (or creates it unexpectedly). ```bash ❯ cd Down ~/Downloads ❯ opencode update Error: Failed to change directory to /Users/niconiconi/Downloads/update ### Plugins _No response_ ### OpenCode version 1.1.59 ### Steps to reproduce cd ~/Downloads opencode update ### Screenshot and/or share link _No response_ ### Operating System macOS 26.2 25C56 ### Terminal Ghostty
yindo added the bug label 2026-02-16 18:11:39 -05:00
yindo closed this issue 2026-02-16 18:11:39 -05:00
Author
Owner

@rekram1-node commented on GitHub (Feb 11, 2026):

the command is upgrade not update see:

$ opencode --help

Commands:
  opencode completion          generate shell completion script
  opencode acp                 start ACP (Agent Client Protocol) server
  opencode mcp                 manage MCP (Model Context Protocol) servers
  opencode [project]           start opencode tui                                          [default]
  opencode attach <url>        attach to a running opencode server
  opencode run [message..]     run opencode with a message
  opencode debug               debugging and troubleshooting tools
  opencode auth                manage credentials
  opencode agent               manage agents
  opencode upgrade [target]    upgrade opencode to the latest or a specific version
  opencode uninstall           uninstall opencode and remove all related files
  opencode serve               starts a headless opencode server
  opencode web                 start opencode server and open web interface
  opencode models [provider]   list all available models
  opencode stats               show token usage and cost statistics
  opencode export [sessionID]  export session data as JSON
  opencode import <file>       import session data from JSON file or URL
  opencode github              manage GitHub agent
  opencode pr <number>         fetch and checkout a GitHub PR branch, then run opencode
  opencode session             manage sessions
@rekram1-node commented on GitHub (Feb 11, 2026): the command is `upgrade` not update see: ``` $ opencode --help Commands: opencode completion generate shell completion script opencode acp start ACP (Agent Client Protocol) server opencode mcp manage MCP (Model Context Protocol) servers opencode [project] start opencode tui [default] opencode attach <url> attach to a running opencode server opencode run [message..] run opencode with a message opencode debug debugging and troubleshooting tools opencode auth manage credentials opencode agent manage agents opencode upgrade [target] upgrade opencode to the latest or a specific version opencode uninstall uninstall opencode and remove all related files opencode serve starts a headless opencode server opencode web start opencode server and open web interface opencode models [provider] list all available models opencode stats show token usage and cost statistics opencode export [sessionID] export session data as JSON opencode import <file> import session data from JSON file or URL opencode github manage GitHub agent opencode pr <number> fetch and checkout a GitHub PR branch, then run opencode opencode session manage sessions ```
Author
Owner

@whichLain commented on GitHub (Feb 11, 2026):

Sorry, I was stupid, and I still am.😭

@whichLain commented on GitHub (Feb 11, 2026): Sorry, I was stupid, and I still am.😭
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9103