Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit d341d26

Browse files
committed
update brew handling
1 parent d49b1b2 commit d341d26

4 files changed

Lines changed: 46 additions & 30 deletions

File tree

packages/console/app/src/routes/temp.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,19 @@ export default function Home() {
7979
<strong>LSP enabled</strong> Automatically loads the right LSPs for the LLM
8080
</li>
8181
<li>
82-
<strong>opencode zen</strong> A <a href="/docs/zen">curated list of models</a> provided by opencode{" "}
83-
<label>New</label>
82+
<strong>opencode zen</strong> A <a href="/docs/zen">curated list of models</a>{" "}
83+
provided by opencode <label>New</label>
8484
</li>
8585
<li>
8686
<strong>Multi-session</strong> Start multiple agents in parallel on the same project
8787
</li>
8888
<li>
89-
<strong>Shareable links</strong> Share a link to any sessions for reference or to debug
89+
<strong>Shareable links</strong> Share a link to any sessions for reference or to
90+
debug
9091
</li>
9192
<li>
92-
<strong>Claude Pro</strong> Log in with Anthropic to use your Claude Pro or Max account
93+
<strong>Claude Pro</strong> Log in with Anthropic to use your Claude Pro or Max
94+
account
9395
</li>
9496
<li>
9597
<strong>Use any model</strong> Supports 75+ LLM providers through{" "}
@@ -121,7 +123,7 @@ export default function Home() {
121123
<h3 data-component="title">homebrew</h3>
122124
<button data-copy data-slot="button">
123125
<span>
124-
brew install <strong>sst/tap/opencode</strong>
126+
brew install <strong>opencode</strong>
125127
</span>
126128
<CopyStatus />
127129
</button>

packages/opencode/src/installation/index.ts

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export namespace Installation {
7373
},
7474
{
7575
name: "brew" as const,
76-
command: () => $`brew list --formula opencode-ai`.throws(false).text(),
76+
command: () => $`brew list --formula opencode`.throws(false).text(),
7777
},
7878
]
7979

@@ -87,7 +87,7 @@ export namespace Installation {
8787

8888
for (const check of checks) {
8989
const output = await check.command()
90-
if (output.includes("opencode-ai")) {
90+
if (output.includes(check.name === "brew" ? "opencode" : "opencode-ai")) {
9191
return check.name
9292
}
9393
}
@@ -102,28 +102,42 @@ export namespace Installation {
102102
}),
103103
)
104104

105+
async function getBrewFormula() {
106+
const tapFormula = await $`brew list --formula sst/tap/opencode`.throws(false).text()
107+
if (tapFormula.includes("opencode")) return "sst/tap/opencode"
108+
const coreFormula = await $`brew list --formula opencode`.throws(false).text()
109+
if (coreFormula.includes("opencode")) return "opencode"
110+
return "opencode"
111+
}
112+
105113
export async function upgrade(method: Method, target: string) {
106-
const cmd = (() => {
107-
switch (method) {
108-
case "curl":
109-
return $`curl -fsSL https://opencode.ai/install | bash`.env({
110-
...process.env,
111-
VERSION: target,
112-
})
113-
case "npm":
114-
return $`npm install -g opencode-ai@${target}`
115-
case "pnpm":
116-
return $`pnpm install -g opencode-ai@${target}`
117-
case "bun":
118-
return $`bun install -g opencode-ai@${target}`
119-
case "brew":
120-
return $`brew install sst/tap/opencode`.env({
121-
HOMEBREW_NO_AUTO_UPDATE: "1",
122-
})
123-
default:
124-
throw new Error(`Unknown method: ${method}`)
114+
let cmd
115+
switch (method) {
116+
case "curl":
117+
cmd = $`curl -fsSL https://opencode.ai/install | bash`.env({
118+
...process.env,
119+
VERSION: target,
120+
})
121+
break
122+
case "npm":
123+
cmd = $`npm install -g opencode-ai@${target}`
124+
break
125+
case "pnpm":
126+
cmd = $`pnpm install -g opencode-ai@${target}`
127+
break
128+
case "bun":
129+
cmd = $`bun install -g opencode-ai@${target}`
130+
break
131+
case "brew": {
132+
const formula = await getBrewFormula()
133+
cmd = $`brew install ${formula}`.env({
134+
HOMEBREW_NO_AUTO_UPDATE: "1",
135+
})
136+
break
125137
}
126-
})()
138+
default:
139+
throw new Error(`Unknown method: ${method}`)
140+
}
127141
const result = await cmd.quiet().throws(false)
128142
log.info("upgraded", {
129143
method,

packages/web/src/components/Lander.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ if (image) {
109109
</div>
110110
<div class="col3">
111111
<h3>Homebrew</h3>
112-
<button class="command" data-command="brew install sst/tap/opencode">
112+
<button class="command" data-command="brew install opencode">
113113
<code>
114-
<span>brew install</span> <span class="highlight">sst/tap/opencode</span>
114+
<span>brew install</span> <span class="highlight">opencode</span>
115115
</code>
116116
<span class="copy">
117117
<CopyIcon />

packages/web/src/content/docs/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ You can also install it with the following commands:
6767
- **Using Homebrew on macOS and Linux**
6868

6969
```bash
70-
brew install sst/tap/opencode
70+
brew install opencode
7171
```
7272

7373
- **Using Paru on Arch Linux**

0 commit comments

Comments
 (0)