[PR #15197] [MERGED] launch/opencode: detect curl installed opencode at ~/.opencode/bin #20340

Closed
opened 2026-04-16 07:33:39 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15197
Author: @hoyyeva
Created: 4/1/2026
Status: Merged
Merged: 4/8/2026
Merged by: @hoyyeva

Base: mainHead: hoyyeva/opencode-curl-detection


📝 Commits (7)

  • c592b4a launch/opencode: detect curl installed opencode at ~/.opencode/bin
  • fef4069 add windows
  • 1b5d0fa clean up
  • a9ff99c replace findPath method with simple package level functions
  • 4d5677f fix test
  • da8581d address comment
  • 67eaa87 update function name

📊 Changes

3 files changed (+62 additions, -4 deletions)

View changed files

📝 cmd/launch/opencode.go (+25 -2)
📝 cmd/launch/opencode_test.go (+35 -0)
📝 cmd/launch/registry.go (+2 -2)

📄 Description

  • When opencode is installed via curl -fsSL https://opencode.ai/install | bash, the binary is placed at ~/.opencode/bin/opencode. However, ollama launch only sees the current process's PATH — so the binary
    isn't detected until the user opens a new shell session.

  • Add a findPath() method (matching the existing pattern in claude.go) that checks PATH first, then falls back to ~/.opencode/bin/opencode. Wire it into both CheckInstalled and Run.

  • npm install is not affected since npm places the binary in a directory already on PATH.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/15197 **Author:** [@hoyyeva](https://github.com/hoyyeva) **Created:** 4/1/2026 **Status:** ✅ Merged **Merged:** 4/8/2026 **Merged by:** [@hoyyeva](https://github.com/hoyyeva) **Base:** `main` ← **Head:** `hoyyeva/opencode-curl-detection` --- ### 📝 Commits (7) - [`c592b4a`](https://github.com/ollama/ollama/commit/c592b4acabc7c12707b885f0a4a1c81804c35fb9) launch/opencode: detect curl installed opencode at ~/.opencode/bin - [`fef4069`](https://github.com/ollama/ollama/commit/fef4069a45e5c451dd1e3d4002ed2e692935c7db) add windows - [`1b5d0fa`](https://github.com/ollama/ollama/commit/1b5d0fad0d2cbbc269c2b6053c59234c5ff4dd46) clean up - [`a9ff99c`](https://github.com/ollama/ollama/commit/a9ff99c94b3f55951926de84e4d7dfd8a30d327a) replace findPath method with simple package level functions - [`4d5677f`](https://github.com/ollama/ollama/commit/4d5677fd5e4149e21b324e5bc8fb78db9b763220) fix test - [`da8581d`](https://github.com/ollama/ollama/commit/da8581db6d4e1637a8c31820c2490e5106e0bcde) address comment - [`67eaa87`](https://github.com/ollama/ollama/commit/67eaa87da32f7e76e5ad12b8d27d02354d472c93) update function name ### 📊 Changes **3 files changed** (+62 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `cmd/launch/opencode.go` (+25 -2) 📝 `cmd/launch/opencode_test.go` (+35 -0) 📝 `cmd/launch/registry.go` (+2 -2) </details> ### 📄 Description - When opencode is installed via `curl -fsSL https://opencode.ai/install | bash`, the binary is placed at `~/.opencode/bin/opencode`. However, `ollama launch` only sees the current process's PATH — so the binary isn't detected until the user opens a new shell session. - Add a findPath() method (matching the existing pattern in claude.go) that checks PATH first, then falls back to `~/.opencode/bin/opencode`. Wire it into both CheckInstalled and Run. - npm install is not affected since npm places the binary in a directory already on PATH. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-16 07:33:39 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#20340