mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
Manager builds against and requires OpenCode 2.2.5. Every @opencode package, plus effect and the OpenTUI/solid dependencies they share, resolves from one pnpm workspace catalog instead of separate pins. The built-against version and the supported floor are now separate settings, so a future OpenCode release can move the pin before raising the floor. Docker and the dev setup script read the floor from its own argument. ocm-cli moves to 0.6.0 on the same 2.2.5 and OpenTUI 0.8 baseline. A linked server on a different version is still connectable and now shows a neutral version notice instead of an unsupported badge.
84 lines
2.5 KiB
Bash
84 lines
2.5 KiB
Bash
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
echo "🔍 Checking prerequisites..."
|
|
|
|
# Check if pnpm is installed (required for workspaces)
|
|
if ! command -v pnpm &> /dev/null; then
|
|
echo "❌ pnpm is not installed. Please install it with:"
|
|
echo " npm install -g pnpm"
|
|
exit 1
|
|
fi
|
|
|
|
echo "✅ pnpm is installed"
|
|
|
|
# Check if Bun is installed (required for backend)
|
|
if ! command -v bun &> /dev/null; then
|
|
echo "❌ Bun is not installed. Please install it from https://bun.sh"
|
|
exit 1
|
|
fi
|
|
|
|
echo "✅ Bun is installed"
|
|
|
|
# Check if Git is installed
|
|
if ! git --version &> /dev/null; then
|
|
echo "❌ Git is not installed. Please install Git and try again."
|
|
exit 1
|
|
fi
|
|
|
|
echo "✅ Git is installed"
|
|
|
|
# Check if OpenCode TUI is installed
|
|
if ! opencode --version &> /dev/null; then
|
|
echo "❌ OpenCode TUI is not installed. Please install it with:"
|
|
echo " curl -fsSL https://opencode.ai/v2/install | bash"
|
|
exit 1
|
|
fi
|
|
|
|
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
source "$REPO_ROOT/scripts/lib/opencode-release.sh"
|
|
OPENCODE_SUPPORTED_FLOOR="$(sed -n 's/^ARG OPENCODE_MIN_VERSION=//p' "$REPO_ROOT/Dockerfile" | head -1)"
|
|
OPENCODE_VERSION_OUTPUT="$(opencode --version 2>&1)" || OPENCODE_VERSION_OUTPUT=""
|
|
OPENCODE_VERSION="$(parse_opencode_version_output "$OPENCODE_VERSION_OUTPUT")"
|
|
|
|
if [ -z "$OPENCODE_SUPPORTED_FLOOR" ] || ! is_supported_opencode_version "$OPENCODE_VERSION"; then
|
|
echo "❌ OpenCode ${OPENCODE_VERSION:-unknown} is not supported; OpenCode $(supported_opencode_range) is required. Please install it with:"
|
|
echo " curl -fsSL https://opencode.ai/v2/install | bash"
|
|
exit 1
|
|
fi
|
|
|
|
echo "✅ OpenCode TUI is installed"
|
|
|
|
# Create workspace directory if it doesn't exist
|
|
WORKSPACE_PATH="./workspace"
|
|
if [ ! -d "$WORKSPACE_PATH" ]; then
|
|
echo "📁 Creating workspace directory at $WORKSPACE_PATH..."
|
|
mkdir -p "$WORKSPACE_PATH/repos"
|
|
echo "✅ Workspace directory created"
|
|
else
|
|
echo "✅ Workspace directory exists"
|
|
fi
|
|
|
|
# Install dependencies using pnpm (handles workspaces)
|
|
echo "📦 Installing dependencies..."
|
|
pnpm install
|
|
|
|
echo "✅ Dependencies installed"
|
|
|
|
# Copy environment file if it doesn't exist
|
|
if [ ! -f ".env" ]; then
|
|
echo "📝 Creating environment file..."
|
|
cp .env.example .env
|
|
echo "✅ Environment file created from .env.example"
|
|
else
|
|
echo "✅ Environment file exists"
|
|
fi
|
|
|
|
echo "✅ Dev environment ready!"
|
|
echo ""
|
|
echo "🚀 To start development:"
|
|
echo " pnpm dev # Start both backend and frontend"
|
|
echo " pnpm dev:backend # Start backend only"
|
|
echo " pnpm dev:frontend # Start frontend only"
|