opencode icon indicating copy to clipboard operation
opencode copied to clipboard

[BUG] opencode github install - "Could not find git repository" in valid git repo

Open PrakharMNNIT opened this issue 3 days ago • 1 comments

Description

The opencode github install command fails with the error "Could not find git repository" even when executed from inside a valid git repository where git status works correctly.

The .git directory exists, all git commands work as expected, but the opencode github install command cannot detect the repository.

OpenCode version

1.1.13

Steps to reproduce

  1. Navigate to a valid git repository:

    cd ~/path/to/repo
    
  2. Confirm git is working:

    git status
    # Output: On branch master, Your branch is up to date with 'origin/master'.
    
  3. Verify .git directory exists:

    ls -la .git
    # Shows valid .git directory with all expected contents
    
  4. Run the install command:

    opencode github install
    
  5. Result: Error message appears:

    ┌  Install GitHub agent
    │
    ■  Could not find git repository. Please run this command from a git repository.
    

Screenshot and/or share link

N/A - Error is text-based and reproduced above.

Operating System

macOS 26.2 (Build 25C56)

Terminal

iTerm2

Additional Context

  • OpenCode installed via Homebrew (/opt/homebrew/bin/opencode)
  • The repository has a remote configured (origin/master)
  • All standard git operations work correctly
  • Tried running from both the repository root and parent directories with same result

PrakharMNNIT avatar Jan 11 '26 12:01 PrakharMNNIT