Run OpenCode 2 from the stable Homebrew formula

Declare the opencode formula with link = false so it never replaces the
npm-installed OpenCode 1.x CLI at /opt/homebrew/bin/opencode. Drop the npm
beta install from home.activation.opencode2, point home/bin/oc2 at the keg
binary, and correct the related notes.
This commit is contained in:
Lap Tran committed 2026-11-08 12:15:22 -05:00
1 parent ec34fc005c
commit 1fda5c09b7
5 files changed
+18 -26

No files matched your search

+3 -3
View File
@@ -3,12 +3,12 @@
# ~/.config/opencode/opencode.json (OpenCode 1 / firstmate).
set -euo pipefail
bin="${OPENCODE2_BIN:-/opt/homebrew/bin/opencode2}"
bin="${OPENCODE2_BIN:-/opt/homebrew/opt/opencode/bin/opencode}"
cfg="${OPENCODE_CONFIG:-$HOME/.config/opencode2/opencode.json}"
if [ ! -x "$bin" ]; then
echo "oc2: opencode2 not installed. Rebuild, or run:" >&2
echo " /opt/homebrew/bin/npm install -g --allow-scripts=@opencode-ai/cli @opencode-ai/cli@beta" >&2
echo "oc2: stable opencode not installed. Rebuild, or run:" >&2
echo " brew install opencode" >&2
exit 1
fi
if [ ! -e "$cfg" ]; then