opencode github install fails for repositories cloned with SSH aliases #6737

Open
opened 2026-02-16 18:05:06 -05:00 by yindo · 2 comments
Owner

Originally created by @ManuSanchez02 on GitHub (Jan 18, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

When running opencode github install in a repository that was cloned using an SSH alias (e.g., git clone git@myalias:owner/repo), the command fails with:

Could not find git repository. Please run this command from a git repository.

Plugins

None

OpenCode version

1.1.25

Steps to reproduce

  1. Edit ~/.ssh/config and add the following:
Host myalias
    HostName github.com
    User git
  1. Clone a repository with git clone git@myalias:owner/repo
  2. cd into the cloned repository
  3. Run opencode github install

Screenshot and/or share link

Image

Operating System

Ubuntu 24.04.3 LTS

Terminal

Gnome Terminal

Originally created by @ManuSanchez02 on GitHub (Jan 18, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description When running opencode github install in a repository that was cloned using an SSH alias (e.g., git clone git@myalias:owner/repo), the command fails with: ``` Could not find git repository. Please run this command from a git repository. ``` ### Plugins None ### OpenCode version 1.1.25 ### Steps to reproduce 1. Edit ~/.ssh/config and add the following: ``` Host myalias HostName github.com User git ``` 2. Clone a repository with `git clone git@myalias:owner/repo` 3. `cd` into the cloned repository 4. Run `opencode github install` ### Screenshot and/or share link <img width="1252" height="245" alt="Image" src="https://github.com/user-attachments/assets/f2720836-cce9-4b86-aa30-44ec9a1b052b" /> ### Operating System Ubuntu 24.04.3 LTS ### Terminal Gnome Terminal
yindo added the bug label 2026-02-16 18:05:06 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 18, 2026):

This issue might be a duplicate of existing issues. Please check:

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

This issue describes the same error message and underlying problem where the opencode github install command fails to detect a valid git repository, though the cause in that issue appears to be related to homebrew/macOS setup rather than SSH aliases specifically.

Feel free to ignore if this doesn't address your specific case.

@github-actions[bot] commented on GitHub (Jan 18, 2026): This issue might be a duplicate of existing issues. Please check: - #7787: [BUG] opencode github install - "Could not find git repository" in valid git repo This issue describes the same error message and underlying problem where the `opencode github install` command fails to detect a valid git repository, though the cause in that issue appears to be related to homebrew/macOS setup rather than SSH aliases specifically. Feel free to ignore if this doesn't address your specific case.
Author
Owner

@ManuSanchez02 commented on GitHub (Jan 18, 2026):

I can take this one

@ManuSanchez02 commented on GitHub (Jan 18, 2026): I can take this one
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6737