#!/bin/bash
set -e
echo "๐ Setting up MCP-Prompts..."
# Check and install required tools
check_and_install_tool() {
if ! command -v $1 &> /dev/null; then
echo "๐ฆ Installing $1..."
npm install -g $1
fi
}
check_and_install_tool pnpm
check_and_install_tool typescript
check_and_install_tool ts-node
# Create required directories
echo "๐ Creating project structure..."
mkdir -p {data/{prompts,backups},packages/{core,contracts,adapters-{mdc,file,memory,postgres}}}
# Setup Git hooks
echo "๐ง Setting up Git hooks..."
mkdir -p .git/hooks
cat > .git/hooks/pre-commit << 'EOL'
#!/bin/bash
npm run lint
npm run typecheck
EOL
chmod +x .git/hooks/pre-commit
# Install dependencies
echo "๐ฆ Installing dependencies..."
pnpm install --frozen-lockfile
# Build packages
echo "๐จ Building packages..."
pnpm run build
# Run tests
echo "๐งช Running tests..."
pnpm run test
# Generate documentation
echo "๐ Generating documentation..."
pnpm run docs
echo "โ
Setup complete! Run 'pnpm start' to launch the server."