Files
dotfiles/home/bin/oc2
T
Lap Tran 4c6e85c97c Switch firstmate to OpenCode 2 and refresh nix-darwin pins
Point fm at the isolated oc2 wrapper, upgrade Homebrew packages on rebuild, and declare ffmpeg, docker-desktop, puremac, utm, node, and tea. Update nixpkgs, home-manager, and nix-homebrew locks. Track Pi agent config, crew-dispatch, and the Gitea PR helper that home.nix already expected.
2026-09-18 13:58:49 -04:00

21 lines
627 B
Bash
Executable File

#!/usr/bin/env bash
# Launch OpenCode 2 with an isolated config so it cannot rewrite
# ~/.config/opencode/opencode.json (OpenCode 1 / firstmate).
set -euo pipefail
bin="${OPENCODE2_BIN:-/opt/homebrew/bin/opencode2}"
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
exit 1
fi
if [ ! -e "$cfg" ]; then
echo "oc2: missing config $cfg (managed by home.nix)" >&2
exit 1
fi
export OPENCODE_CONFIG="$cfg"
exec "$bin" "$@"