Add repository cloning script and update docs

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 <noreply@anthropic.com>
This commit is contained in:
Michael Mainguy 2025-11-23 10:46:14 -06:00
parent c3f301b799
commit e82bd1737d
3 changed files with 43 additions and 6 deletions

View File

@ -58,9 +58,22 @@ This removes the incompatible `onnxruntime-node` native module and configures th
## Initial Setup ## 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: Run the master indexing script to index documentation, API, and source code:
@ -69,10 +82,9 @@ npm run index:all
``` ```
This will: This will:
1. Clone the required repositories (Documentation, Babylon.js, havok) 1. Index all documentation files (~5-10 minutes)
2. Index all documentation files (~5-10 minutes) 2. Index API documentation from TypeScript source (~10-15 minutes)
3. Index API documentation from TypeScript source (~10-15 minutes) 3. Index source code from core packages (~15-20 minutes)
4. Index source code from core packages (~15-20 minutes)
Total indexing time: **30-45 minutes** depending on your system. Total indexing time: **30-45 minutes** depending on your system.

View File

@ -14,6 +14,7 @@
"test:run": "vitest run", "test:run": "vitest run",
"test:coverage": "vitest run --coverage", "test:coverage": "vitest run --coverage",
"alpine:setup": "sh scripts/alpine-setup.sh", "alpine:setup": "sh scripts/alpine-setup.sh",
"clone:repos": "tsx scripts/clone-repos.ts",
"index:docs": "tsx scripts/index-docs.ts", "index:docs": "tsx scripts/index-docs.ts",
"index:api": "tsx scripts/index-api.ts", "index:api": "tsx scripts/index-api.ts",
"index:source": "tsx scripts/index-source.ts", "index:source": "tsx scripts/index-source.ts",

24
scripts/clone-repos.ts Executable file
View File

@ -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();