Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

fix(installer): correct opencode installation path to use user home directory#23

Open
elCorbacho wants to merge 1 commit intoGentleman-Programming:mainfrom
elCorbacho:fix/opencode-install-path
Open

fix(installer): correct opencode installation path to use user home directory#23
elCorbacho wants to merge 1 commit intoGentleman-Programming:mainfrom
elCorbacho:fix/opencode-install-path

Conversation

@elCorbacho
Copy link
Copy Markdown
Contributor

Summary

Fix OpenCode installation path to respect XDG Base Directory specification and ensure consistent behavior across all platforms.

Problem

OpenCode installation was using inconsistent paths:

  • Windows: %APPDATA%/opencode (incorrect - application data directory)
  • macOS/Linux: ~/.config/opencode (correct - user config directory)

This inconsistency caused installation failures and configuration lookup issues, as users expected the configuration files to be in their home directory following standard conventions.

Solution

Standardized OpenCode installation path to use user home directory on all platforms:

  • Windows: %USERPROFILE%/.config/opencode (NEW)
  • macOS/Linux: ~/.config/opencode (unchanged)

This aligns with the XDG Base Directory specification and ensures the same directory structure across all platforms.

Changes Made

Files Modified

  • scripts/install.ps1 (6 changes)

    • Updated \$ToolPaths['opencode'] and \$ToolPaths['opencode-commands'] to use \$USERPROFILE\.config\opencode
    • Updated user-facing messages to display correct installation paths (lines 261, 306)
  • scripts/install.sh (2 changes)

    • Updated Windows path in get_tool_path() function for both opencode and opencode-commands

Impact

  • Breaking Change: No - existing installations won't be affected; only new installations will use the new path
  • Migration Path: Users with existing installations in %APPDATA%/opencode should manually move their configuration to ~/.config/opencode
  • Documentation: User-facing messages now correctly show ~/.config/opencode path

Testing

  • ✅ Verified PowerShell script syntax
  • ✅ Verified Bash script syntax
  • ✅ Confirmed path resolution for all platforms (Windows, macOS, Linux)
  • ✅ Verified macOS/Linux paths unchanged (already XDG-compliant)

Related Issues

Fixes installation path inconsistency between platforms


…irectory

Change OpenCode installation path from AppData (Windows) and system-level
directories to user home directory (.config/opencode) on all platforms for
consistency with standard XDG Base Directory specification.

Platform Changes:
- Windows: %APPDATA%/opencode → %USERPROFILE%/.config/opencode
- macOS/Linux: Already using ~/.config/opencode (no change needed)

Files Modified:
- scripts/install.ps1: Updated $ToolPaths and display messages
- scripts/install.sh: Updated Windows path in get_tool_path function

This ensures OpenCode skills and configuration files are installed in the
user home directory across all platforms, improving portability and
consistency with standard configuration directory conventions.
Copilot AI review requested due to automatic review settings March 7, 2026 23:12
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR standardizes the Windows OpenCode install location to align with the existing ~/.config/opencode convention used on macOS/Linux, by switching Windows installs from %APPDATA%\opencode\... to %USERPROFILE%\.config\opencode\....

Changes:

  • Updated the Windows OpenCode and OpenCode-commands paths in the Bash installer’s get_tool_path() to use $USERPROFILE/.config/opencode/....
  • Updated the PowerShell installer’s $ToolPaths entries for OpenCode and OpenCode commands to use $env:USERPROFILE\.config\opencode\....
  • Updated PowerShell user-facing “next steps” messages to show the new OpenCode config path.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
scripts/install.sh Switches Windows OpenCode paths from $APPDATA/opencode/... to $USERPROFILE/.config/opencode/... in get_tool_path().
scripts/install.ps1 Switches OpenCode install targets from $env:APPDATA\opencode\... to $env:USERPROFILE\.config\opencode\... and updates displayed instructions accordingly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants