progress 235b
This commit is contained in:
@@ -11,9 +11,11 @@
|
||||
# 4. Install Serena (uv tool — LSP-backed code navigation MCP)
|
||||
# 5. Wire basic-memory's storage to the Obsidian vault's AI-memory folder
|
||||
# 6. Install github-mcp-server + check for GITHUB_PERSONAL_ACCESS_TOKEN
|
||||
# 7. Install task-master-ai (workflow MCP)
|
||||
# 8. Install the Phoenix bridge plugin's OTel deps
|
||||
# 9. Generate ~/.config/opencode/opencode.json from the repo's
|
||||
# 7. Install kagimcp (uv tool) + check for KAGI_API_KEY — replaces SearXNG
|
||||
# as the primary search MCP; same key powers OpenWebUI's web search
|
||||
# 8. Install task-master-ai (workflow MCP)
|
||||
# 9. Install the Phoenix bridge plugin's OTel deps
|
||||
# 10. Generate ~/.config/opencode/opencode.json from the repo's
|
||||
# opencode.json with relative plugin paths rewritten to absolute,
|
||||
# so opencode loads the plugin regardless of where it's launched.
|
||||
#
|
||||
@@ -32,14 +34,14 @@ warn() { printf ' \033[33m!\033[0m %s\n' "$*"; }
|
||||
fail() { printf ' \033[31m✗\033[0m %s\n' "$*"; exit 1; }
|
||||
|
||||
# --- 1. Homebrew -------------------------------------------------------------
|
||||
bold "[1/9] Homebrew"
|
||||
bold "[1/10] Homebrew"
|
||||
if ! command -v brew >/dev/null 2>&1; then
|
||||
fail "brew not found. Install from https://brew.sh, then re-run."
|
||||
fi
|
||||
ok "brew $(brew --version | head -1 | awk '{print $2}')"
|
||||
|
||||
# --- 2. CLI deps -------------------------------------------------------------
|
||||
bold "[2/9] CLI dependencies"
|
||||
bold "[2/10] CLI dependencies"
|
||||
brew_install_if_missing() {
|
||||
local pkg="$1"
|
||||
local bin="${2:-$1}"
|
||||
@@ -64,7 +66,7 @@ else
|
||||
fi
|
||||
|
||||
# --- 3. Playwright browsers --------------------------------------------------
|
||||
bold "[3/9] Playwright browser cache"
|
||||
bold "[3/10] Playwright browser cache"
|
||||
PW_CACHE="${HOME}/Library/Caches/ms-playwright"
|
||||
if [[ -d "$PW_CACHE" ]] && find "$PW_CACHE" -name "chrome" -o -name "Chromium*" 2>/dev/null | grep -q .; then
|
||||
ok "browsers already cached at $PW_CACHE"
|
||||
@@ -79,7 +81,7 @@ fi
|
||||
# start-mcp-server ...` without paying uvx's resolution cost on every
|
||||
# session start. --prerelease=allow is required because serena-agent
|
||||
# ships pre-1.0 versions.
|
||||
bold "[4/9] Serena MCP"
|
||||
bold "[4/10] Serena MCP"
|
||||
if uv tool list 2>/dev/null | awk '{print $1}' | grep -qx 'serena-agent'; then
|
||||
ok "serena-agent already installed ($(serena --version 2>/dev/null | head -1 || echo 'version unknown'))"
|
||||
else
|
||||
@@ -97,7 +99,7 @@ fi
|
||||
# at a folder inside the Obsidian vault via symlink so the AI's notes
|
||||
# show up in Obsidian's graph and search. Symlink (not env var) chosen
|
||||
# because it's stable across basic-memory's evolving config schema.
|
||||
bold "[5/9] basic-memory storage"
|
||||
bold "[5/10] basic-memory storage"
|
||||
AI_MEM_PATH="${HOME}/Documents/obsidian/AI-memory"
|
||||
if [[ ! -d "$AI_MEM_PATH" ]]; then
|
||||
info "creating $AI_MEM_PATH"
|
||||
@@ -129,7 +131,7 @@ fi
|
||||
# for a local 70B's effective context. Token itself is NOT in opencode.json
|
||||
# (it's git-tracked); github-mcp-server inherits GITHUB_PERSONAL_ACCESS_TOKEN
|
||||
# from the user's shell env.
|
||||
bold "[6/9] github-mcp-server"
|
||||
bold "[6/10] github-mcp-server"
|
||||
brew_install_if_missing github-mcp-server github-mcp-server
|
||||
if [[ -z "${GITHUB_PERSONAL_ACCESS_TOKEN:-}" ]]; then
|
||||
warn "GITHUB_PERSONAL_ACCESS_TOKEN is not set in your shell environment."
|
||||
@@ -145,12 +147,41 @@ else
|
||||
ok "GITHUB_PERSONAL_ACCESS_TOKEN is set in this shell"
|
||||
fi
|
||||
|
||||
# --- 7. claude-task-master (workflow MCP, npm global) -----------------------
|
||||
# --- 7. Kagi MCP (web search via Kagi's Search API) -------------------------
|
||||
# Official kagimcp from kagisearch/kagimcp. Installed as a uv tool so opencode
|
||||
# can launch it as `uvx kagimcp` without per-session resolution cost. Replaces
|
||||
# the SearXNG MCP as the primary search provider (SearXNG kept disabled in
|
||||
# opencode.json as fallback). The same KAGI_API_KEY also powers
|
||||
# RAG_WEB_SEARCH_ENGINE=kagi in OpenWebUI on the framework box — one key,
|
||||
# two consumers.
|
||||
bold "[7/10] Kagi MCP"
|
||||
if uv tool list 2>/dev/null | awk '{print $1}' | grep -qx 'kagimcp'; then
|
||||
ok "kagimcp already installed"
|
||||
else
|
||||
info "installing kagimcp via uv tool (~20s first run)"
|
||||
uv tool install kagimcp
|
||||
ok "kagimcp installed"
|
||||
fi
|
||||
if [[ -z "${KAGI_API_KEY:-}" ]]; then
|
||||
warn "KAGI_API_KEY is not set in your shell environment."
|
||||
warn " opencode's kagi MCP will fail to launch."
|
||||
warn " Fix:"
|
||||
warn " 1. Get an API key at https://kagi.com/settings?p=api (paid)."
|
||||
warn " 2. Add to ~/.zshrc:"
|
||||
warn " export KAGI_API_KEY=<your-key>"
|
||||
warn " 3. Re-source the shell (or open a new terminal) before launching opencode."
|
||||
warn " 4. Put the same key in /srv/docker/openwebui/.env as KAGI_API_KEY=<your-key>"
|
||||
warn " on the framework box so OpenWebUI's web search works too."
|
||||
else
|
||||
ok "KAGI_API_KEY is set in this shell"
|
||||
fi
|
||||
|
||||
# --- 8. claude-task-master (workflow MCP, npm global) -----------------------
|
||||
# task-master-ai: workflow/task-gate MCP. File-based (.taskmaster/ in each
|
||||
# project), no DB, no external service. opencode.json launches it via
|
||||
# `npx -y task-master-ai`; the global install also provides the `task-master`
|
||||
# CLI (`task-master init` to scaffold a project's tasks).
|
||||
bold "[7/9] claude-task-master"
|
||||
bold "[8/10] claude-task-master"
|
||||
if command -v task-master >/dev/null 2>&1; then
|
||||
ok "task-master-ai already installed ($(task-master --version 2>/dev/null | head -1 || echo 'version unknown'))"
|
||||
else
|
||||
@@ -160,7 +191,7 @@ else
|
||||
fi
|
||||
|
||||
# --- 8. Phoenix bridge plugin deps ------------------------------------------
|
||||
bold "[8/9] Phoenix bridge plugin deps"
|
||||
bold "[9/10] Phoenix bridge plugin deps"
|
||||
if [[ -d ".opencode/plugin/node_modules" && -f ".opencode/plugin/package-lock.json" ]]; then
|
||||
# Re-run npm install if package.json is newer than the lockfile, otherwise skip.
|
||||
if [[ ".opencode/plugin/package.json" -nt ".opencode/plugin/package-lock.json" ]]; then
|
||||
@@ -181,7 +212,7 @@ fi
|
||||
# in-place. Rewriting them to absolute paths here makes opencode find the
|
||||
# plugin regardless of which directory it was launched from. Re-run this
|
||||
# script after editing opencode.json.
|
||||
bold "[9/9] Deploy global config"
|
||||
bold "[10/10] Deploy global config"
|
||||
mkdir -p "${HOME}/.config/opencode"
|
||||
src="${HERE}/opencode.json"
|
||||
dst="${HOME}/.config/opencode/opencode.json"
|
||||
|
||||
Reference in New Issue
Block a user