Skip to content

opencode fails when opencode/ subdirectory is missing from repo #2591

@brianluby

Description

@brianluby

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions