-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_locally.sh
45 lines (39 loc) · 1.25 KB
/
run_locally.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# Check for required dependencies
#--------------------------------
# Check for Node.js
if ! command -v node &> /dev/null; then
echo "❌ Node.js is required but not installed. Please install Node.js first."
exit 1
fi
# Check for npm
if ! command -v npm &> /dev/null; then
echo "❌ npm is required but not installed. Please install npm first."
exit 1
fi
# Install project dependencies
#---------------------------
echo "📦 Installing dependencies..."
npm init -y
npm install repomix @langchain/anthropic dotenv zod ts-node typescript
# Configure package.json
#---------------------
echo "📝 Adding npm script..."
node -e "
const fs = require('fs');
const pkg = require('./package.json');
pkg.scripts = pkg.scripts || {};
pkg.scripts.repomap = 'ts-node generateRepomap.ts';
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2));
"
# Set up environment configuration
#------------------------------
if [ ! -f .env ]; then
echo "⚠️ No .env file found. Creating template..."
echo "LLM_API_KEY=your_anthropic_key_here" > .env
echo "Please edit .env with your actual Anthropic API key"
fi
echo "✅ Setup complete! You can now run:"
echo "npm run repomap [directory]"
echo "or"
echo "./generateRepomap.ts [directory]"