Summary:
opencode fails to run in directories that don't contain an opencode/ subdirectory, with a misleading error message that doesn't explain the actual requirement.
Steps to Reproduce:
Navigate to any directory without an opencode/ subdirectory
Ensure opencode is properly authenticated (opencode auth login)
Run opencode
Expected Behavior:
opencode should either create the required opencode/ directory automatically, OR
Provide a clear error message explaining that an opencode/ directory is required and how to resolve it
Actual Behavior:
Error: Failed to change directory to /path/to/current/directory/opencode
Environment:
Directory tested: /opt/personal-repos/dev-stack and ~/personal-repos/dev-stack (symlink)
Authentication: Successfully completed with Claude
OS: cachyOS (arch based linux)
opencode version: 0.7.9
Workaround:
mkdir opencode
opencode # now works
Additional Notes:
The error message is misleading - initially appeared to be a symlink resolution issue
No documentation found explaining the opencode/ directory requirement
Error occurs regardless of symlinks (tested in both symlinked and direct paths)
Installation method: AUR via yay
Package version: 0.7.9-1
Summary:
opencode fails to run in directories that don't contain an opencode/ subdirectory, with a misleading error message that doesn't explain the actual requirement.
Steps to Reproduce:
Navigate to any directory without an opencode/ subdirectory
Ensure opencode is properly authenticated (opencode auth login)
Run opencode
Expected Behavior:
opencode should either create the required opencode/ directory automatically, OR
Provide a clear error message explaining that an opencode/ directory is required and how to resolve it
Actual Behavior:
Error: Failed to change directory to /path/to/current/directory/opencode
Environment:
Directory tested: /opt/personal-repos/dev-stack and ~/personal-repos/dev-stack (symlink)
Authentication: Successfully completed with Claude
OS: cachyOS (arch based linux)
opencode version: 0.7.9
Workaround:
mkdir opencode
opencode # now works
Additional Notes:
The error message is misleading - initially appeared to be a symlink resolution issue
No documentation found explaining the opencode/ directory requirement
Error occurs regardless of symlinks (tested in both symlinked and direct paths)
Installation method: AUR via yay
Package version: 0.7.9-1