Files

46 lines
2.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Installs developer tools if missing and checks Ollama, the model and OpenCode. Safe to re-run.
set -euo pipefail
[[ "$(uname -s)" == "Darwin" && "$(uname -m)" == "arm64" ]] || { echo "Sprachmittler requires an Apple Silicon Mac." >&2; exit 1; }
xcode-select -p >/dev/null 2>&1 || { echo "Install Xcode 16+ and run: xcode-select --install" >&2; exit 1; }
if ! command -v brew >/dev/null; then
echo "Homebrew not found: install from https://brew.sh or install the tools below manually." >&2
exit 1
fi
for tool in xcodegen swiftformat swiftlint xcbeautify ripgrep jq; do
bin=$tool; [[ $tool == ripgrep ]] && bin=rg
if command -v "$bin" >/dev/null; then echo "✓ $tool"; else echo "→ installing $tool"; brew install "$tool"; fi
done
if command -v ollama >/dev/null; then
echo "✓ ollama $(ollama --version 2>/dev/null | awk '{print $NF}')"
if curl -fsS --max-time 3 http://127.0.0.1:11434/api/version >/dev/null 2>&1; then
echo "✓ ollama server reachable on 127.0.0.1:11434"
if ollama list 2>/dev/null | grep -qi 'hy-mt3'; then
echo "✓ Hy-MT3 model installed:"
ollama list 2>/dev/null | grep -i 'hy-mt3' | awk '{print " " $1 " " $3 " " $4}'
else
echo "! no Hy-MT3 model installed. Pull one:"
echo " ollama pull hf.co/tencent/Hy-MT3-7B-GGUF:Q4_K_M # about 5.15 GB"
echo " ollama pull hf.co/tencent/Hy-MT3-1.8B-GGUF:Q4_K_M # about 1.35 GB (Fast)"
fi
else
echo "! ollama server not running: start the Ollama app or run 'ollama serve'"
fi
else
echo "! ollama not found: install from https://ollama.com/download"
fi
if command -v opencode >/dev/null; then
v=$(opencode --version 2>/dev/null | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+' | head -1 || true)
if [[ "${v%%.*}" == "2" ]]; then echo "✓ opencode $v"; else echo "! opencode ${v:-unknown}: this kit targets OpenCode 2.x (docs/OPENCODE_V2.md)"; fi
else
echo "! opencode not found: see https://opencode.ai/docs/ (this kit targets 2.x)"
fi
swift --version 2>/dev/null | head -1
echo "Bootstrap complete. Next: make doctor && make generate && make verify"