forked from tambo-ai/tambo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconductor-setup.sh
More file actions
executable file
·65 lines (53 loc) · 1.96 KB
/
conductor-setup.sh
File metadata and controls
executable file
·65 lines (53 loc) · 1.96 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
set -e
echo "🚀 Setting up Tambo workspace..."
# Check if npm is available
if ! command -v npm &> /dev/null; then
echo "❌ Error: npm is not installed. Please install Node.js >=22 and npm >=11"
exit 1
fi
# Check Node version
NODE_VERSION=$(node -v | cut -d'v' -f2 | cut -d'.' -f1)
if [ "$NODE_VERSION" -lt 22 ]; then
echo "❌ Error: Node.js version must be >=22 (current: $(node -v))"
exit 1
fi
# Install dependencies
echo "📦 Installing dependencies..."
npm ci
# Setup .env files
echo "🔧 Setting up environment files..."
# Helper function to setup .env file
setup_env_file() {
local path="$1"
local warning="$2"
# Skip if directory doesn't exist
if [ ! -d "$path" ]; then
return
fi
if [ -f "$CONDUCTOR_ROOT_PATH/$path/.env" ]; then
echo " - Copying $path/.env from root repo..."
cp "$CONDUCTOR_ROOT_PATH/$path/.env" "$path/.env"
elif [ ! -f "$path/.env" ] && [ -f "$path/.env.example" ]; then
echo " - Creating $path/.env from example..."
cp "$path/.env.example" "$path/.env"
if [ -n "$warning" ]; then
echo "⚠️ WARNING: $warning"
fi
fi
}
setup_env_file "showcase" "You need to add your NEXT_PUBLIC_TAMBO_API_KEY to showcase/.env"
setup_env_file "docs" "You need to add your NEXT_PUBLIC_TAMBO_API_KEY to docs/.env"
setup_env_file "apps/web" "apps/web/.env created with defaults - update DATABASE_URL and API keys as needed"
setup_env_file "apps/api" "apps/api/.env created with defaults - update OPENAI_API_KEY and other secrets"
setup_env_file "packages/db" "packages/db/.env created with default DATABASE_URL"
setup_env_file "apps/docs-mcp" "apps/docs-mcp/.env created - set INKEEP_API_KEY if using MCP tools"
# Copy .plans directory if it exists in root repo
if [ -d "$CONDUCTOR_ROOT_PATH/.plans" ]; then
echo " - Copying .plans/ from root repo..."
cp -r "$CONDUCTOR_ROOT_PATH/.plans" .
fi
# Build packages
echo "🔨 Building packages..."
npm run build
echo "✅ Workspace setup complete!"