From e82bd1737d09264a76118b185f194bb16c1d0a39 Mon Sep 17 00:00:00 2001 From: Michael Mainguy Date: Sun, 23 Nov 2025 10:46:14 -0600 Subject: [PATCH] Add repository cloning script and update docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Created npm run clone:repos script to clone required Babylon.js repositories before indexing. Updated README to document the two-step setup process: 1. Clone repositories 2. Index all data This makes the setup process clearer and handles the missing repository error users were encountering. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- README.md | 24 ++++++++++++++++++------ package.json | 1 + scripts/clone-repos.ts | 24 ++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 6 deletions(-) create mode 100755 scripts/clone-repos.ts diff --git a/README.md b/README.md index 848e5a1..cf7d942 100644 --- a/README.md +++ b/README.md @@ -58,9 +58,22 @@ This removes the incompatible `onnxruntime-node` native module and configures th ## Initial Setup -Before using the MCP server, you need to index the Babylon.js repositories. This is a one-time setup process. +Before using the MCP server, you need to clone the Babylon.js repositories and index them. This is a one-time setup process. -### Index All Data (Recommended) +### Step 1: Clone Repositories + +Clone the required Babylon.js repositories: + +```bash +npm run clone:repos +``` + +This will clone: +- BabylonJS/Documentation (documentation site content) +- BabylonJS/Babylon.js (main framework source) +- BabylonJS/havok (physics engine) + +### Step 2: Index All Data (Recommended) Run the master indexing script to index documentation, API, and source code: @@ -69,10 +82,9 @@ npm run index:all ``` This will: -1. Clone the required repositories (Documentation, Babylon.js, havok) -2. Index all documentation files (~5-10 minutes) -3. Index API documentation from TypeScript source (~10-15 minutes) -4. Index source code from core packages (~15-20 minutes) +1. Index all documentation files (~5-10 minutes) +2. Index API documentation from TypeScript source (~10-15 minutes) +3. Index source code from core packages (~15-20 minutes) Total indexing time: **30-45 minutes** depending on your system. diff --git a/package.json b/package.json index 535cb88..4a06711 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "test:run": "vitest run", "test:coverage": "vitest run --coverage", "alpine:setup": "sh scripts/alpine-setup.sh", + "clone:repos": "tsx scripts/clone-repos.ts", "index:docs": "tsx scripts/index-docs.ts", "index:api": "tsx scripts/index-api.ts", "index:source": "tsx scripts/index-source.ts", diff --git a/scripts/clone-repos.ts b/scripts/clone-repos.ts new file mode 100755 index 0000000..6a4d47c --- /dev/null +++ b/scripts/clone-repos.ts @@ -0,0 +1,24 @@ +#!/usr/bin/env tsx + +import { RepositoryManager } from '../src/mcp/repository-manager.js'; +import { BABYLON_REPOSITORIES } from '../src/mcp/repository-config.js'; + +async function main() { + console.log('Cloning/updating Babylon.js repositories...\n'); + + const repoManager = new RepositoryManager(); + + for (const repo of BABYLON_REPOSITORIES) { + try { + await repoManager.ensureRepository(repo); + console.log(`✓ ${repo.name} ready\n`); + } catch (error) { + console.error(`✗ Failed to setup ${repo.name}:`, error); + process.exit(1); + } + } + + console.log('✓ All repositories ready!'); +} + +main();