#!/usr/bin/env bash
#
# domin8 setup helper for Continue integration
#
# This script helps configure domin8 to work with the Continue VS Code extension
set -e
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
REPO_ROOT="$( cd "$SCRIPT_DIR/.." && pwd )"
echo "đ§ domin8 Setup for Continue Integration"
echo "========================================"
echo ""
# Check if Continue is installed
if [ ! -d "$HOME/.continue" ]; then
echo "â ī¸ Continue directory not found at ~/.continue"
echo " Please install the Continue VS Code extension first:"
echo " https://marketplace.visualstudio.com/items?itemName=Continue.continue"
echo ""
read -p "Press Enter to continue anyway (will create config) or Ctrl+C to exit..."
mkdir -p "$HOME/.continue"
fi
# Check if uv is installed
if ! command -v uv &> /dev/null; then
echo "â Error: 'uv' command not found"
echo " Please install uv: https://github.com/astral-sh/uv"
exit 1
fi
# Check if domin8 server module can be imported
if ! python -c "import importlib; importlib.import_module('domin8.server')" &> /dev/null; then
echo "â Error: domin8.server module not importable"
echo " Please run: cd $REPO_ROOT && uv sync"
exit 1
fi
echo "â
Found uv and domin8 server module"echo ""
# Create or update Continue config
CONTINUE_CONFIG="$HOME/.continue/config.json"
if [ -f "$CONTINUE_CONFIG" ]; then
echo "đ Found existing Continue config at $CONTINUE_CONFIG"
echo " Creating backup: $CONTINUE_CONFIG.backup"
cp "$CONTINUE_CONFIG" "$CONTINUE_CONFIG.backup"
fi
echo "đ Writing MCP server configuration..."
# Create the config
cat > "$CONTINUE_CONFIG" << EOF
{
"mcpServers": {
"domin8": {
"command": "uv",
"args": ["run", "python", "-m", "domin8.server"],
"cwd": "$REPO_ROOT",
"env": {
"PYTHONUNBUFFERED": "1"
}
}
}
}
EOF
echo "â
Configuration written to $CONTINUE_CONFIG"
echo ""
# Offer to install pre-commit hook
if [ -d "$REPO_ROOT/.git" ]; then
if [ ! -f "$REPO_ROOT/.git/hooks/pre-commit" ]; then
read -p "đ Install pre-commit hook for artifact validation? (y/n) " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]; then
ln -s "../../scripts/pre-commit" "$REPO_ROOT/.git/hooks/pre-commit"
chmod +x "$REPO_ROOT/.git/hooks/pre-commit"
echo "â
Pre-commit hook installed"
fi
else
echo "âšī¸ Pre-commit hook already exists"
fi
fi
echo ""
echo "đ Setup complete!"
echo ""
echo "Next steps:"
echo "1. Restart VS Code (or reload the Continue extension)"
echo "2. Review artifacts via Continue's approval prompt (MCP elicitation)"
echo "3. Open Continue sidebar (Cmd+L or Ctrl+L)"
echo "4. Try: 'Add a comment to README.md explaining the project'"
echo ""
echo "đ Documentation:"
echo " Continue Integration: $REPO_ROOT/docs/CONTINUE_INTEGRATION.md"
echo " Implementation Guide: $REPO_ROOT/docs/IMPLEMENTATION.md"
echo ""